How to use iNaturalist's Search URLs - wiki part 1 of 2

https://www.inaturalist.org/observations?taxon_name=Bouteloua%20curtipendula

4 Likes

Thanks @JeremyHussell, that works.

For some reason I had tried the taxon_name= syntax before and got nowhere. I wonder what I got wrong.

2 Likes

I added a section to the wiki for this one, just under “Search for Multiple Taxa.” There are some limitations mentioned there that you might have run up against. For spaces you can use either %20 or +

2 Likes

This was brought up a couple of posts above yours, and unfortunately it’s not available in the current API search capabilities. See the link there for a place to request it.

On more investigation, this is not particularly useful in complex queries that have a chance of returning no matching results. When there are no matching results on taxon name, it shows all results that match the other criteria.

Added related feature request here.

1 Like

Would you give us an example of a search with taxon_name which returns results from other taxa? I wasn’t able to find any which behave that way in a few minutes of messing around, so it sounds like there might be some specific trigger.

If you take your Bouteloua curtipendula URL above, and change it to Bouteloua curtipendulus, it returns all iNaturalist observations of all taxa.

1 Like

Ah, I get it now. Thanks for the clarification. I focused too much on the “complex queries” part, thinking it meant that adding a bunch of other parameters like place, time, and person caused the search to return wrong results.

1 Like

Thanks for jumping in while I was away from the computer @jdmore

Here are two examples using a more complex query.

This one works:

https://www.inaturalist.org/observations?taxon_name=Aristotelia+peduncularis&project_id=vascular-flora-of-tasmania&ident_user_id=mftasp,mattintas

This one does not, and instead returns all records that fulfil the rest of the criteria:

https://www.inaturalist.org/observations?taxon_name=Gunnera+cordifolia&project_id=vascular-flora-of-tasmania&ident_user_id=mftasp,mattintas

1 Like

@mftasp after some more experimenting, I added more information to the wiki section regarding synonyms and common names. These will work using the same search parameter. But if they are not unique in iNaturalist (e.g., used for more than one taxon), it will only return results for one of the taxa.

1 Like

Love this, great information. I was trying to figure out how to add observation tag values to search strings, which is super useful. However, I noticed that when the tag is a taxon tag (e.g., Host Plant ID), results are returned only for exact matches and do not including daughter taxa. This makes sense, but in some cases it would be even more useful if I could, for example, get results with a tag containing a genus OR any species in that genus. For example, https://www.inaturalist.org/observations?project_id=33779&field:Host%20Plant%20ID=53854 returns observations in Leafminers of North America that have the tag Host Plant ID = Ilex, but not those with Host Plant ID = Ilex opaca (or any other Ilex identified beyond genus). Would be nice if it could do the latter as well. Also, looks like it doesn’t allow you to search multiple taxon ids at once by concatenating with a comma.

1 Like

Has anything about how this works changed recently? I’m trying to set up a search string to show all the observations in a project that aren’t mine. What I put together is https://www.inaturalist.org/observations?project_id=61767&not_user_id=er1kksen

When I search this, I just get the spinning “searching” arrows in perpetuity. When I change it to just &user_id , no problem. Substituting other user IDs produces the same result. I tried the same thing from my phone without being logged in and still got the same result.

To follow up a little more I set up a search that would exclude all observations in that project that are NOT within chautauqua county, NY- should get zero results as the whole project area is in that county. Instead I get the exact same results from &not_place_id=693 as using &place_id=693.

not_user_id requires the numerical user id, not the string. If you go to your profile page and add .json to the end of the URL, the first number is the user id – for you it’s 192963, so the working search is https://www.inaturalist.org/observations?project_id=61767&not_user_id=192963.

The correct place exclusion search term is not_in_place (rather than not_place_id), so the working search URL is https://www.inaturalist.org/observations?project_id=61767&not_in_place=693.

5 Likes

Ah, thanks. I guess since my actual username (which I guess is a “string”?) worked for the positive query it didn’t occur to me it wouldn’t work the same for a negative one. The place filter I apparently just fumbled entirely.

4 Likes

Yeah, I’m not totally sure why they’re implemented differently. I added a small note up top to hopefully clarify that going forward.

3 Likes

I am unable to find all NYC White Snakeroot (Ageratina altissima) observations that do NOT have a value for observation field Leaf Miner

I tried many of the very useful tips shared here (thank you all, especially Tony Iwane).

I can find those with observation field Leaf Miner = any value
https://www.inaturalist.org/observations?verifiable=any&taxon_id=119048&place_id=674&field:Leaf%20Miner

Here are the strings I tried so far to find where observation field Leaf Miner is null:

&not_field:Leaf%20Miner
&without_field:Leaf%20Miner
&field:not_Leaf%20Miner
&field:without_Leaf%20Miner
&without_field:Leaf%20Miner
&without_field_Leaf%20Miner
&not_field_Leaf%20Miner

And all of the above with and without Leaf%20Miner=yes,no,unclear

Thank you for any tips.

1 Like

Feel free to vote for the feature request.

1 Like

hey, welcome to the forum! :)

Thank you! I voted. There are now 8 votes.