How to use iNaturalist's Search URLs - wiki - part 2 of 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.


NOTES:

  • The search methods below are only for Observations in explore or identify mode. Most will work in both contexts, but some may only work in one context or the other. Most can be combined in one search URL.
  • Searches may return fewer results than expected unless you first override certain default filters (quality_grade=needs_id, reviewed=false in Identify; verifiable=true in Explore; default place in either). Any or all these defaults can be overridden using the existing Filters window. To ensure that no default filters are limiting results you can also manually add the following to any search URL:
    &quality_grade=any&reviewed=any&verifiable=any&place_id=any
  • Because these URL parameters are based on the API, further information may be found in the API documentation

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
Search for mappable/unmappable observations
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 fields and 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)

    • Use lower-case license parameters to ensure functionality in Identify.
    • The license and licensed API parameters (for observation level licenses) are not currently supported in URLs.
    • If you want to search for observations that have no photo license (aka all rights reserved), use photo_licensed=false. (unfortunately, there is no corresponding sound_licensed parameter.)
    • 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?id=51170811,51170806&verifiable=any&place_id=any

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 fields and 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 also find observations missing a named field:
&without_field=Name of Associated Plant

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

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

Search for Annotations

&term_id= - the annotation group

  • 1=Life Stage, 9=Sex, 12=Plant Phenology, 17=Alive or Dead, 22=Evidence of Presence

&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
  • Evidence of Presence: 23=Feather, 24=Organism, 25=Scat, 26=Track, 27=Bone, 28=Molt, 29=Gall

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= to exclude observations with any annotation in this group
  • &term_id=xx&without_term_value_id= to exclude observations with a specific annotation value

For example, to see observations NOT marked as alive, dead, or undetermined use https://www.inaturalist.org/observations/identify?without_term_id=17

For observations that are marked as alive or undetermined but NOT dead, use https://www.inaturalist.org/observations/identify?term_id=17&without_term_value_id=19

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)
  • &without_field= (the name of a field)
  • &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:

back to part 1

33 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

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.

2 Likes

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

I’m sorry if repeating some question answered before. Just couldn’t find anything related after searching many threads carefully.

I’m writing various buletins journals about butterflies and moths species found in my region – the brazilian savannah – but noticed that if I could soft code the place_id parameter in my explore URL, they would become much more helpful for those eventually reading these posts.

The idea is to write something like

… href="/observations?place_id=ANYTHING&subview=grid&taxon_id=…

where ‘ANYTHING’ would be automatically replaced by the “default search place“ within the user profile. I’ve tried the words ‘default’ and ‘standard’ in lieu of ‘ANYTHING’ but neither worked out. Any hint or a workaround?

Thanks.

If you completely omit the place_id= parameter from the URL, it should default to the search place (if any) of each logged-in user who follows the URL. This would be different for each user. If you are wanting it to always search in your default search place (for anyone following the URL), then you would need to hard-code that place with place_id= in the URL.

Hope I am understanding your question correctly…?

Exactly! That’s what I was looking for, Jim. Thanks a lot. :smiley:

1 Like

Does anyone know how to find all the empty observation fields:

The equivalent of
&field:Habitat%20(s%20Afr)=NULL

&field:Habitat%20(s%20Afr)= gives any value
&field:Habitat%20(s%20Afr)=any - gives any value

But is there a way for fields with no values.

I ask because the Android App is proliferating large numbers of empty fields and I would like to remove them. (preferably without downloading all the data).

While I am asking, is there a way of finding values in a field, that are not on the allowable values list?
This may happen if one adjusts a field allowable value without checking the values already present.
(I am not sure that other “values” will display in the summary list - perhaps they do.) [But this question is just out of curiosity, the former is my real question, and applies to fields with any values]

Unfortunately I don’t believe either is currently possible. See linked feature request discussion in:

strictly those are about not having the field or the field ID - i.e. existing values that are not present

My question is having the field, but with an empty value

((and while I am about it, how does one find a field_id=? - i.e. if someone enters the value “?”))

Yes, I’m pretty sure those are not possible to search either.

1 Like

? is encoded in the URL as %3F. for example, this will find observations with the value ? set for a parameter Notes/comments?: https://www.inaturalist.org/observations?verifiable=any&field:Notes%2Fcomments%3F=%3F

I have probably missed it, but I want to find observations that dont have a date observed.
Something like:
https://www.inaturalist.org/observations?place_id=any&taxon_id=517449&date_observed=false
but I cannot find it. date=, d1=, d=
and year=null/false hangs the system.

This does find it, but it includes lots of other casual data, that I am not interested in:
https://www.inaturalist.org/observations?photos&place_id=any&taxon_id=517449&verifiable=false
(i.e. it includes missing localities, dates, sounds, captive, and other DQA marked up observations)

2 Likes

in general, unless there is a separate without_ or not_in_ parameter provided, i don’t think the system provides a way to filter for cases where a given parameter’s referenced field is not set, and i don’t think the system provides a way to explicitly look for null, undefined, empty, etc., and i don’t think it allows for wildcards either.

you can get non-verifiable + georeferenced (has location) + non-captive + has photos + non-spam observations: https://www.inaturalist.org/observations?verifiable=false&photos=true&geo=true&captive=false. it’s not exactly a set of observations that doesn’t have dates, but it overlaps a lot with a no-date set of observations.

Is there a URL construction to search for observations with any of a few values of the same observation field? E.g., “Plant mine” field set to “leaf mine” or “stem mine” but not its other values.

Update: I mean that multiple values of the field are included in the same, single search.

Of course, you can open an observation with the value you need and click on that obs. field, it’ll ask you if you want all obs with it or with the same value. URL will be like this one: &field:Beak%20deformity%20type=Both%20mandibles%20overgrown

Yes, that works for searching for a single field value. I have clarified my question, which is to search for multiple field values – but not all the possible values – at once.

Try adding part with values you need in url (whole parts of it about each value).