Skip to main content
Every error from the API has the same shape, whatever went wrong:
Use code in your program: it is stable. message is in plain words, for people, and may change.
A call that fails isn’t counted against your monthly quota. Only answers count.

Every code

See Quotas and limits for the limits behind 429 and 503.

Ambiguous places

When q is a place name that matches more than one place, the error lists the places we know by that name. Each choice has its name, its council and a point as [longitude, latitude]. The places in this example are illustrative.
If one place has the name with a qualifier, such as a single Newport (…), it is used without asking. If no place has the name exactly but some start with it, you get the same code with a message like “No place is called Testfrod. Did you mean one of these?”. To ask again, send the chosen name as q, or its point as lat and lng (the point’s second number is lat):
If you know the postcode, use it. A postcode never comes back ambiguous.

Example bodies

Handling errors

1

Check the status

2xx is an answer. Anything else has an error body.
2

Branch on the code

Fix and resend bad_request, not_found and ambiguous. Wait and retry rate_limited. Stop on invalid_key, key_revoked and quota_exceeded, and tell someone.
3

Show the message if you must

message is written for people, so it is safe to log or show.