Skip to main content

Common HTTP Status Codes

StatusMeaningRecommended Action
200Request succeededProcess the payload
401Missing or invalid API codeCheck the API code and request headers
403API profile expired or invalidContact support or renew the profile
429Request limit reachedWait and retry after the cooldown window
503Temporary service issueRetry with backoff

Example REST Error

{
  "detail": "Invalid API code."
}

Stream Error Event

If the real-time stream needs to close, it can emit an error event. Example:
{
  "message": "API code expired on 2026-04-30.",
  "closed_at": "2026-04-30T00:00:05Z"
}

Safe Retry Pattern

  • Retry 503 errors with exponential backoff
  • Do not hammer the API after a 429
  • After reconnecting a stream, call History again to recover possible gaps

Suggested Python Wrapper

import requests


def request_json(method, url, headers=None, **kwargs):
    response = requests.request(method, url, headers=headers, timeout=15, **kwargs)

    if response.status_code != 200:
        raise RuntimeError(
            f"HTTP {response.status_code} from {url}: {response.text}"
        )

    return response.json()

Operational Advice

  • Log both the HTTP status and the raw body when debugging
  • Keep your API code outside source control
  • Use history plus stream together instead of relying on the stream alone