Cities

Resolve or create a city from a Google Place ID

Resolve a Google Places place_id to a saved city. Reuses an existing match or sends the place ID to Google Places and persists a shared city and location record when missing. Returns the saved city ID and fields; request include=location for coordinates. A newly created city can subsequently be read with getCity. An AI assistant cannot call this; the app and an API key still can. An assistant resolves a place with getPrediction.

get/cities/place

Request

  • Base URL: https://api.purplegrain.com/api/v1
  • URL: https://api.purplegrain.com/api/v1/cities/place
  • Auth: none declared

Query parameters

place_idstring required

Google Places place_id to resolve to a city.

includestring
Example:location

Comma-separated snake_case relationship paths to embed (JSON:API included array, or inlined for application/json). Never embedded by default; unknown paths ignored; max 10 paths. Allowed paths: location.

Response

Successful. When the include query parameter is used, the response may contain an included array (JSON:API) or inlined related resources (application/json).

Example response

{
  "data": {
    "type": "city"
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.