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

This is a continuation of the wiki tutorial starting here:
https://forum.inaturalist.org/t/how-to-use-inaturalists-search-urls-wiki/63

The post body began exceeding the 32,000 character limit, requiring this split. See part 1 above for more background information and usage notes. The following table of contents includes, and is replicated in, both parts, and should be maintained that way to provide seamless connection between the two.


Contents (part 1)

WHAT (taxa and identifications)
Search for multiple taxa
Search multiple taxa using a list
Search for single taxon by name, synonym, or common name
Search for exact taxon (no descendants)
Search by active identification(s)
Search for observations that have no identifications
Search by taxon status (introduced, native, threatened)
WHERE (places and geography)
Search multiple places
Search by bounding box or circle
Search by location (positional) accuracy
Search by geoprivacy
Search for observations with or without georeferenced coordinates
WHEN (dates and times)
Search by date with time
Search by month(s) of year or day(s) of month

Contents (part 2)

WHO (observers and identifiers)
Search multiple observers
Search by identifier(s)
Search by account age (in weeks)
Search by multiple user license types
Other observation properties
Search for observations with or without media (photos, sounds)
Include both Captive and Wild observations
Search by observation numbers (id numbers)
Search for observation field values
Search for Annotations
Search by Description, Tag, Name, Place
Project-related queries
Search for Observations from iOS, Android, or Seek apps
More tools and tips
Search by exclusions (not place, not taxon, not observer, etc.)
Sort by Dates, Faves, or Randomly
Look up ID numbers
Change number of results per page
Change page language/locale


Part 2

Search multiple observers

To limit a search to a specific set of observers add &user_id= and a comma-separated list of user ids:

User IDs can be either login names or user numbers, but not a mixture of the two:

To exclude one or more observers, you can use &not_user_id=:

Search by identifier(s)

If you only want to see observations to which a certain user has added an ID, use the ident_user_id param. For example, here are all observations to which I have add an ID:

https://www.inaturalist.org/observations?ident_user_id=tiwane

For observations identified by one or more of several users, separate them with commas:

https://www.inaturalist.org/observations?ident_user_id=tiwane,kueda,jdmore

To exclude observations identified by particular user(s), use &without_ident_user_id=, e.g.

https://www.inaturalist.org/observations?without_ident_user_id=tiwane,jdmore

  • Both of these parameters may be used in combination.
  • The search looks for any active ID by the user(s), whether or not they match the community ID.

Search by account age (in weeks)

If you want to focus on observations from very new, very old, or in-between user accounts, you can add parameters like the following examples:

&user_after=3w - users with accounts created more recently than 3 weeks ago
&user_before=52w - users with accounts created earlier than 52 weeks ago
&user_before=4w&user_after=8w - accounts created between 4 and 8 weeks ago

  • The before and after 1w options are already available on the Identify Filters panel.

Search by multiple user license types

Single license queries are already available from the Filters panels. To query for multiple license types:

  • &photo_license=CC0,CC-BY,CC-BY-SA (example for all photo licenses accepted by Wikipedia)

  • &photo_license=CC0,CC-BY,CC-BY-NC (example for all photo licenses accepted by GBIF)

  • &sound_license=CC0,CC-BY (example for multiple sound licenses)

    • The license and licensed API parameters (for observation level licenses) are not currently supported in URLs.
    • Currently there is no way to query for “no license” (all rights reserved).
    • The system default is all observations regardless of license.

Search for observations with or without media (photos, sounds)

  • photos=true: has 1 or more photos (available in the GUI)
  • photos=false: does not have photos
  • sounds=true: has audio (available in the GUI)
  • sounds=false: does not have audio

Combine for media-less observations, e.g. https://www.inaturalist.org/observations/identify?quality_grade=casual&sounds=false&photos=false&taxon_id=3

Include both Captive and Wild observations

Some parts of the site will only show Wild observations by default, with an option to show Captive only. To be sure you are seeing both kinds of observations, use:

&captive=any&verifiable=any

  • Besides any, the other options (already in the Filters panels) are true and false.

Search by observation numbers (id numbers)

Each iNat observation has an id number that can be found in the URL for that observation. You can use this number with id= to restrict a search to specific observations.

For example, to restrict an Identify search to
https://www.inaturalist.org/observations/51170811 and
https://www.inaturalist.org/observations/51170806 use

https://www.inaturalist.org/observations/identify?id=51170811,51170806

To exclude one or more specific observations, use &not_id=:
https://www.inaturalist.org/observations/identify?not_id=51170811,51170806
(Note that not_id only works in Identify, while id also works in Explore)

Search for observation field values

You can specify observation fields and their values in the URL. For example, here are all of the observations with the observation field “Roadkill” set to “Yes”.

https://www.inaturalist.org/observations?field:roadkill=yes

You can search for all observations with a field regardless of the field value (e.g. the field “Habitat (s Afr)” only):
&field:Habitat%20(s%20Afr)

or with a field and value (e.g. “Habitat (s Afr)=Nama Karoo”):
&field:Habitat%20(s%20Afr)=Nama%20Karoo

You can easily combine these with other search strings. For example, the following shows all observations marked as being of insect herbivores of Ecualyptus.

https://www.inaturalist.org/observations?taxon_id=47158&field:Interaction->Herbivore%20of=51815

The taxon ID for Insecta is 47158 and for Eucalyptus is 51815 (which you find from the URLs of their taxon pages, https://www.inaturalist.org/taxa/47158-Insecta and https://www.inaturalist.org/taxa/51815-Eucalyptus). The observation field used here is “Interaction->Herbivore of”. Note that the space in that field name needs to be replaced with a %20 in the URL so the browser doesn’t get confused.

Observation field view
https://www.inaturalist.org/observation_fields/1234
Observation field view for a value: (e.g. Fynbos in Habitats-s-afr):
https://www.inaturalist.org/observation_fields/7498?value=Fynbos (case sensitive)
Ascending list of observation fields:
https://www.inaturalist.org/observation_fields?order_by=name&order=asc
Descending list:
https://www.inaturalist.org/observation_fields?order_by=name&order=desc

Note that &without_field= and &without_field_id= are currently not implemented.

Search for Annotations

&term_id= - the annotation group

  • 1=Life Stage, 9=Sex, 12=Plant Phenology, 17=Alive or Dead

&term_value_id= - the value within the group

  • Life Stage: 2=Adult, 3=Teneral, 4=Pupa, 5=Nymph, 6=Larva, 7=Egg, 8=Juvenile, 16=Subimago
  • Sex: 10=Female, 11=Male
  • Plant Phenology: 13=Flowering, 14=Fruiting, 15=Flower Budding, 21=No Evidence of Flowering
  • Alive or Dead: 18=Alive, 19=Dead, 20=Cannot Be Determined

Both the group parameter and value parameter should be included in the URL. And term_value_id should be able to accept a comma-separated list of more than one value.

Here are all verifiable Lepidoptera observations with a Life Stage of Larva: https://www.inaturalist.org/observations?place_id=any&taxon_id=47157&term_id=1&term_value_id=6

And here are all verifiable Lepidoptera observations with a LIfe Stage of Larva or Adult: https://www.inaturalist.org/observations?page=2&place_id=any&taxon_id=47157&term_id=1&term_value_id=2,6

To exclude observations with particular annotations, use the following similar to the above:

  • &without_term_id= the annotation group
  • &without_term_value_id= the value within the group

Search by Description, Tag, Name, Place

The Explore and Identify filters include a box called Description / Tags. This box actually searches 4 things: description, tags, names of taxa with active IDs, and place descriptions. To search just one of these at a time, you can specify a search term and also which one to search.

Specify the search term with &q=searchterm, for example &q=small. Replace spaces with %20, for example &very%20small.

  • To restrict the search to the description, use &search_on=description
  • To restrict the search to tags, use &search_on=tags
  • To restrict the search to active ID taxon names, use &search_on=names
  • To restrict the search to the description of the place (also called the “locality notes” or the place_guess), use &search_on=place

As an example, https://www.inaturalist.org/observations?q=leaf%20miner&search_on=tags searches for observations with the tag ‘leaf miner’.

Current limitations: This tool cannot search the text within comments or ID comments.

Project-related queries

&project_id= is used by the standard filter window, and restricts a search to observations in a selected Project. This is also a good way to look up and copy the Project ID for use with other Project queries.

Use not_in_project= to find observations that are in a place and not in a project, for example, all beetles in NZ currently not in the NZ beetles project:
place_id=94916 New Zealand Zone
taxon_id=47208 Coleoptera
https://www.inaturalist.org/observations?place_id=94916&taxon_id=47208&not_in_project=nz-beetles-and-their-grubs

If a project is more complicated than just taxa in a place, you can filter observations based on matching the complete rule-set of a project, or on not matching it:

  • &apply_project_rules_for=
  • &not_matching_project_rules_for=

NOTE: these are from the iNaturalist API documentation found here (scroll down the page at that link). I haven’t specifically tested these. If they don’t work as expected, please reply to this post.

Search for Observations from iOS, Android, or Seek apps

The &oauth_application_id parameter allows searching observations by the source of upload.

Search by exclusions (not place, not taxon, not observer etc.)

Many of the above searches can also be excluded from results. These options are collected here again for convenience.

  • &without_taxon_id= (excludes one or more taxa and their descendants)
  • &exact_taxon_id= (Identify only; excludes descendants of one or more taxa)
  • &without_direct_taxon_id= (Identify only; works like without_taxon_id but descendants aren’t excluded)
  • &not_in_place= (excludes one or more places)
  • &geo=false without a location (though you may want to also exclude private observations with &geoprivacy=open,obscured&taxon_geoprivacy=open,obscured)
  • &not_user_id= (excludes one or more observers)
  • &without_ident_user_id= (not identified by one or more users)
  • &not_id= (Identify only; excludes a list of specific observations by id number)
  • &without_term_id= (the annotation group)
  • &without_term_value_id= (the value within the annotation group)
  • &not_in_project= (not included in one or more projects)
  • &not_matching_project_rules_for=

For example, I want to identify Asteraceae (47604) from California (14), but not sagebrush or rubber rabbitbrush (genus Artemisia 52855 or species Ericameria nauseosa 57934) and not from the Sierra Nevada (52173) or the White Mountains (129416), not my own (51061), and without the plant phenology annotation “flowering”:

https://www.inaturalist.org/observations/identify?place_id=14&taxon_id=47604&not_in_place=129416,52173&without_taxon_id=52855,57934&not_user_id=51061&term_id=12&without_term_value_id=13

Of course, if any of your “with” and “without” parameters conflict, you should expect to get conflicting results! (or none at all).

Sort by Dates, Faves, or Randomly

The Identify Filters panel already has options built in to sort by Date Added (default), Date Observed, Date Updated (edited), Faves, or Random. Sorting options are Descending (default) or Ascending.

Two of these options are not available in the Explore filters, but can still be added manually: Date Updated and Random. To add these, use

  • &order_by=updated_at
  • &order_by=random

Sorting order is specified by

  • &order=desc or
  • &order=asc

For example https://www.inaturalist.org/observations?place_id=any&iconic_taxa=Aves&order_by=updated_at&order=asc will show you all bird observations sorted by date last edited, with observations updated longest ago displayed first.

Look up ID numbers

ID numbers are needed for many of the searches detailed herein. Here are some easy ways to find them:

  • User: go to the user’s profile page, then add .json to the URL and press enter. ID is first number listed.
  • Taxon: In Identify use the Species box at top to find and select the desired Taxon. The &taxon_id number will be added to the URL in the browser address bar.
    • OR, go to the page for that taxon and the number will be part of the URL.
  • Place: In Identify use the Place box at top to find and select the desired Place. The &place_id number will be added to the URL in the browser address bar.
  • Project: In Identify go to Filters, then More Filters, enter and select the project in the Project box. The &project_id number will be added to the URL in the browser address bar.
    • If the project “URL slug” is needed instead of the number, go to the page for that project, or hover over a link to it, and the “slug” follows the last slash (/) in the URL.
    • For example, flora-of-russia is the URL slug for https://www.inaturalist.org/projects/flora-of-russia
  • List: go to the page for that list, or hover over a link to it, and the number will be part of the URL.

Change number of results per page

(works in Identify only)

To change the number of observations displayed per page in Identify, add &per_page= followed by a number up to 200.

https://www.inaturalist.org/observations/identify?place_id=50&per_page=10

Change page language/locale

To display any translatable iNat page in another language without changing your settings:

14 Likes

Just a note folks – for general questions or comments on the wiki, let’s keep adding those to the thread on Part 1 to keep things from getting too scattered. Comments specific to there being a Part 2 can go here. Thanks.

1 Like

A post was merged into an existing topic: Observations/Identifiers count discrepancies

Hi @jdmore , @bouteloua or @pisum what is the URL that would look for any active ID by the user(s), restricted to the IDs that match the community ID ?

Many thanks

(the similar yet larger discussion moved to topic 18792 became part of a bug report, but this question is about available parameters).

I don’t believe there is any way to search for observations meeting the conditions you are asking about.

Separately, you can find observations actively identified by a particular user, or observations actively identified as a particular taxon. But there is no way to guarantee that the identification of the user is for that same taxon, or that the taxon is the same as the Community ID.

1 Like

i’ll preface this post by saying most of the stuff i’m about to write is sort of unrelated to the observation search. it’s more related to searching for identifications. so it may not all directly tie to the original post in this thread.

yup. i’m not aware of a way for regular users like us to query for this specifically. and really, you probably wouldn’t be looking for observations in this case. you probably would be looking for identifications. with that said, there are indirect ways to get the kind of information @odole is asking about.

if you pull back a set of identifications using the identifications API endpoint, the results do include the taxon of both the identification and observation. so you could parse through the results and do your own filter to exclude cases where ID taxon <> obs taxon. for example, if you look at this page i made, you’ll find a column that tells you whether ID taxon = obs taxon: https://jumear.github.io/stirfry/iNatAPIv1_identifications.html?user_id=tiwane.

(if you want to look for ID taxon <> community taxon, i believe that’s doable, too. the logic would just have to factor in cases where community taxon <> obs taxon, which should only occur when you have a maverick observer who has opted out of community ID.)

another indirect way to get at this kind of data is to filter by identification category. maverick would tell you that your id is in the minority. so by definition, a maverick ID’s taxon would not be the same as the observation taxon (unless the observer is an opt-out maverick). for example: https://jumear.github.io/stirfry/iNatAPIv1_identifications.html?user_id=tiwane&category=maverick

also, especially if your definition of ID taxon <> obs taxon includes parent taxa <> child taxon, you might be able to look for cases where the rank of the ID <> rank of the taxon. so you could do something like either of the following:

finally, i will also refer you to another discussion: https://forum.inaturalist.org/t/how-to-exclude-observations-with-disagreeing-ids/15016/12. it’s somewhat unrelated to both this thread and @odole’s question, but judging by @odole’s questions so far in this forum, i suspect that @odole will eventually ask about this topic.

… mhm…
Thank you and thank you @jdmore

A post was merged into an existing topic: Ideas for a revamped Explore/Observations Search Page