how to query puppet for host lists and catalogs

to get a list of hosts in an environment:

curl -k -H "Accept: pson" 'https:_puppet:8140/production/facts_search/search?facts.environment=prod

to get the catalog of facts about a host:

curl -k -H "Accept: pson" 'https:_puppet:8140/prod/catalog/grox.net