Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.binibit.com/llms.txt

Use this file to discover all available pages before exploring further.

HTTP status codes

StatusMeaning
200 OKRequest succeeded.
400 Bad RequestMissing or invalid query parameter.
404 Not FoundUnknown ticker_id, asset, or path.
429 Too Many RequestsRate limit exceeded.
500 Internal Server ErrorTransient server-side error — retry.
503 Service UnavailableMaintenance window or overload — retry later.

Error envelope

Non-2xx responses include a JSON body:
{
  "code": "INVALID_PARAM",
  "message": "ticker_id is required",
  "field": "ticker_id"
}
FieldTypeDescription
codestringMachine-readable error code (see table below).
messagestringHuman-readable description.
fieldstring | nullThe query parameter or field that triggered the error, when applicable.

Error codes

CodeHTTPMeaning
INVALID_PARAM400A query parameter is missing, malformed, or out of range.
NOT_FOUND404The requested ticker_id, asset, or path does not exist.
RATE_LIMIT429Per-IP rate limit exceeded. See Retry-After header.
INTERNAL500Unexpected server error. Safe to retry with backoff.
UNAVAILABLE503Service is temporarily down for maintenance. See Retry-After if present.

Retry strategy

HTTPRetry?Strategy
4xx (except 429)NoFix the request.
429YesHonor Retry-After.
500YesExponential backoff with jitter, max 5 attempts.
503YesHonor Retry-After, longer backoff.
import time, random, requests

def fetch_with_retry(url, max_attempts=5):
    for attempt in range(max_attempts):
        r = requests.get(url, timeout=10)
        if r.status_code == 200:
            return r.json()
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "1")))
            continue
        if 500 <= r.status_code < 600:
            time.sleep((2 ** attempt) + random.random())
            continue
        r.raise_for_status()
    raise RuntimeError(f"Exhausted retries for {url}")