Errors
The OpenAQ API uses standard HTTP status codes to indicate the outcome of API requests, whether successful or erroneous. A successful request is accompanied by a 200 “OK” status code that confirms the operation was completed as expected. In cases of errors, the API responds with specific status codes that signify different types of issues. These codes enable developers to quickly understand and address any problems that arise when using the API.
HTTP Code | Status text | Description |
---|---|---|
200 | OK | Successful request. |
401 | Unauthorized | Valid API key is missing. |
403 | Forbidden | The requested resource may exist but the user is not granted access. This may be a sign that the user account has been blocked for non-compliance of the terms of use. |
404 | Not Found | The requested resource does not exist. |
405 | Method Not Allowed | The HTTP method is not supported. The OpenAQ API currently only supports GET requests. |
408 | Request Timeout | The request timed out, the query may be too complex causing it to run too long. |
422 | Unprocessable Content | The query provided is incorrect and does not follow the standards set by the API specification. |
429 | Too Many Requests | The number of requests exceeded the rate limit for the given time period. |
500, 502, 503, 504 | Server errors | Something has failed on the side of OpenAQ services. Contact us on Slack . |