TaxonController¶
- class pyinaturalist.controllers.TaxonController(client)¶
Bases:
pyinaturalist.controllers.base.BaseController
Controller for Taxon requests
Methods
- __init__(client)¶
- autocomplete(**params)¶
Given a query string, return taxa with names starting with the search term
Notes
API reference: GET /taxa/autocomplete
There appears to currently be a bug in the API that causes
per_page
to not have any effect.
- Parameters
taxon_id (
Optional
[int
]) – Only show taxa with this ID, or its descendantsmin_rank (
Optional
[str
]) – Taxon must have this rank or higher; overridesrank
max_rank (
Optional
[str
]) – Taxon must have this rank or lower; overridesrank
rank_level (
Optional
[int
]) – Taxon must have this rank level. Some example values are 70 (kingdom), 60 (phylum), 50 (class), 40 (order), 30 (family), 20 (genus), 10 (species), 5 (subspecies)locale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesall_names (
Optional
[bool
]) – Include all taxon names in the response
- Return type
- from_id(*taxon_ids, **params)¶
Get taxa by ID
- search(**params)¶
Search taxa
Notes
API reference: GET /taxa
- Parameters
taxon_id (
Optional
[int
]) – Only show taxa with this ID, or its descendantsmin_rank (
Optional
[str
]) – Taxon must have this rank or higher; overridesrank
max_rank (
Optional
[str
]) – Taxon must have this rank or lower; overridesrank
rank_level (
Optional
[int
]) – Taxon must have this rank level. Some example values are 70 (kingdom), 60 (phylum), 50 (class), 40 (order), 30 (family), 20 (genus), 10 (species), 5 (subspecies)locale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common namesall_names (
Optional
[bool
]) – Include all taxon names in the responseparent_id (
Optional
[int
]) – Taxon’s parent must have this ID unless otherwise notedreverse (
Optional
[bool
]) – Reverse the order of results; alias fororder='descending'
- Return type