Errors
Every error has the same shape, and its HTTP status matches its type:
errorobject requiredtypestring requiredone of
invalid_request,authentication_error,permission_error,not_found,conflict,rate_limit,api_errorcodestring requiredone of
invalid_parameter,missing_parameter,unsupported_date_range,invalid_api_key,key_revoked,scope_not_allowed,plan_restricted,domain_not_allowed,not_found,idempotency_conflict,place_ambiguous,place_not_found,rate_limited,quota_exhausted,internal_error,engine_unavailable,timeout,time_requiredmessagestring requiredparamstringissuesarray of objectFields
paramstring requiredmessagestring required
candidatesarray of objectFields
place_idstring requirednamestring requiredstatestringcountrystring
request_idstring requireddoc_urlstring (uri) required
issueslists every problem in the request at once.candidatescomes withplace_ambiguous.request_id: quote it when you write to us.doc_urllinks to the row for its code below.
Errors are never charged.
Error codes
| Code | HTTP | Type | Meaning |
|---|---|---|---|
invalid_parameter | 400 | invalid_request | One or more inputs are invalid; every problem is listed in error.issues. |
missing_parameter | 400 | invalid_request | A required input is missing (the API currently reports these as invalid_parameter with issues). (reserved: not returned today) |
unsupported_date_range | 400 | invalid_request | Dates must be between 1900-01-01 and 2100-12-31. |
invalid_api_key | 401 | authentication_error | Missing, invalid, revoked or expired API key. |
key_revoked | 401 | authentication_error | Revoked keys get invalid_api_key instead, so a prober learns nothing. (reserved: not returned today) |
scope_not_allowed | 403 | permission_error | This key cannot call this operation; publishable keys may call only read-only operations without birth data. |
plan_restricted | 403 | permission_error | Every plan includes every operation, so this is not returned. (reserved: not returned today) |
domain_not_allowed | 403 | permission_error | The request's Origin is not one of this publishable key's allowed origins. |
not_found | 404 | not_found | No such operation or resource. |
idempotency_conflict | 409 | conflict | Idempotency keys are not supported yet. (reserved: not returned today) |
place_ambiguous | 422 | invalid_request | More than one place matches; choose one of error.candidates or send coordinates. |
place_not_found | 422 | invalid_request | No place matches; send coordinates or a place_id. |
time_required | 422 | invalid_request | This operation needs a birth time (time_accuracy exact or approximate). |
rate_limited | 429 | rate_limit | Too many requests per second, or too many at once, for your plan; retry after Retry-After seconds. |
quota_exhausted | 429 | rate_limit | This period's credits, or the project's daily test calls, are used up. |
internal_error | 500 | api_error | Something failed on our side; quote the request_id. |
engine_unavailable | 500 | api_error | The calculation engine is not reachable; not returned today because the engine runs in-process. (reserved: not returned today) |
timeout | 500 | api_error | A calculation took too long; not returned today. (reserved: not returned today) |