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
  • q (Optional[str]) – Name must begin with this value

  • is_active (Optional[bool]) – Taxon is active

  • taxon_id (Optional[int]) – Only show taxa with this ID, or its descendants

  • rank (Optional[str]) – Taxon must have this exact rank

  • min_rank (Optional[str]) – Taxon must have this rank or higher; overrides rank

  • max_rank (Optional[str]) – Taxon must have this rank or lower; overrides rank

  • 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 names

  • preferred_place_id (Optional[int]) – Place preference for regional taxon common names

  • all_names (Optional[bool]) – Include all taxon names in the response

Return type

Paginator[Taxon]

from_id(*taxon_ids, **params)

Get taxa by ID

Parameters

taxon_ids – One or more taxon IDs

Return type

Paginator[Taxon]

search(**params)

Search taxa

Notes

Parameters
  • q (Optional[str]) – Name must begin with this value

  • is_active (Optional[bool]) – Taxon is active

  • taxon_id (Optional[int]) – Only show taxa with this ID, or its descendants

  • rank (Optional[str]) – Taxon must have this exact rank

  • min_rank (Optional[str]) – Taxon must have this rank or higher; overrides rank

  • max_rank (Optional[str]) – Taxon must have this rank or lower; overrides rank

  • 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 names

  • preferred_place_id (Optional[int]) – Place preference for regional taxon common names

  • all_names (Optional[bool]) – Include all taxon names in the response

  • id_above (Optional[int]) – Must have an ID above this value

  • id_below (Optional[int]) – Must have an ID below this value

  • only_id (Optional[int]) – Return only the record IDs

  • parent_id (Optional[int]) – Taxon’s parent must have this ID unless otherwise noted

  • order_by (Optional[str]) – Field to sort on

  • reverse (Optional[bool]) – Reverse the order of results; alias for order='descending'

Return type

Paginator[Taxon]