Skip to content

Error Handling

The API uses standard HTTP status codes to indicate success or failure.


Common Status Codes

StatusDescription
400Invalid request parameters
401Missing or invalid API key
403Access not allowed for current plan
404Resource not found
429Rate limit exceeded, or Discovery fair-use cap reached
500Internal server error
503Temporary service unavailability

Error Response Structure

Errors are returned as JSON.

Examples of possible error responses:

Validation Error (400)

{
  "field": "platform",
  "message": "Invalid platform value"
}

Authentication Error (401)

{
  "detail": "Authentication credentials were not provided."
}

Rate Limit Exceeded (429)

{
  "error": "Too many requests. Please try again later.",
  "retry_after": 42
}

The response also includes a Retry-After header with the same value (seconds to wait).

Discovery Fair-Use Cap (429)

A 429 can mean two different things. Both use an error field, so tell them apart by whether the response includes retry_after:

CauseHow to recognize itClears when
Per-minute rate limitHas a retry_after field and a Retry-After headerAfter the wait window — safe to retry with backoff
Fair-use cap reachedNo retry_after; message mentions the credit limitOn subscription renewal — retrying does not help
{
  "error": "Discovery API credit limit reached. Credits reset on subscription renewal."
}

See Usage & limits for how the cap works.


Client Recommendations

  • Always inspect the HTTP status code first.
  • Do not retry 4xx errors unless the request is modified.
  • Retry transient errors (rate-limit 429, 5xx) using exponential backoff.
  • Do not retry the Discovery fair-use cap 429 — it clears only on subscription renewal.