Errors & Troubleshooting

HTTP Status Codes

  • 200 — Success
  • 400 — Bad request (invalid params)
  • 401 — Unauthorized (API key issue)
  • 402 — Payment required
  • 403 — Forbidden (endpoint not in your plan, or your credit, overage or free-trial cap has been reached; the message says which)
  • 404 — Not found
  • 429 — Rate limit exceeded
  • 500 — Server error

Error responses follow this format:

json
{ "message": "description" }

Common Errors

"Could not verify API Key" (401)
Check key, use API-Key header (not Authorization)
"this API-key is not allowed to access this endpoint" (403)
Contact [email protected] for plan upgrade
"cannot use timeLast and timeGte/timeLte together"
Use one or the other, not both
"limit must be between 1 and 1000"
Reduce limit (counterparties max: 1000)

Rate Limit Handling (429)

When a retry can succeed at all, a 429 from a rate limit carries a Retry-After header with the seconds to wait before retrying. Wait that long, and back off exponentially with jitter when the header is absent:

python
import random
import time
import requests

def request_with_backoff(url, headers, max_retries=5):
    for attempt in range(max_retries):
        resp = requests.get(url, headers=headers)
        if resp.status_code == 429:
            retry_after = resp.headers.get("Retry-After")
            delay = int(retry_after) if retry_after else min(2 ** attempt, 30)
            time.sleep(delay + random.uniform(0, 1))
            continue
        return resp
    return resp

WebSocket Errors

Errors on the v2 stream (/ws/v2/transfers) arrive in-band as an error frame. The connection stays open; only the offending frame is rejected.

json
{
    "channel": "transfers",
    "type": "error",
    "subscription_id": "binance-eth",
    "code": "count_reset_required",
    "message": "count history is unavailable; refresh count baselines from REST and reconnect"
}
  • subscription_id — the subscription the rejected frame addressed; omitted when the frame named none
  • code — one of the codes below
  • message — human-readable detail
  • retry_after_ms — present when the server asks you to wait before retrying

Error Codes

  • protocol_error — Malformed frame, unknown subscription, or an operation that subscription does not support
  • resource_limit — A connection limit was exceeded, for example too many subscriptions in the initial frame or too many resolved filter terms; the connection is left unconfigured
  • output_limit — Output budget exceeded; retry after retry_after_ms
  • load_busy — A count load for that subscription is already in progress
  • count_replaying — Count replay is not ready yet; retry
  • load_invalidated — The count load was invalidated by a reorg; request it again
  • count_reset_required — Count history is unavailable; refresh count baselines from REST and reconnect
  • internal_error — Transient server failure; retry the request

Credits and WebSockets

Credits are checked when the connection is opened, the same way as a REST call. A key that is out of credits is refused at connection time with a 402 or 403 and a message body; no error frame is sent over the socket. Rows delivered on an open connection are billed per row, see Credit Pricing.