PlaceController#

class pyinaturalist.controllers.PlaceController(client)#

Bases: pyinaturalist.controllers.base_controller.BaseController

Controller for Place requests

Methods

__call__(place_id, **kwargs)#

Get a single place by ID

Return type

Optional[Place]

__init__(client)#
autocomplete(q=None, **params)#

Given a query string, get places with names starting with the search term

Notes

  • API reference: GET /places/autocomplete

  • This endpoint accepts a per_page param, up to a max of 20 (default 10)

  • Pages beyond the first page cannot be retrieved. Use page=all to attempt to retrieve additional results. See paginate_autocomplete() for more info.

Parameters
  • q (Optional[str]) – Search query 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[Place]

from_ids(*place_ids, **params)#

Get places by ID

Parameters

place_ids (Union[int, str]) – One or more place IDs

Return type

Paginator[Place]

nearby(nelat, nelng, swlat, swlng, **params)#

Search for places near a given location

Notes

Parameters
Return type

Paginator[Place]