Our API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted), and codes in the 5xx range indicate an error with our servers.

HTTP Status Codes

Here’s a summary of the primary HTTP response codes you’ll encounter:
  • 200 OK: Everything worked as expected.
  • 400 Bad Request: Request is not acceptable, often due to missing a required parameter.
  • 401 Unauthorized: No valid API key was provided.
  • 429 Too Many Requests: You’re hitting the rate limit.
  • 500 Internal Server Error: We had a problem with our server. Try again later.

Error Response Body

When an error occurs, the response body will contain a JSON object with details about the error. This helps you understand what went wrong and how to fix it. Following is an example of it:
{
    "error": {
        "message": "Invalid API key provided.",
        "type": "invalid_request_error",
        "code": "invalid_api_key"
    }
}