API extract for state_place_name?

Newbie here, ran a python script for a basic python script to extract some butterfly information (basic columns) but also wanted ‘state_place_name’ to get the provinces in Canada but it is not working. Tried place_admin1_name but that is not working either. Any ideas? thanks!

Observations don’t store the name of the country/province/state/etc. where they are located, they store the place_ids as a list of integers. You can either take the list of integers from an observation and ask the api for further information about those places, or what I would suggest is to download the full list of iNat places (http://www.inaturalist.org/places/inaturalist-places.csv.zip) and find the place_ids that you’re interested in and work with the ids. See https://forum.inaturalist.org/t/list-of-u-s-county-codes/50439 for a similar question and method.

4 Likes

Oh actually, are you talking about data you got from https://www.inaturalist.org/observations/export rather than from an API query?
If so, you want to export with place_state_name selected.

3 Likes

this (and the rest of the thread) may or may not help: https://forum.inaturalist.org/t/select-observations-to-batch-download-from-list-of-observation-ids/61657/9

no, i got the export working and pleased to find the place_state_name. I was then trying to replicate that field I got with my export by using the api.

thank you, I will take a look at your suggestion.