Skip to main content

Errors

Envelope

All errors share one JSON shape:

{
"error": {
"code": "tier_required",
"message": "This route requires the pro tier",
"details": { "required_tier": "pro" },
"request_id": "f0e1d2c3-b4a5-…"
}
}
  • code — a stable, machine-readable string. Branch on this, not on the human-readable message.
  • message — a human-readable explanation; wording may change.
  • details — optional, present on some errors (e.g. allowed for an unknown param, required_tier for a tier gate).
  • request_id — unique per request, also returned in the X-Request-ID response header. Include it when contacting support. You may set your own by sending an X-Request-ID request header.

HTTP status reflects the category (4xx client, 5xx server).

Error codes

StatuscodeMeaning
400unknown_query_paramA query param isn't recognised; details.allowed lists valid ones.
400invalid_sortThe sort field isn't sortable on this endpoint.
400invalid_cursorThe pagination cursor is malformed or stale.
400invalid_grade_typeA grade_type value (sales) isn't valid.
400filter_not_availableA filter requires a higher tier (e.g. has_price on free).
400query_too_longThe search q exceeds the length limit.
401missing_api_keyNo X-API-Key header.
401invalid_api_keyKey not recognised.
403tier_requiredYour tier is below the route/field/sort requirement.
403out_of_scope(Beta access only) the resource is outside your catalog slice.
404card_not_foundNo card with that id.
404set_not_foundNo set with that id.
404pokemon_not_foundNo Pokémon with that id.
404price_not_foundThe card has no price record.
422validation_errorRequest failed schema validation; details carries the field errors.
429rate_limitedBurst or monthly quota exceeded; see Retry-After.
500internal_errorUnexpected server error — retry, and report the request_id if it persists.

Handling pattern

resp = requests.get(url, headers=headers, params=params)
if not resp.ok:
err = resp.json()["error"]
if err["code"] == "rate_limited":
retry_after = int(resp.headers.get("Retry-After", "5"))
# back off and retry…
elif err["code"] == "tier_required":
# surface an upgrade prompt…
else:
raise RuntimeError(f"{err['code']}: {err['message']} ({err['request_id']})")