More structured place information from the observation API

It looks like the observation API returns two pieces of data about where an observation was made:

  • The “place_guess” which is just a string (and could be in any language)
  • A simple list of “place_ids”, with no organization

If I want to find out, for example, which country an observation was made in, it seems I have to query all of the place IDs in the list (which could be dozens) and see which one has admin_level 0. It would be really nice if the standard place levels were included in the initial observation API response or perhaps as an optional set of data invoked using the ‘extra’ parameter (e.g. ‘extra=places’). The response key pairs could look something like:
“continent”: 97394,
“country”: 1,
“admin_level_1”: 42,
“admin_level_2”: 913,

(assuming that admin level -1 is always a continent and admin level 0 is always a country).

For context, this is mainly needed for the iNaturalist2Commons tool, so that it can list where the photo was taken.

Strongly support this request. Additionally, are the geocoordinates and accuracy not exposed in this API method?

The coordinates are in a field called coordinates and the accuracy is in a field called positional_accuracy.

Is it actually useful to you to get those place IDs back, or would you actually prefer something more like

"continent": "Asia",
"country": "India"

in the observation search response? If you do want more of that place detail, or you want to consolidate place detail retrieval into one request per batch of observations, what if we added an admin_level param to the places detail endpoint, so your place request could look something like,2,3,4,5,6,7?admin_level=-1,0,1,2?

I’m a little hesitant to add to the observation search responses, which are already kind of like Tetsuo at the end of Akira. @pleary may have thoughts on this too.

1 Like

@zygy, not sure if you’re getting notifications from the Forum but would something like,2,3,4,5,6,7?admin_level=-1,0,1,2 (i.e. altering the places API to fetch only “standard” places) work for you here?

1 Like

@kueda - Sorry for the delayed response. Yes, your suggestion would be a nice improvement and would make dealing with the place data for an observation easier.

1 Like