In PlantID.net, I offer a link to iNaturalist observations of taxa found at Edgewood Park. This works because I know the place_id for Edgewood is 6727.
I’d like to extend this capability to other parks covered by my website, but to make a link URL I think I need to know the park’s iNat place_id, and I don’t find a list anywhere.
I’m not sure exactly what you mean by a list – I don’t think you mean a list of all iNat’s place_ids, that would be a ton of numbers! To find the place_id for a particular place, the easiest thing to do is to go to Identify and enter the name of your place in the box. When the URL refreshes, it should have the place_id. For example, I entered Edgewood County Park and the URL became https://www.inaturalist.org/observations/identify?place_id=6727. It’s not really a list because you have to do this for each place, but would this work for your needs?
Alternatively, open a record on the web client which is in the location, click details under the map, find and hover over the name of the place, and the URL preview will contain it.
For example, the following URL returns JSON data for all the places in Oregon (ancestor_id=10) that are open space (place_type=open+space) and have the word “Park” in their description (q=Park):
Each JSON block starts with the place_id and the place name. Unfortunately, you seem to be interested in California (ancestor_id=14), which has a LOT more places defined than Oregon. The JSON interface limits you to only 200 items per search (per_page=200 max). To go beyond that, you need to get the first page, save it, then increment the page counter (page=1, page=2, page=3, …) until one returns fewer than 200 items.
‘For example, the following URL returns JSON data for all the places in Oregon (ancestor_id=10) that are open space (place_type=open+space) and have the word “Park” in their description (q=Park):’
Please note this approach assumes/requires that the places be properly assigned in the geographic hierarchy, which is far from guaranteed.
This leads to a second question - is there a way to query whether iNaturalist has any observations for a taxon at a place_id? This will allow me to avoid offering a “Local Observations” link for a taxon if there are no observations to show.
i think i would do an observation search query to see if i can find any observations for the taxon and place, returning only the observation ID and only 1 observation per page. so if you get an empty result set, there aren’t any observations for the taxon in the place. otherwise, you’ll get just one ID back in the result set.