Errors
Errors are application/problem+json (RFC 9457). Branch on code: it is stable. The title and detail are for people and may change.
{
"type": "https://locapi.eu/problems/country-not-supported",
"title": "Country not supported",
"status": 422,
"code": "country_not_supported",
"detail": "Country SE is not active.",
"requestId": "req_0192b0c4-…"
}The request id is also in the X-Request-Id header. Each type URI leads to its entry below.
All codes#
- 400
invalid_requestInvalid request - A parameter is missing or invalid; errors names each one. Fix the request: retrying the same request will not help.
- 401
invalid_api_keyInvalid API key - The key is missing, unknown or revoked. Check the X-Api-Key header, or create a new key in the dashboard.
- 402
payment_requiredPayment required - The country is paid only and paid usage is not on for your account. Contact us to turn it on.
- 403
account_blockedAccount blocked - Your account is blocked. Contact LocAPI; the key itself is fine.
- 404
not_foundAddress not found - Returned by resolve when the address no longer exists in the source. Search again.
- 410
reference_expiredReference expired - The id is older than 24 hours, or the country now uses another source. Search again for a new id.
- 422
country_not_supportedCountry not supported - The country is valid but not supported, or has no lookup. See Countries.
- 429
fair_use_exceededFair use exceeded - The fair-use allowance for unpaid calls is used. Resolving new ids still works and extends it; it resets at resetAt.
- 429
quota_exceededFree allowance used - The free allowance of a free-coverage country is used and paid usage is off. It resets at resetAt.
- 429
rate_limit_exceededRate limit exceeded - Too many requests for this key. Wait Retry-After seconds, then retry.
- 429
spend_cap_reachedMonthly spend cap reached - This address would take you over your monthly spend cap. It resets at resetAt; ask us to raise the cap.
- 500
internal_errorInternal error - Something went wrong on our side. Retry later, and quote the requestId if it persists.
The problem object#
Response
typestring- A stable URI for the error; it leads to its entry on the Errors page.
titlestring- A short, human description of the error type.
statusinteger- The HTTP status code.
codestring- Stable machine code. Branch on this, never on title or detail.
outcomestring | null- Set on invalid_request, not_found and source_unavailable: the outcome in the sense of the contract. Absent on other errors.
detailstring- What went wrong in this case. Human text; may change.
requestIdstring- The id of this request, also in the X-Request-Id header.
errorsmap of string | null- On 400: the invalid parameters, each with a reason.
resetAtstring | null- On limits that reset monthly: when they reset (UTC).