Is there a place where I can go to get a list of iNaturalist place_ids?

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.

For instance, the link to get to iNaturalist observations of American Vetch at Edgewood is https://www.inaturalist.org/observations?taxon_name=Vicia%20americana&place_id=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.

Where can I go to get a list of iNaturalist place_ids?

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?

3 Likes

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.

There is no master list available.

3 Likes

You can also get place_id lists using the search URLs, as described here: https://forum.inaturalist.org/t/how-to-use-inaturalists-search-urls-wiki.

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):

https://www.inaturalist.org/places.json?ancestor_id=10&place_type=open+space&q=Park&per_page=10&page=1

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.

All the options for places.json searches are described here: https://www.inaturalist.org/pages/api+reference#get-places.

2 Likes

‘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.

Thanks for your ideas - I’m finding my place_ids.

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.

1 Like

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.

for example: https://api.inaturalist.org/v1/observations?place_id=123&taxon_id=3&page=1&per_page=1&order=desc&order_by=created_at&only_id=true

2 Likes

Thanks, pisum - works great. (I substituted ?taxon_name for ?taxon_id).

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.