iNAT API: How to find on which of my locations a certain search term has been found?

Hi all,
I researched the iNAT API to find whether there are observations of a specific search term (e.g. a species name like ‘cangrejo’) at a location given by coordinates:

https://api.inaturalist.org/v1/observations?lat=-1.53338%20&lng=-80.81285%20&radius=5&q=cangrejo&only_id=true

This returns me a list of observation ids, so I know, ‘cangrejo’ has been identified at this location within a radius of 5 km.

I would like to do this query for multiple locations at once, so I don’t have to send tens or hundreds of queries for each location.

Is this possible on the API? After researching a while, I did not find a request that could do this.

Thanks!

To my knowledge it is not possible to query several lat/lng locations at once (in onw single call/URL) using the API.

Personally would use a little python script with a “for” loop running thru a set of locations. Not sure if that is something you would be able to do

3 Likes

This would be my very basic approach if you would only want to know if and how many records there are at said location.

(this is a very rudimentary Python script, I’m by no means an expert)

couldn’t resist trying this out myself

what is the specific use case here? is it always going to be the same set of coordinates / locations, or will it potentially vary?

@pisum The idea is to query the API dynamically from a web application, allowing a user to find those from a (fixed) set of locations where the query condition is met. E.g. the user would search for a species and get a result of locations where this species has been observed previously.

@paul_luap thanks for your efforts :) However, querying the API for each location is something I would like to avoid. We have a set of ~200 locations currently which would need to be queried for each search term.
Please also see my other reply below for the use case I have in mind.

if the search area is fixed, then i would probably create the search area as in iNaturalist place, if it’s not too big. then just search by place_id=[your place].

That sounds like a viable option indeed.
I just realized from another post that I have to add 50 observations before I can add a new place. Are you probably aware of another option, lets say suggest places for someone to review and create them?

this is possible, but i don’t think there’s a designated person or group of people who would handle this specifically. (you would have to find someone who would be willing to help your cause.)

that said, if the place would be mostly for your particular case, then it would make sense for you to create it so that you would own the place and therefore be able to modify it in the future, if needed. (there’s not currently a way to transfer ownership of places or designate other folks to be able to modify them, though staff and curators would generally be able to modify community-created places, i think.)

for what it’s worth, it shouldn’t take too much time to create 50 verifiable observations. if you really wanted to speed through it, it could be done in a few minutes, depending on how fast your internet connection is. however, i think most people would be able to accomplish this in a few hours, on average. (the point of that exercise is to make sure folks have some basic familiarity with the workings of the system before they can do some of the more more advanced things that can have a bigger impact on the system.)

1 Like

Indeed if it is about querying a fixed “place” that can be covered by a polygon, creating you personal “place” might be more adequate for the use-case.

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