ObservationController¶
- class pyinaturalist.controllers.ObservationController(client)¶
Bases:
pyinaturalist.controllers.base.BaseController
Controller for Observation requests
Methods
- __init__(client)¶
- create(**params)¶
Create or update a new observation.
Notes
API reference: POST /observations
- Parameters
access_token (
Optional
[str
]) – An access token required for user authentication, as returned byget_access_token()
species_guess (
Optional
[str
]) – Equivalent to the ‘What did you see?’ field on the observation form. iNat will try to choose a single taxon based on this, but it may fail if it’s ambuguoustaxon_id (
Optional
[int
]) – ID of the taxon to associate with this observationobserved_on (
Union
[date
,datetime
,str
,None
]) – Alias forobserved_on_string
; acceptsdatetime
objects.observed_on_string (
Union
[date
,datetime
,str
,None
]) – Date/time of the observation. Time zone will default to the user’s time zone if not specified.time_zone (
Optional
[str
]) – Time zone the observation was made intag_list (
Union
[str
,Iterable
[str
],None
]) – Comma-separated list of tagsplace_guess (
Optional
[str
]) – Name of the place where the observation was recorded. Note: iNat will not try to automatically look up coordinates based on this stringlatitude (
Optional
[float
]) – Latitude of the observation; presumed datum is WGS84longitude (
Optional
[float
]) – Longitude of the observation; presumed datum is WGS84map_scale (
Optional
[int
]) – Google Maps zoom level (from 0 to 19) at which to show this observation’s map marker.positional_accuracy (
Optional
[int
]) – Positional accuracy of the observation coordinates, in metersobservation_fields (
Union
[Dict
,List
[Dict
],None
]) – Dict of observation fields in the format{id: value}
. Alias forobservation_field_values_attributes
.flickr_photos (
Union
[int
,Iterable
[int
],None
]) – Flickr photo ID(s) to add as photos for this observation. User must have their Flickr and iNat accounts connected, and the user must own the photo(s) on Flickr.picasa_photos (
Union
[str
,Iterable
[str
],None
]) – Picasa photo ID(s) to add as photos for this observation. User must have their Picasa and iNat accounts connected, and the user must own the photo(s) on Picasa.facebook_photos (
Union
[str
,Iterable
[str
],None
]) – Facebook photo IDs to add as photos for this observation. User must have their Facebook and iNat accounts connected, and the user must own the photo on Facebook.photos (
Union
[BinaryIO
,str
,Iterable
[Union
[BinaryIO
,str
]],None
]) – One or more image files, file-like objects, file paths, or URLssounds (
Union
[BinaryIO
,str
,Iterable
[Union
[BinaryIO
,str
]],None
]) – One or more sound files, file-like objects, file paths, or URLsphoto_ids (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – One or more IDs of previously uploaded photos to attach to the observation
- Return type
- delete(*observation_ids, **params)¶
Delete observations
- Parameters
observation_ids (
int
) – One or more observation IDs
- from_id(*observation_ids, **params)¶
Get observations by ID
- Parameters
observation_ids – One or more observation IDs
- Return type
- histogram(**params)¶
Search observations and return histogram data for the given time interval
Notes
API reference: GET /observations/histogram
Search parameters are the same as
get_observations()
, with the addition ofdate_field
andinterval
.date_field
may be either ‘observed’ (default) or ‘created’.Observed date ranges can be filtered by parameters
d1
andd2
Created date ranges can be filtered by parameters
created_d1
andcreated_d2
interval
may be one of: ‘year’, ‘month’, ‘week’, ‘day’, ‘hour’, ‘month_of_year’, or ‘week_of_year’; spaces are also allowed instead of underscores, e.g. ‘month of year’.The year, month, week, day, and hour interval options will set default values for
d1
andcreated_d1
, to limit the number of groups returned. You can override those values if you want data from a longer or shorter time span.The ‘hour’ interval only works with
date_field='created'
- Parameters
d1 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or after this dated2 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or before this dateday (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this day of the monthmonth (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this monthyear (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this yearlicense (
Union
[str
,Iterable
[str
],None
]) – Observation must have this licensephoto_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one photo with this licenseout_of_range (
Optional
[bool
]) – Observations whose taxa are outside their known rangeslist_id (
Optional
[int
]) – Taxon must be in the list with this IDquality_grade (
Optional
[str
]) – Must have this quality gradeid (
Union
[int
,Iterable
[int
],None
]) – Must have this observation IDtaxon_id (
Union
[int
,Iterable
[int
],None
]) – Only show observations of these taxa and their descendantstaxon_name (
Union
[str
,Iterable
[str
],None
]) – Taxon must have a scientific or common name matching this stringiconic_taxa (
Union
[str
,Iterable
[str
],None
]) – Taxon must by within this iconic taxonupdated_since (
Union
[datetime
,str
,None
]) – Must be updated since this timeacc (
Optional
[bool
]) – Whether or not positional accuracy / coordinate uncertainty has been specifiedcaptive (
Optional
[bool
]) – Captive or cultivated observationsendemic (
Optional
[bool
]) – Observations whose taxa are endemic to their locationid_please (
Optional
[bool
]) – Observations with the deprecated ‘ID, Please!’ flag. Note that this will return observations, but that this attribute is no longer used.identified (
Optional
[bool
]) – Observations that have community identificationsintroduced (
Optional
[bool
]) – Observations whose taxa are introduced in their locationmappable (
Optional
[bool
]) – Observations that show on map tilesnative (
Optional
[bool
]) – Observations whose taxa are native to their locationpcid (
Optional
[bool
]) – Observations identified by the curator of a project. If theproject_id
parameter is also specified, this will only consider observations identified by curators of the specified project(s)popular (
Optional
[bool
]) – Observations that have been favorited by at least one usertaxon_is_active (
Optional
[bool
]) – Observations of active taxon conceptsthreatened (
Optional
[bool
]) – Observations whose taxa are threatened in their locationverifiable (
Optional
[bool
]) – Observations with aquality_grade
of eitherneeds_id
orresearch
. Equivalent toquality_grade=needs_id,research
not_id (
Union
[int
,Iterable
[int
],None
]) – Must not have this IDplace_id (
Union
[int
,Iterable
[int
],None
]) – Must be observed within the place with this IDproject_id (
Union
[int
,Iterable
[int
],None
]) – Must be added to the project this ID or slugrank (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this ranksite_id (
Union
[str
,Iterable
[str
],None
]) – Must be affiliated with the iNaturalist network website with this IDofv_datatype (
Union
[str
,Iterable
[str
],None
]) – Must have an observation field value with this datatypesound_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one sound with this licensewithout_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations of these taxa and their descendantsuser_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Observer must have this user ID or loginuser_login (
Union
[str
,Iterable
[str
],None
]) – Observer must have this user loginident_user_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Identifier must have this user ID or loginterm_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled term IDterm_value_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled value ID. Must be combined with theterm_id
parameterwithout_term_value_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations with annotations using this controlled value ID. Must be combined with theterm_id
parameteracc_above (
Optional
[str
]) – Must have an positional accuracy above this value (meters)acc_below (
Optional
[str
]) – Must have an positional accuracy below this value (meters)created_d1 (
Union
[datetime
,str
,None
]) – Must be created at or after this timecreated_d2 (
Union
[datetime
,str
,None
]) – Must be created at or before this timecreated_on (
Union
[date
,datetime
,str
,None
]) – Must be created on this dateobserved_on (
Union
[date
,datetime
,str
,None
]) – Must be observed on this dateunobserved_by_user_id (
Optional
[int
]) – Must not be of a taxon previously observed by this userapply_project_rules_for (
Optional
[str
]) – Must match the rules of the project with this ID or slugcs (
Optional
[str
]) – Taxon must have this conservation status code. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsa (
Optional
[str
]) – Taxon must have a conservation status from this authority. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsi (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this IUCN conservation status. If theplace_id
parameter is also specified, this will only consider statuses specific to that placegeoprivacy (
Union
[str
,Iterable
[str
],None
]) – Must have this geoprivacy settingtaxon_geoprivacy (
Union
[str
,Iterable
[str
],None
]) – Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.identifications (
Optional
[str
]) – Identifications must meet these criterialat (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)lng (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)radius (
Optional
[float
]) – Must be within a {radius} kilometer circle around this lat/lng (lat, lng, radius)not_in_project (
Union
[int
,str
,None
]) – Must not be in the project with this ID or slugnot_matching_project_rules_for (
Union
[int
,str
,None
]) – Must not match the rules of the project with this ID or slugsearch_on (
Optional
[str
]) – Properties to search on, when combined with q. Searches across all properties by defaultreviewed (
Optional
[bool
]) – Observations have been reviewed by the user with ID equal to the value of theviewer_id
parameterlocale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesttl (
Optional
[str
]) – Set theCache-Control
HTTP header with this value asmax-age
, in secondsdate_field (
str
) – Histogram basis: either when the observation was created or observedinterval (
str
) – Time interval for histogram, with groups starting on or contained within the group value.
- Return type
- identifiers(**params)¶
Get identifiers of observations matching the search criteria and the count of observations they have identified. By default, results are sorted by ID count in descending.
Notes
API reference: GET /observations/identifiers
This endpoint will only return up to 500 results.
- Parameters
d1 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or after this dated2 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or before this dateday (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this day of the monthmonth (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this monthyear (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this yearlicense (
Union
[str
,Iterable
[str
],None
]) – Observation must have this licensephoto_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one photo with this licenseout_of_range (
Optional
[bool
]) – Observations whose taxa are outside their known rangeslist_id (
Optional
[int
]) – Taxon must be in the list with this IDquality_grade (
Optional
[str
]) – Must have this quality gradeid (
Union
[int
,Iterable
[int
],None
]) – Must have this observation IDtaxon_id (
Union
[int
,Iterable
[int
],None
]) – Only show observations of these taxa and their descendantstaxon_name (
Union
[str
,Iterable
[str
],None
]) – Taxon must have a scientific or common name matching this stringiconic_taxa (
Union
[str
,Iterable
[str
],None
]) – Taxon must by within this iconic taxonupdated_since (
Union
[datetime
,str
,None
]) – Must be updated since this timeacc (
Optional
[bool
]) – Whether or not positional accuracy / coordinate uncertainty has been specifiedcaptive (
Optional
[bool
]) – Captive or cultivated observationsendemic (
Optional
[bool
]) – Observations whose taxa are endemic to their locationid_please (
Optional
[bool
]) – Observations with the deprecated ‘ID, Please!’ flag. Note that this will return observations, but that this attribute is no longer used.identified (
Optional
[bool
]) – Observations that have community identificationsintroduced (
Optional
[bool
]) – Observations whose taxa are introduced in their locationmappable (
Optional
[bool
]) – Observations that show on map tilesnative (
Optional
[bool
]) – Observations whose taxa are native to their locationpcid (
Optional
[bool
]) – Observations identified by the curator of a project. If theproject_id
parameter is also specified, this will only consider observations identified by curators of the specified project(s)popular (
Optional
[bool
]) – Observations that have been favorited by at least one usertaxon_is_active (
Optional
[bool
]) – Observations of active taxon conceptsthreatened (
Optional
[bool
]) – Observations whose taxa are threatened in their locationverifiable (
Optional
[bool
]) – Observations with aquality_grade
of eitherneeds_id
orresearch
. Equivalent toquality_grade=needs_id,research
not_id (
Union
[int
,Iterable
[int
],None
]) – Must not have this IDplace_id (
Union
[int
,Iterable
[int
],None
]) – Must be observed within the place with this IDproject_id (
Union
[int
,Iterable
[int
],None
]) – Must be added to the project this ID or slugrank (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this ranksite_id (
Union
[str
,Iterable
[str
],None
]) – Must be affiliated with the iNaturalist network website with this IDofv_datatype (
Union
[str
,Iterable
[str
],None
]) – Must have an observation field value with this datatypesound_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one sound with this licensewithout_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations of these taxa and their descendantsuser_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Observer must have this user ID or loginuser_login (
Union
[str
,Iterable
[str
],None
]) – Observer must have this user loginident_user_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Identifier must have this user ID or loginterm_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled term IDterm_value_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled value ID. Must be combined with theterm_id
parameterwithout_term_value_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations with annotations using this controlled value ID. Must be combined with theterm_id
parameteracc_above (
Optional
[str
]) – Must have an positional accuracy above this value (meters)acc_below (
Optional
[str
]) – Must have an positional accuracy below this value (meters)created_d1 (
Union
[datetime
,str
,None
]) – Must be created at or after this timecreated_d2 (
Union
[datetime
,str
,None
]) – Must be created at or before this timecreated_on (
Union
[date
,datetime
,str
,None
]) – Must be created on this dateobserved_on (
Union
[date
,datetime
,str
,None
]) – Must be observed on this dateunobserved_by_user_id (
Optional
[int
]) – Must not be of a taxon previously observed by this userapply_project_rules_for (
Optional
[str
]) – Must match the rules of the project with this ID or slugcs (
Optional
[str
]) – Taxon must have this conservation status code. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsa (
Optional
[str
]) – Taxon must have a conservation status from this authority. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsi (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this IUCN conservation status. If theplace_id
parameter is also specified, this will only consider statuses specific to that placegeoprivacy (
Union
[str
,Iterable
[str
],None
]) – Must have this geoprivacy settingtaxon_geoprivacy (
Union
[str
,Iterable
[str
],None
]) – Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.identifications (
Optional
[str
]) – Identifications must meet these criterialat (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)lng (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)radius (
Optional
[float
]) – Must be within a {radius} kilometer circle around this lat/lng (lat, lng, radius)not_in_project (
Union
[int
,str
,None
]) – Must not be in the project with this ID or slugnot_matching_project_rules_for (
Union
[int
,str
,None
]) – Must not match the rules of the project with this ID or slugsearch_on (
Optional
[str
]) – Properties to search on, when combined with q. Searches across all properties by defaultreviewed (
Optional
[bool
]) – Observations have been reviewed by the user with ID equal to the value of theviewer_id
parameterlocale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesttl (
Optional
[str
]) – Set theCache-Control
HTTP header with this value asmax-age
, in secondsswlng (
Optional
[float
]) – SW longitude of bounding box unless otherwise notedreverse (
Optional
[bool
]) – Reverse the order of results; alias fororder='descending'
- Return type
- life_list(user_id, **params)¶
Get observation counts for all taxa in a full taxonomic tree. In the web UI, these are used for life lists.
- observers(**params)¶
Get observers of observations matching the search criteria and the count of observations and distinct taxa of rank species they have observed.
Notes
API reference: GET /observations/observers
Options for
order_by
are ‘observation_count’ (default) or ‘species_count’This endpoint will only return up to 500 results
See this issue for more details: https://github.com/inaturalist/iNaturalistAPI/issues/235
- Parameters
d1 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or after this dated2 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or before this dateday (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this day of the monthmonth (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this monthyear (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this yearlicense (
Union
[str
,Iterable
[str
],None
]) – Observation must have this licensephoto_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one photo with this licenseout_of_range (
Optional
[bool
]) – Observations whose taxa are outside their known rangeslist_id (
Optional
[int
]) – Taxon must be in the list with this IDquality_grade (
Optional
[str
]) – Must have this quality gradeid (
Union
[int
,Iterable
[int
],None
]) – Must have this observation IDtaxon_id (
Union
[int
,Iterable
[int
],None
]) – Only show observations of these taxa and their descendantstaxon_name (
Union
[str
,Iterable
[str
],None
]) – Taxon must have a scientific or common name matching this stringiconic_taxa (
Union
[str
,Iterable
[str
],None
]) – Taxon must by within this iconic taxonupdated_since (
Union
[datetime
,str
,None
]) – Must be updated since this timeacc (
Optional
[bool
]) – Whether or not positional accuracy / coordinate uncertainty has been specifiedcaptive (
Optional
[bool
]) – Captive or cultivated observationsendemic (
Optional
[bool
]) – Observations whose taxa are endemic to their locationid_please (
Optional
[bool
]) – Observations with the deprecated ‘ID, Please!’ flag. Note that this will return observations, but that this attribute is no longer used.identified (
Optional
[bool
]) – Observations that have community identificationsintroduced (
Optional
[bool
]) – Observations whose taxa are introduced in their locationmappable (
Optional
[bool
]) – Observations that show on map tilesnative (
Optional
[bool
]) – Observations whose taxa are native to their locationpcid (
Optional
[bool
]) – Observations identified by the curator of a project. If theproject_id
parameter is also specified, this will only consider observations identified by curators of the specified project(s)popular (
Optional
[bool
]) – Observations that have been favorited by at least one usertaxon_is_active (
Optional
[bool
]) – Observations of active taxon conceptsthreatened (
Optional
[bool
]) – Observations whose taxa are threatened in their locationverifiable (
Optional
[bool
]) – Observations with aquality_grade
of eitherneeds_id
orresearch
. Equivalent toquality_grade=needs_id,research
not_id (
Union
[int
,Iterable
[int
],None
]) – Must not have this IDplace_id (
Union
[int
,Iterable
[int
],None
]) – Must be observed within the place with this IDproject_id (
Union
[int
,Iterable
[int
],None
]) – Must be added to the project this ID or slugrank (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this ranksite_id (
Union
[str
,Iterable
[str
],None
]) – Must be affiliated with the iNaturalist network website with this IDofv_datatype (
Union
[str
,Iterable
[str
],None
]) – Must have an observation field value with this datatypesound_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one sound with this licensewithout_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations of these taxa and their descendantsuser_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Observer must have this user ID or loginuser_login (
Union
[str
,Iterable
[str
],None
]) – Observer must have this user loginident_user_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Identifier must have this user ID or loginterm_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled term IDterm_value_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled value ID. Must be combined with theterm_id
parameterwithout_term_value_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations with annotations using this controlled value ID. Must be combined with theterm_id
parameteracc_above (
Optional
[str
]) – Must have an positional accuracy above this value (meters)acc_below (
Optional
[str
]) – Must have an positional accuracy below this value (meters)created_d1 (
Union
[datetime
,str
,None
]) – Must be created at or after this timecreated_d2 (
Union
[datetime
,str
,None
]) – Must be created at or before this timecreated_on (
Union
[date
,datetime
,str
,None
]) – Must be created on this dateobserved_on (
Union
[date
,datetime
,str
,None
]) – Must be observed on this dateunobserved_by_user_id (
Optional
[int
]) – Must not be of a taxon previously observed by this userapply_project_rules_for (
Optional
[str
]) – Must match the rules of the project with this ID or slugcs (
Optional
[str
]) – Taxon must have this conservation status code. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsa (
Optional
[str
]) – Taxon must have a conservation status from this authority. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsi (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this IUCN conservation status. If theplace_id
parameter is also specified, this will only consider statuses specific to that placegeoprivacy (
Union
[str
,Iterable
[str
],None
]) – Must have this geoprivacy settingtaxon_geoprivacy (
Union
[str
,Iterable
[str
],None
]) – Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.identifications (
Optional
[str
]) – Identifications must meet these criterialat (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)lng (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)radius (
Optional
[float
]) – Must be within a {radius} kilometer circle around this lat/lng (lat, lng, radius)not_in_project (
Union
[int
,str
,None
]) – Must not be in the project with this ID or slugnot_matching_project_rules_for (
Union
[int
,str
,None
]) – Must not match the rules of the project with this ID or slugsearch_on (
Optional
[str
]) – Properties to search on, when combined with q. Searches across all properties by defaultreviewed (
Optional
[bool
]) – Observations have been reviewed by the user with ID equal to the value of theviewer_id
parameterlocale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesttl (
Optional
[str
]) – Set theCache-Control
HTTP header with this value asmax-age
, in secondsswlng (
Optional
[float
]) – SW longitude of bounding box unless otherwise notedreverse (
Optional
[bool
]) – Reverse the order of results; alias fororder='descending'
- Return type
- search(**params)¶
Search observations
Notes
API reference: GET /observations
- Parameters
d1 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or after this dated2 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or before this dateday (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this day of the monthmonth (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this monthyear (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this yearlicense (
Union
[str
,Iterable
[str
],None
]) – Observation must have this licensephoto_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one photo with this licenseout_of_range (
Optional
[bool
]) – Observations whose taxa are outside their known rangeslist_id (
Optional
[int
]) – Taxon must be in the list with this IDquality_grade (
Optional
[str
]) – Must have this quality gradeid (
Union
[int
,Iterable
[int
],None
]) – Must have this observation IDtaxon_id (
Union
[int
,Iterable
[int
],None
]) – Only show observations of these taxa and their descendantstaxon_name (
Union
[str
,Iterable
[str
],None
]) – Taxon must have a scientific or common name matching this stringiconic_taxa (
Union
[str
,Iterable
[str
],None
]) – Taxon must by within this iconic taxonupdated_since (
Union
[datetime
,str
,None
]) – Must be updated since this timeacc (
Optional
[bool
]) – Whether or not positional accuracy / coordinate uncertainty has been specifiedcaptive (
Optional
[bool
]) – Captive or cultivated observationsendemic (
Optional
[bool
]) – Observations whose taxa are endemic to their locationid_please (
Optional
[bool
]) – Observations with the deprecated ‘ID, Please!’ flag. Note that this will return observations, but that this attribute is no longer used.identified (
Optional
[bool
]) – Observations that have community identificationsintroduced (
Optional
[bool
]) – Observations whose taxa are introduced in their locationmappable (
Optional
[bool
]) – Observations that show on map tilesnative (
Optional
[bool
]) – Observations whose taxa are native to their locationpcid (
Optional
[bool
]) – Observations identified by the curator of a project. If theproject_id
parameter is also specified, this will only consider observations identified by curators of the specified project(s)popular (
Optional
[bool
]) – Observations that have been favorited by at least one usertaxon_is_active (
Optional
[bool
]) – Observations of active taxon conceptsthreatened (
Optional
[bool
]) – Observations whose taxa are threatened in their locationverifiable (
Optional
[bool
]) – Observations with aquality_grade
of eitherneeds_id
orresearch
. Equivalent toquality_grade=needs_id,research
not_id (
Union
[int
,Iterable
[int
],None
]) – Must not have this IDplace_id (
Union
[int
,Iterable
[int
],None
]) – Must be observed within the place with this IDproject_id (
Union
[int
,Iterable
[int
],None
]) – Must be added to the project this ID or slugrank (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this ranksite_id (
Union
[str
,Iterable
[str
],None
]) – Must be affiliated with the iNaturalist network website with this IDofv_datatype (
Union
[str
,Iterable
[str
],None
]) – Must have an observation field value with this datatypesound_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one sound with this licensewithout_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations of these taxa and their descendantsuser_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Observer must have this user ID or loginuser_login (
Union
[str
,Iterable
[str
],None
]) – Observer must have this user loginident_user_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Identifier must have this user ID or loginterm_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled term IDterm_value_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled value ID. Must be combined with theterm_id
parameterwithout_term_value_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations with annotations using this controlled value ID. Must be combined with theterm_id
parameteracc_above (
Optional
[str
]) – Must have an positional accuracy above this value (meters)acc_below (
Optional
[str
]) – Must have an positional accuracy below this value (meters)created_d1 (
Union
[datetime
,str
,None
]) – Must be created at or after this timecreated_d2 (
Union
[datetime
,str
,None
]) – Must be created at or before this timecreated_on (
Union
[date
,datetime
,str
,None
]) – Must be created on this dateobserved_on (
Union
[date
,datetime
,str
,None
]) – Must be observed on this dateunobserved_by_user_id (
Optional
[int
]) – Must not be of a taxon previously observed by this userapply_project_rules_for (
Optional
[str
]) – Must match the rules of the project with this ID or slugcs (
Optional
[str
]) – Taxon must have this conservation status code. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsa (
Optional
[str
]) – Taxon must have a conservation status from this authority. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsi (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this IUCN conservation status. If theplace_id
parameter is also specified, this will only consider statuses specific to that placegeoprivacy (
Union
[str
,Iterable
[str
],None
]) – Must have this geoprivacy settingtaxon_geoprivacy (
Union
[str
,Iterable
[str
],None
]) – Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.identifications (
Optional
[str
]) – Identifications must meet these criterialat (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)lng (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)radius (
Optional
[float
]) – Must be within a {radius} kilometer circle around this lat/lng (lat, lng, radius)not_in_project (
Union
[int
,str
,None
]) – Must not be in the project with this ID or slugnot_matching_project_rules_for (
Union
[int
,str
,None
]) – Must not match the rules of the project with this ID or slugsearch_on (
Optional
[str
]) – Properties to search on, when combined with q. Searches across all properties by defaultreviewed (
Optional
[bool
]) – Observations have been reviewed by the user with ID equal to the value of theviewer_id
parameterlocale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesttl (
Optional
[str
]) – Set theCache-Control
HTTP header with this value asmax-age
, in secondsswlng (
Optional
[float
]) – SW longitude of bounding box unless otherwise notedreverse (
Optional
[bool
]) – Reverse the order of results; alias fororder='descending'
only_id (
bool
) – Return only the record IDs
- Return type
- species_counts(**params)¶
Get all species (or other ‘leaf taxa’) associated with observations matching the search criteria, and the count of observations they are associated with. Leaf taxa are the leaves of the taxonomic tree, e.g., species, subspecies, variety, etc.
Notes
API reference: GET /observations/species_counts
- Parameters
d1 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or after this dated2 (
Union
[date
,datetime
,str
,None
]) – Must be observed on or before this dateday (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this day of the monthmonth (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this monthyear (
Union
[int
,Iterable
[int
],None
]) – Must be observed within this yearlicense (
Union
[str
,Iterable
[str
],None
]) – Observation must have this licensephoto_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one photo with this licenseout_of_range (
Optional
[bool
]) – Observations whose taxa are outside their known rangeslist_id (
Optional
[int
]) – Taxon must be in the list with this IDquality_grade (
Optional
[str
]) – Must have this quality gradeid (
Union
[int
,Iterable
[int
],None
]) – Must have this observation IDtaxon_id (
Union
[int
,Iterable
[int
],None
]) – Only show observations of these taxa and their descendantstaxon_name (
Union
[str
,Iterable
[str
],None
]) – Taxon must have a scientific or common name matching this stringiconic_taxa (
Union
[str
,Iterable
[str
],None
]) – Taxon must by within this iconic taxonupdated_since (
Union
[datetime
,str
,None
]) – Must be updated since this timeacc (
Optional
[bool
]) – Whether or not positional accuracy / coordinate uncertainty has been specifiedcaptive (
Optional
[bool
]) – Captive or cultivated observationsendemic (
Optional
[bool
]) – Observations whose taxa are endemic to their locationid_please (
Optional
[bool
]) – Observations with the deprecated ‘ID, Please!’ flag. Note that this will return observations, but that this attribute is no longer used.identified (
Optional
[bool
]) – Observations that have community identificationsintroduced (
Optional
[bool
]) – Observations whose taxa are introduced in their locationmappable (
Optional
[bool
]) – Observations that show on map tilesnative (
Optional
[bool
]) – Observations whose taxa are native to their locationpcid (
Optional
[bool
]) – Observations identified by the curator of a project. If theproject_id
parameter is also specified, this will only consider observations identified by curators of the specified project(s)popular (
Optional
[bool
]) – Observations that have been favorited by at least one usertaxon_is_active (
Optional
[bool
]) – Observations of active taxon conceptsthreatened (
Optional
[bool
]) – Observations whose taxa are threatened in their locationverifiable (
Optional
[bool
]) – Observations with aquality_grade
of eitherneeds_id
orresearch
. Equivalent toquality_grade=needs_id,research
not_id (
Union
[int
,Iterable
[int
],None
]) – Must not have this IDplace_id (
Union
[int
,Iterable
[int
],None
]) – Must be observed within the place with this IDproject_id (
Union
[int
,Iterable
[int
],None
]) – Must be added to the project this ID or slugrank (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this ranksite_id (
Union
[str
,Iterable
[str
],None
]) – Must be affiliated with the iNaturalist network website with this IDofv_datatype (
Union
[str
,Iterable
[str
],None
]) – Must have an observation field value with this datatypesound_license (
Union
[str
,Iterable
[str
],None
]) – Must have at least one sound with this licensewithout_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations of these taxa and their descendantsuser_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Observer must have this user ID or loginuser_login (
Union
[str
,Iterable
[str
],None
]) – Observer must have this user loginident_user_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Identifier must have this user ID or loginterm_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled term IDterm_value_id (
Union
[int
,Iterable
[int
],None
]) – Must have an annotation using this controlled value ID. Must be combined with theterm_id
parameterwithout_term_value_id (
Union
[int
,Iterable
[int
],None
]) – Exclude observations with annotations using this controlled value ID. Must be combined with theterm_id
parameteracc_above (
Optional
[str
]) – Must have an positional accuracy above this value (meters)acc_below (
Optional
[str
]) – Must have an positional accuracy below this value (meters)created_d1 (
Union
[datetime
,str
,None
]) – Must be created at or after this timecreated_d2 (
Union
[datetime
,str
,None
]) – Must be created at or before this timecreated_on (
Union
[date
,datetime
,str
,None
]) – Must be created on this dateobserved_on (
Union
[date
,datetime
,str
,None
]) – Must be observed on this dateunobserved_by_user_id (
Optional
[int
]) – Must not be of a taxon previously observed by this userapply_project_rules_for (
Optional
[str
]) – Must match the rules of the project with this ID or slugcs (
Optional
[str
]) – Taxon must have this conservation status code. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsa (
Optional
[str
]) – Taxon must have a conservation status from this authority. If theplace_id
parameter is also specified, this will only consider statuses specific to that placecsi (
Union
[str
,Iterable
[str
],None
]) – Taxon must have this IUCN conservation status. If theplace_id
parameter is also specified, this will only consider statuses specific to that placegeoprivacy (
Union
[str
,Iterable
[str
],None
]) – Must have this geoprivacy settingtaxon_geoprivacy (
Union
[str
,Iterable
[str
],None
]) – Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.identifications (
Optional
[str
]) – Identifications must meet these criterialat (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)lng (
Optional
[float
]) – Must be within aradius
kilometer circle around this lat/lng (lat, lng, radius)radius (
Optional
[float
]) – Must be within a {radius} kilometer circle around this lat/lng (lat, lng, radius)not_in_project (
Union
[int
,str
,None
]) – Must not be in the project with this ID or slugnot_matching_project_rules_for (
Union
[int
,str
,None
]) – Must not match the rules of the project with this ID or slugsearch_on (
Optional
[str
]) – Properties to search on, when combined with q. Searches across all properties by defaultreviewed (
Optional
[bool
]) – Observations have been reviewed by the user with ID equal to the value of theviewer_id
parameterlocale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesttl (
Optional
[str
]) – Set theCache-Control
HTTP header with this value asmax-age
, in secondsswlng (
Optional
[float
]) – SW longitude of bounding box unless otherwise notedreverse (
Optional
[bool
]) – Reverse the order of results; alias fororder='descending'
- Return type
- taxon_summary(observation_id, **params)¶
Get information about an observation’s taxon, within the context of the observation’s location
Notes
API reference: GET /observations/{id}/taxon_summary
- Parameters
observation_id (
int
) – Observation ID to get taxon summary for- Return type
- update(**params)¶
Update a single observation
Notes
API reference: PUT /observations
- Parameters
observation_id (
int
) – iNaturalist observation IDaccess_token (
Optional
[str
]) – An access token required for user authentication, as returned byget_access_token()
species_guess (
Optional
[str
]) – Equivalent to the ‘What did you see?’ field on the observation form. iNat will try to choose a single taxon based on this, but it may fail if it’s ambuguoustaxon_id (
Optional
[int
]) – ID of the taxon to associate with this observationobserved_on (
Union
[date
,datetime
,str
,None
]) – Alias forobserved_on_string
; acceptsdatetime
objects.observed_on_string (
Union
[date
,datetime
,str
,None
]) – Date/time of the observation. Time zone will default to the user’s time zone if not specified.time_zone (
Optional
[str
]) – Time zone the observation was made intag_list (
Union
[str
,Iterable
[str
],None
]) – Comma-separated list of tagsplace_guess (
Optional
[str
]) – Name of the place where the observation was recorded. Note: iNat will not try to automatically look up coordinates based on this stringlatitude (
Optional
[float
]) – Latitude of the observation; presumed datum is WGS84longitude (
Optional
[float
]) – Longitude of the observation; presumed datum is WGS84map_scale (
Optional
[int
]) – Google Maps zoom level (from 0 to 19) at which to show this observation’s map marker.positional_accuracy (
Optional
[int
]) – Positional accuracy of the observation coordinates, in metersobservation_fields (
Union
[Dict
,List
[Dict
],None
]) – Dict of observation fields in the format{id: value}
. Alias forobservation_field_values_attributes
.flickr_photos (
Union
[int
,Iterable
[int
],None
]) – Flickr photo ID(s) to add as photos for this observation. User must have their Flickr and iNat accounts connected, and the user must own the photo(s) on Flickr.picasa_photos (
Union
[str
,Iterable
[str
],None
]) – Picasa photo ID(s) to add as photos for this observation. User must have their Picasa and iNat accounts connected, and the user must own the photo(s) on Picasa.facebook_photos (
Union
[str
,Iterable
[str
],None
]) – Facebook photo IDs to add as photos for this observation. User must have their Facebook and iNat accounts connected, and the user must own the photo on Facebook.photos (
Union
[BinaryIO
,str
,Iterable
[Union
[BinaryIO
,str
]],None
]) – One or more image files, file-like objects, file paths, or URLssounds (
Union
[BinaryIO
,str
,Iterable
[Union
[BinaryIO
,str
]],None
]) – One or more sound files, file-like objects, file paths, or URLsphoto_ids (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – One or more IDs of previously uploaded photos to attach to the observation
- Return type
- upload(**params)¶
Upload one or more local photo and/or sound files, and add them to an existing observation.
You may also attach a previously uploaded photo by photo ID, e.g. if your photo contains multiple organisms and you want to create a separate observation for each one.
Notes
API reference: POST /observation_photos
- Parameters
observation_id (
int
) – the ID of the observationphotos (
Union
[BinaryIO
,str
,Iterable
[Union
[BinaryIO
,str
]],None
]) – One or more image files, file-like objects, file paths, or URLssounds (
Union
[BinaryIO
,str
,Iterable
[Union
[BinaryIO
,str
]],None
]) – One or more audio files, file-like objects, file paths, or URLsphoto_ids (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – One or more IDs of previously uploaded photos to attach to the observationaccess_token – Access token for user authentication, as returned by
get_access_token()
- Return type