How do I access certain columns through an API Query

I have a project where participants are starting to load useful data into observations using Observation Fields that are not part of the standard output for CSV downloads or the API query defaults. For instance, I have a query (= Json.Document(Web.Contents(" https://api.inaturalist.org/v1/observations?place_id=123662&field:DNA%20Barcode%20ITS&per_page=200")) that returns the DNA Barcode field but not the others associated with it (such as all the Mycomap Importance indices – see attached). Are these new fields that will appear eventually, or is there some process for making them available?

1 Like

for the CSV export, see https://forum.inaturalist.org/t/not-possible-to-select-from-all-existing-observation-field-values-during-data-export/32133

not sure what you mean about API defaults. you should be able to specify whatever you like via the API.

Apologies for the obscurity. By “API Defaults” I mean the data elements that are retrieved in an API query. Since I am not able to specify particular columns (or at least I do not know how to do that with the iNat API) whatever I get when I make an API query would be the “default” list.

are you asking how to parse the API response to show multiple observation fields, or are you trying to filter using multiple observation fields?

I’m able to parse using Excel Power Query. I can also see/browse the json in a browser window (FireFox). I’m not seeing any of the Observation Fields in my API query retrieval that are appearing in the web interface (see uploaded attachment above). Maybe these MycoMap Importance Index fields are too new (i.e. loaded in the last 12 hours) and will be included in the retrieval dataset before too long.

I’d also love to limit the API query to only fields I’m interested in to reduce size and post-query processing but that may not be in the software.

Thanks for your attention.

the observation fields are nested within the observation records. so as long as you’ve expanded the ofvs object in Power Query, you should be able to see all observation fields. for example:

the future v2 version of the API will allow you to specify which fields you want to return, but that could actually make it harder to get data using a tool like Excel, depending on how complex your particular request is.

4 Likes

Excellent! Thank you!

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