Errors
Errors come back as JSON with a stable error code you can act on.
Error format
Errors return JSON in the form {"error": "code", "message": "explanation"} with these HTTP statuses:
| Status | Error code | Meaning | Retry? |
|---|---|---|---|
400 | bad_ip | Not a valid IPv4 or IPv6 address. | No, fix the request |
400 | bad_country | country is not a list of two-letter codes. | No, fix the request |
401 | invalid_key | The API key is missing, wrong or revoked. | No, check the key |
401 | key_expired | The key has passed its expiry date. | No, use another key |
402 | subscription_required | The account has no plan with API access. Ended trials and subscriptions move to the Free plan, so this is rare. | No, check your plan on the Billing page |
403 | ip_not_allowed | The request IP is not in the allowed server IPs of the key. | No, update the key settings |
403 | origin_not_allowed | The website domain is not allowed for the key, or the key is not enabled for browsers. | No, update the key settings |
403 | browser_only_key | The key is restricted to browser use on its allowed domains. | No, use a server key |
404 | not_found | The path does not exist. | No, check the URL |
429 | rate_limited | Per-second or daily limit reached. | Yes, after a short wait |
500 | server_error | A problem on our side. | Yes, after a short wait |
When to retry
When the IP geolocation API returns an error, retry only 429 and 500 responses, once, after a short pause. Every other error stays the same until you change the request, the key or the plan, so log it and let the visitor continue rather than blocking them.
Need a hand? Search the Help Center or open a support ticket. We usually reply within one business day.