PlaceController#

class pyinaturalist.controllers.PlaceController(client)#

Bases: 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 – Field to sort on

  • reverse – 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:
  • nelat (Optional[float]) – NE latitude of bounding box

  • nelng (Optional[float]) – NE longitude of bounding box

  • swlat (Optional[float]) – SW latitude of bounding box

  • swlng (Optional[float]) – SW longitude of bounding box

  • name – Name must match this value

Return type:

Paginator[Place]