Search Places
Search for a Place.
The Places API gives you a read-only interface to PredictHQ's places data. A place represents a Geonames Feature, which can be either an Area, an Administrative Feature, or a Populated Place.
Places can be used to search and filter events using named geographic features rather than a radius, latitude and longitude (see events' place.scope
and place.exact
parameters). This is helpful when searching for all events that apply to a continent, country, state, region, province, county or city.
Request
HTTP Request
Query Parameters
Use the below parameters to search and filter all places. Places are sorted by relevance (location or text query proximity).
A search requires at least one of the q
, id
, country
or location
parameters.
Parameter | Description |
---|---|
| A comma-separated list of ISO 3166-1 alpha-2 country codes.
E.g. |
| A comma-separated list of place identifiers.
E.g. |
| The maximum number of results to return. The default limit is |
| A coordinate in the form |
| A full-text search query.
E.g. |
| A comma-separated list of place types. Possible values:
Supports extra types:
E.g. |
Response
Response Fields
Field | Description |
---|---|
| The name of the place's administrative level 0 place, or |
| The ISO 3166-1 alpha-2 country code, or |
| The ISO 3166-1 alpha-3 country code, or |
| The name of the place's administrative level 2 place, or |
| The unique identifier of the place.
E.g. |
| A 2-tuple representing the centroid of the place. Note that the longitude/latitude coordinates use the GeoJSON order [lon, lat].
E.g. |
| The name of the place.
E.g. |
| The name of the place's administrative level 1 place, or |
| The administrative level of the place. Possible values:
E.g. |
Examples
Guides
Below are some guides relevant to this API:
Last updated