Menu

Places

Places errors

A request either answers with places or fails as a whole. A location that cannot be read is an error, never a guess.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

Places uses the one error shape every endpoint uses. No error is charged.

Location errors

Both are 400 INVALID_PARAM, told apart by error.details.reason.

details.reasonWhenTry next
location_requiredThe request names a kind of place and says nowhere to lookSend near, lat with lng, bbox, or one of the other ways to say where
location_not_foundThe place named, or the IP address, is not one we can place. details.param says which field: see belowDepends on the field
details.paramWhat was not foundTry next
nearThe place named in nearAdd the state, province or country; try the city alone; or send lat and lng
neighbourhoodThe neighbourhood, with its city if one was sentSend city with it; try the city alone; or send lat and lng
cityThe city (with its region) used as the locationCheck the spelling and the region code; or send near with the country
ipThe IP address could not be placed in a cityAsk the user where they are; send near, or lat and lng
near_meThe address the call came from could not be placed, or is on a private networkThe same
JSON
{
  "error": {
    "code": "INVALID_PARAM",
    "message": "We could not find the place named in near. Try a city, a neighbourhood with its city, a postcode or a street address, or send lat and lng.",
    "retry_after_seconds": null,
    "details": { "param": "near", "reason": "location_not_found" }
  },
  "request_id": "req_01JD0PLACES9X3K5N7B"
}

A place is never guessed. A name that is qualified ("Springfield, OR") and cannot be found there is location_not_found, not a Springfield somewhere else. The address a request comes from is used only when near_me says so, and an address that cannot be placed is an error, not a default city.

A search that reads its location and finds no places is not an error: it answers 200 with an empty results.

Request errors

Status and codeWhen
400 INVALID_PARAMA field the API does not take; none of query, category and brand; more than one of near, lat with lng, bbox, ip, near_me and neighbourhood; lat without lng; radius_m with bbox or with no location; a category we do not have; an ip that is not one public address; a fields entry that is not a place field; a value out of range or of the wrong type; and the two location errors above
401 AUTH_MISSING_KEY, 401 AUTH_INVALID_KEYNo Authorization header, or a key that is malformed, revoked or expired
403 QUOTA_EXCEEDEDThe key's monthly cap does not cover the call
429 INSUFFICIENT_CREDITSThe balance does not cover the limit asked for
429 RATE_LIMITEDThe plan's requests a minute, or its searches in flight
429 CAPACITYWe have no room for this call right now. Retry after retry_after_seconds
502 SEARCH_UNAVAILABLEPlaces could not be served right now. Retry after retry_after_seconds

Errors says which of these are worth retrying.

Warnings

A 200 can carry warnings: hours_coverage whenever open_now is sent, because most places have no hours on record and open places can be missing from the list. See Opening hours and open_now.

sort_not_applied says "sort": "distance" had no point to measure from, because the location is an area such as a city. The places are in order of relevance. Send lat with lng, or name a neighbourhood or an address.

This page as Markdown ยท llms.txt