Identifications¶
Summary¶
Classes
Functions
|
Search identifications |
|
Get one or more identification records by ID |
Module Contents¶
- pyinaturalist.v1.identifications.get_identifications(**params)¶
Search identifications
Notes
API reference: GET /identifications
- Parameters:
current_taxon (
Optional
[bool
]) – ID’s taxon is the same it’s observation’s taxonown_observation (
Optional
[bool
]) – ID was added by the observeris_change (
Optional
[bool
]) – ID was created as a results of a taxon changetaxon_active (
Optional
[bool
]) – ID’s taxon is currently an active taxonobservation_taxon_active (
Optional
[bool
]) – Observation’s taxon is currently an active taxonrank (
Union
[str
,Iterable
[str
],None
]) – ID’s taxon must have this rank # Multiple choiceobservation_rank (
Union
[str
,Iterable
[str
],None
]) – Observation’s taxon must have this rank # Multiple choiceuser_id (
Union
[int
,Iterable
[int
],str
,Iterable
[str
],None
]) – Identifier must have this user IDuser_login (
Union
[str
,Iterable
[str
],None
]) – Identifier must have this user logincurrent (
Optional
[bool
]) – Most recent Identification on a observation by a usercategory (
Union
[str
,Iterable
[str
],None
]) – Type of identificationplace_id (
Union
[int
,Iterable
[int
],None
]) – Observation must occur in this placequality_grade (
Union
[str
,Iterable
[str
],None
]) – Observation must have this quality gradetaxon_id (
Union
[int
,Iterable
[int
],None
]) – Identification taxa must match the given taxa or their descendantsobservation_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Observation taxa must match the given taxa or their descendantsiconic_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Identification iconic taxon IDobservation_iconic_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Observation iconic taxon IDlrank (
Optional
[str
]) – Identification taxon must have this rank or higherhrank (
Optional
[str
]) – Identification taxon must have this rank or lowerobservation_lrank (
Optional
[str
]) – Observation taxon must have this rank or higherobservation_hrank (
Optional
[str
]) – Observation taxon must have this rank or lowerwithout_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude Identifications of these taxa and their descendantswithout_observation_taxon_id (
Union
[int
,Iterable
[int
],None
]) – Exclude Identifications of observations of these taxa and their descendantsd1 (
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 dateobservation_created_d1 (
Union
[date
,datetime
,str
,None
]) – Observation must be created on or after this dateobservation_created_d2 (
Union
[date
,datetime
,str
,None
]) – Observation must be created on or before this dateobserved_d1 (
Union
[date
,datetime
,str
,None
]) – Observation must be observed on or after this dateobserved_d2 (
Union
[date
,datetime
,str
,None
]) – Observation must be observed on or before this dateper_page (
Optional
[int
]) – Number of results to return in a page. The maximum value is generally 200, unless otherwise notedcount_only (
Optional
[bool
]) – Only return a count of results; alias forper_page=0
reverse (
Optional
[bool
]) – Reverse the order of results; alias fororder='descending'
dry_run (
Optional
[bool
]) – Just log the request instead of sending a real requestsession (
Optional
[Session
]) – An existing Session object to use instead of creating a new one
Example
Get all of your own species-level identifications:
>>> response = get_identifications(user_login='my_username', rank='species') >>> print([f"{i['user']['login']}: {i['taxon_id']} ({i['category']})" for i in response['results']]) [155043569] Species: 76465 (leading) added on 2021-02-15 10:46:27-06:00 by jkcook [153668189] Species: 76465 (supporting) added on 2021-02-06 17:43:37+00:00 by jkcook [147500725] Species: 1163860 (improving) added on 2020-12-24 23:52:30+00:00 by jkcook ...
from datetime import datetime from dateutil.tz import tzoffset { 'total_results': 873, 'page': 1, 'per_page': 2, 'results': [ { 'id': 155554373, 'uuid': '88031477-a183-46c6-8de3-06bac7b5f220', 'user': { 'id': 2115051, 'login': 'jkcook', 'spam': False, 'suspended': False, 'created_at': '2019-08-10T17:52:01+00:00', 'login_autocomplete': 'jkcook', 'login_exact': 'jkcook', 'name': 'Jordan Cook', 'name_autocomplete': 'Jordan Cook', 'orcid': None, 'icon': 'https://static.inaturalist.org/attachments/users/icons/2115051/thumb.jpeg?1591994381', 'observations_count': 706, 'identifications_count': 542, 'journal_posts_count': 0, 'activity_count': 1248, 'species_count': 357, 'universal_search_rank': 706, 'roles': [], 'site_id': 1, 'icon_url': 'https://static.inaturalist.org/attachments/users/icons/2115051/medium.jpeg?1591994381', }, 'created_at': datetime(2021, 2, 18, 20, 31, 32, tzinfo=tzoffset(None, -21600)), 'created_at_details': { 'date': '2021-02-18', 'day': 18, 'month': 2, 'year': 2021, 'hour': 20, 'week': 7, }, 'body': None, 'category': 'supporting', 'current': True, 'flags': [], 'own_observation': True, 'taxon_change': None, 'vision': False, 'disagreement': False, 'previous_observation_taxon_id': 60132, 'spam': False, 'taxon_id': 60132, 'hidden': False, 'current_taxon': True, 'taxon': { 'id': 60132, 'rank': 'species', 'rank_level': 10, 'iconic_taxon_id': 47126, 'ancestor_ids': [ 47126, 211194, 47125, 47124, 47605, 47604, 201654, 632883, 632885, 48561, 60132, ], 'is_active': True, 'min_species_taxon_id': 60132, 'min_species_ancestry': '47126,211194,47125,47124,47605,47604,201654,632883,632885,48561,60132', }, 'observation': 'TRUNCATED', 'moderator_actions': [], 'observed_on': None, }, { 'id': 155554077, 'uuid': '12922da1-a203-46f2-b0f2-fd21917b4b07', 'user': { 'id': 2115051, 'login': 'jkcook', 'spam': False, 'suspended': False, 'created_at': '2019-08-10T17:52:01+00:00', 'login_autocomplete': 'jkcook', 'login_exact': 'jkcook', 'name': 'Jordan Cook', 'name_autocomplete': 'Jordan Cook', 'orcid': None, 'icon': 'https://static.inaturalist.org/attachments/users/icons/2115051/thumb.jpeg?1591994381', 'observations_count': 706, 'identifications_count': 542, 'journal_posts_count': 0, 'activity_count': 1248, 'species_count': 357, 'universal_search_rank': 706, 'roles': [], 'site_id': 1, 'icon_url': 'https://static.inaturalist.org/attachments/users/icons/2115051/medium.jpeg?1591994381', }, 'created_at': datetime(2021, 2, 18, 20, 29, 6, tzinfo=tzoffset(None, -21600)), 'created_at_details': { 'date': '2021-02-18', 'day': 18, 'month': 2, 'year': 2021, 'hour': 20, 'week': 7, }, 'body': None, 'category': 'supporting', 'current': True, 'flags': [], 'own_observation': True, 'taxon_change': None, 'vision': False, 'disagreement': False, 'previous_observation_taxon_id': 61340, 'spam': False, 'taxon_id': 61340, 'hidden': False, 'current_taxon': True, 'taxon': { 'id': 61340, 'rank': 'species', 'rank_level': 10, 'iconic_taxon_id': 47126, 'ancestor_ids': [ 47126, 211194, 47125, 47124, 47605, 47604, 201654, 632883, 632885, 48561, 61340, ], 'is_active': True, 'min_species_taxon_id': 61340, 'min_species_ancestry': '47126,211194,47125,47124,47605,47604,201654,632883,632885,48561,61340', }, 'observation': 'TRUNCATED', 'moderator_actions': [], 'observed_on': None, }, ], }
- pyinaturalist.v1.identifications.get_identifications_by_id(identification_id, **params)¶
Get one or more identification records by ID
Notes
API reference: GET /identifications/{id}
Example
>>> get_identifications_by_id(155554373)
from datetime import datetime from dateutil.tz import tzoffset { 'total_results': 873, 'page': 1, 'per_page': 2, 'results': [ { 'id': 155554373, 'uuid': '88031477-a183-46c6-8de3-06bac7b5f220', 'user': { 'id': 2115051, 'login': 'jkcook', 'spam': False, 'suspended': False, 'created_at': '2019-08-10T17:52:01+00:00', 'login_autocomplete': 'jkcook', 'login_exact': 'jkcook', 'name': 'Jordan Cook', 'name_autocomplete': 'Jordan Cook', 'orcid': None, 'icon': 'https://static.inaturalist.org/attachments/users/icons/2115051/thumb.jpeg?1591994381', 'observations_count': 706, 'identifications_count': 542, 'journal_posts_count': 0, 'activity_count': 1248, 'species_count': 357, 'universal_search_rank': 706, 'roles': [], 'site_id': 1, 'icon_url': 'https://static.inaturalist.org/attachments/users/icons/2115051/medium.jpeg?1591994381', }, 'created_at': datetime(2021, 2, 18, 20, 31, 32, tzinfo=tzoffset(None, -21600)), 'created_at_details': { 'date': '2021-02-18', 'day': 18, 'month': 2, 'year': 2021, 'hour': 20, 'week': 7, }, 'body': None, 'category': 'supporting', 'current': True, 'flags': [], 'own_observation': True, 'taxon_change': None, 'vision': False, 'disagreement': False, 'previous_observation_taxon_id': 60132, 'spam': False, 'taxon_id': 60132, 'hidden': False, 'current_taxon': True, 'taxon': { 'id': 60132, 'rank': 'species', 'rank_level': 10, 'iconic_taxon_id': 47126, 'ancestor_ids': [ 47126, 211194, 47125, 47124, 47605, 47604, 201654, 632883, 632885, 48561, 60132, ], 'is_active': True, 'min_species_taxon_id': 60132, 'min_species_ancestry': '47126,211194,47125,47124,47605,47604,201654,632883,632885,48561,60132', }, 'observation': 'TRUNCATED', 'moderator_actions': [], 'observed_on': None, }, { 'id': 155554077, 'uuid': '12922da1-a203-46f2-b0f2-fd21917b4b07', 'user': { 'id': 2115051, 'login': 'jkcook', 'spam': False, 'suspended': False, 'created_at': '2019-08-10T17:52:01+00:00', 'login_autocomplete': 'jkcook', 'login_exact': 'jkcook', 'name': 'Jordan Cook', 'name_autocomplete': 'Jordan Cook', 'orcid': None, 'icon': 'https://static.inaturalist.org/attachments/users/icons/2115051/thumb.jpeg?1591994381', 'observations_count': 706, 'identifications_count': 542, 'journal_posts_count': 0, 'activity_count': 1248, 'species_count': 357, 'universal_search_rank': 706, 'roles': [], 'site_id': 1, 'icon_url': 'https://static.inaturalist.org/attachments/users/icons/2115051/medium.jpeg?1591994381', }, 'created_at': datetime(2021, 2, 18, 20, 29, 6, tzinfo=tzoffset(None, -21600)), 'created_at_details': { 'date': '2021-02-18', 'day': 18, 'month': 2, 'year': 2021, 'hour': 20, 'week': 7, }, 'body': None, 'category': 'supporting', 'current': True, 'flags': [], 'own_observation': True, 'taxon_change': None, 'vision': False, 'disagreement': False, 'previous_observation_taxon_id': 61340, 'spam': False, 'taxon_id': 61340, 'hidden': False, 'current_taxon': True, 'taxon': { 'id': 61340, 'rank': 'species', 'rank_level': 10, 'iconic_taxon_id': 47126, 'ancestor_ids': [ 47126, 211194, 47125, 47124, 47605, 47604, 201654, 632883, 632885, 48561, 61340, ], 'is_active': True, 'min_species_taxon_id': 61340, 'min_species_ancestry': '47126,211194,47125,47124,47605,47604,201654,632883,632885,48561,61340', }, 'observation': 'TRUNCATED', 'moderator_actions': [], 'observed_on': None, }, ], }