SearchController¶
- class pyinaturalist.controllers.SearchController(client)¶
Bases:
BaseController
Unified text search
Methods
- __call__(q, sources=None, place_id=None, locale=None, preferred_place_id=None, **params)¶
A unified text search endpoint for places, projects, taxa, and/or users
Notes
API reference: GET /search
Example
>>> response = client.search(q='odonat') >>> pprint(response) ID Type Score Name ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47792 Taxon 9.45 Order Odonata (Dragonflies And Damselflies) 113562 Place 7.70 Odonates of Peninsular India and Sri Lanka 9978 Project 7.27 Ohio Dragonfly Survey (Ohio Odonata Survey) 5665218 User 6.10 odonatachr
- Parameters:
q (
str
) – Search querysources (
Union
[str
,Iterable
[str
],None
]) – Object types to searchplace_id (
Union
[int
,Iterable
[int
],None
]) – Results must be associated with this placelocale (
Optional
[str
]) – Locale preference for taxon common namespreferred_place_id (
Optional
[int
]) – Place preference for regional taxon common names
- Return type:
- Returns:
Response dict containing search results
- __init__(client)¶