{"openapi":"3.1.0","info":{"title":"Card Hedge Agent API","description":"Pay-per-call trading-card data for autonomous agents (x402).","version":"v1"},"paths":{"/v1/agent/cards/top-movers":{"get":{"tags":["agent"],"summary":"Get Top Movers (Weekly Price Gainers)","description":"Get the cards with the largest price gains over the past week.\n\nGains of 500% or more are filtered out as likely data errors, so results\nreflect realistic market movement. Results are cached for 1 hour.\n\n**Example curl:**\n```bash\n# All categories\ncurl -H \"X-API-Key: your-api-key-here\" \\\n     \"https://api.cardhedger.com/v1/cards/top-movers?count=20\"\n\n# Baseball only\ncurl -H \"X-API-Key: your-api-key-here\" \\\n     \"https://api.cardhedger.com/v1/cards/top-movers?count=20&category=Baseball\"\n```\n\nReturns cards with realistic price increases (< 500% gain), limited to requested count.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/top-movers` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_top_movers","parameters":[{"name":"count","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Count"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopMoversResponse"},"examples":{"default":{"summary":"Top movers response","value":{"cards":[{"description":"Shohei Ohtani 2018 Topps Chrome Baseball","player":"Shohei Ohtani","set":"2018 Topps Chrome Baseball","number":"150","variant":"Refractor","card_id":"1587446850514x224832321163624450","image":"//s3.amazonaws.com/appforest_uf/example.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Topps Chrome Baseball","30 Day Sales":45,"rookie":true,"gain":650.5,"prices":[{"grade":"PSA 10","price":"2500"},{"grade":"PSA 9","price":"850"}]}],"total_count":50,"filtered_count":1,"gain_threshold":500.0}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/card-search":{"post":{"tags":["agent"],"summary":"Search Cards","description":"Search for cards with flexible filtering options.\n\nSearches CardHedge database with optional filters for search query, set, category,\nplayer, card number, subset, and rookie status. Supports pagination to iterate\nthrough large result sets.\n\n**Response includes:**\n- `pages`: Total number of pages available\n- `count`: Total number of matching cards\n- `cards`: Array of card objects for the current page\n\n**With `search`:** cards are ranked by relevance to the query, with a\ntypo-tolerant retry when nothing matches every word. Filters are exact\nmatches that ignore case and accents. Only the first 100,000 results can be\npaged: `count` stays the true total, `pages` stops at that window, and a\npage past it is empty. Queries longer than 512 characters are cut at the\nlast whole word.\n\n**Without `search`:** the filtered cards are ordered by 30-day sales.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"search\": \"Shohei Ohtani\",\n       \"category\": \"Baseball\",\n       \"page\": 1,\n       \"page_size\": 20\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/card-search\"\n```\n\nReturns matching cards with pricing, sales data, and pagination metadata.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/card-search` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_card_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardSearchResponse"},"examples":{"default":{"summary":"Card search response","value":{"pages":15,"count":742,"cards":[{"description":"Shohei Ohtani 2018 Topps Chrome Baseball","player":"Shohei Ohtani","set":"2018 Topps Chrome Baseball","number":"150","variant":"Base","card_id":"1587446850514x224832321163624450","image":"//s3.amazonaws.com/appforest_uf/example.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Topps Chrome Baseball","7 Day Sales":45,"30 Day Sales":187,"rookie":true,"gain":2.5,"prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"},{"grade":"Raw","price":"45.99"}],"gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785"}]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/card-details":{"post":{"tags":["agent"],"summary":"Get Card Details by ID","description":"Get detailed information for a specific card by its ID.\n\nRequires a card_id. If you only have a card name/description, call `card-match` or\n`card-search` first to get the card_id, then use it here.\n\nFetches card details from CardHedge database using the card's unique identifier.\nReturns the same data structure as card search endpoint.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"card_id\": \"1586812246197x228181943611293700\"}' \\\n     \"https://api.cardhedger.com/v1/cards/card-details\"\n```\n\nReturns card with pricing, sales data, and metadata.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/card-details` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_card_details","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardDetailsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardSearchResponse"},"examples":{"default":{"summary":"Card details response","value":{"cards":[{"description":"Mike Trout 2011 Topps Update Baseball","player":"Mike Trout","set":"2011 Topps Update Baseball","number":"US175","variant":"Base","card_id":"1586812246197x228181943611293700","image":"//s3.amazonaws.com/appforest_uf/f1586812239788x796554493579861000/2011-Mike-Trout-Topps-Update-US175-Graded.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Topps Update Baseball","7 Day Sales":27,"30 Day Sales":103,"rookie":true,"gain":0.5,"prices":[{"grade":"PSA 10","price":"1000"},{"grade":"PSA 9","price":"319.99"},{"grade":"Raw","price":"269.39"}],"gemrate_id":"71df2051b81120714021f7507c4017c9a53d4993"}]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/image-search":{"post":{"tags":["agent"],"summary":"Search Cards by Image","description":"Upload an image or provide an image URL to find visually similar cards. Returns a ranked list of candidates with CardHedge catalog data where available (including each card's `prices` section: grade/price pairs, one per grade) and AI fallback identification otherwise.\n\n**Need a single best answer with the correct variant?** Use [`POST /v1/cards/image-match`](#operation/match_card_by_image) — an AI-powered upgrade that identifies one specific card and resolves its parallel/variant (e.g. Base vs. Silver vs. Red) instead of returning a ranked list.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/image-search` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_image_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful search with results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageSearchResponse"},"example":{"success":true,"results":[{"similarity":"95.23","distance":0.0477,"ximilar_id":"xim_abc123","product_id":"1587446850514x224832321163624450","card_data":{"card_id":"1587446850514x224832321163624450","description":"Ken Griffey Jr. 1989 Upper Deck Baseball","player":"Ken Griffey Jr.","set":"1989 Upper Deck Baseball","number":"1","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","prices":[{"grade":"PSA 10","price":"2450.0"},{"grade":"PSA 9","price":"380.0"},{"grade":"Raw","price":"45.0"}]}}],"total_results":5,"query_id":"query_abc123","has_cardhedge_matches":true}}}},"400":{"description":"Bad request - missing image input, or an image that cannot be loaded (not an image, an unsupported format such as AVIF, or an unreachable URL)"},"413":{"description":"Image too large (max 10MB)"},"502":{"description":"External API error"},"503":{"description":"Image search service not configured"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/image-match":{"post":{"tags":["agent"],"summary":"Identify Card from Image","description":"**AI-powered upgrade to [`POST /v1/cards/image-search`](#operation/image_search_v1_cards_image_search_post).** Where image-search returns a ranked list of visually similar candidates, image-match uses AI to pick the single `best_match` card and resolve its color/finish variant (e.g. Base vs. Silver vs. Red).\n\nReturns `best_match` (null when the AI isn't confident) plus the `candidates` it considered, so callers can fall back to the ranked list when the match is uncertain. The best match and every candidate carry the card's `prices` section (grade/price pairs, one per grade), so a caller can show a price without a second request.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/image-match` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_image_match","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageMatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful match with the disambiguated best card and the candidates considered","headers":{"X-Image-Match-Model":{"description":"OpenRouter model ID that actually ran the variant disambiguation for this request. Defaults to the server-configured model.","schema":{"type":"string"}},"X-Image-Match-Backend":{"description":"How the variant was chosen for this request: `llm` (a vision chat model) or `decisions` (a decisions model scoring each candidate).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageMatchResponse"},"example":{"success":true,"best_match":{"card_id":"1747634186136x930806917880827100","description":"Franklin Arias 2025 Bowman Prospects Baseball","player":"Franklin Arias","set":"2025 Bowman Baseball","number":"BP-67","variant":"Base","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1756908055027x565354896889422200/crop_image","category":"Baseball","prices":[{"grade":"PSA 10","price":"42.5"},{"grade":"PSA 9","price":"18.0"},{"grade":"Raw","price":"6.25"}],"similarity":"81.58","confidence":1.0,"reasoning":"The query card is a standard base card with a white/silver border. Candidate 0 is an exact visual match and is labeled as 'Base'."},"candidates":[{"card_id":"1747634186136x930806917880827100","description":"Franklin Arias 2025 Bowman Prospects Baseball","player":"Franklin Arias","set":"2025 Bowman Baseball","number":"BP-67","variant":"Base","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1756908055027x565354896889422200/crop_image","category":"Baseball","prices":[{"grade":"PSA 10","price":"42.5"},{"grade":"PSA 9","price":"18.0"},{"grade":"Raw","price":"6.25"}],"similarity":"81.58"},{"card_id":"1747634463387x582637264762736900","description":"Franklin Arias 2025 Bowman Prospects Baseball Red","player":"Franklin Arias","set":"2025 Bowman Baseball","number":"BP-67","variant":"Red","image":"https://s3.amazonaws.com/appforest_uf/f1598844013957x762581963247106700/05-Baseball.jpg","category":"Baseball","prices":[{"grade":"PSA 10","price":"310.0"},{"grade":"Raw","price":"85.0"}],"similarity":"81.56"},{"card_id":"1747630916861x190508512087530500","description":"Franklin Arias 2025 Bowman Prospects Baseball Yellow Pattern","player":"Franklin Arias","set":"2025 Bowman Baseball","number":"BP-67","variant":"Yellow Pattern","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1777173617303x531498550810890050/resize","category":"Baseball","prices":[{"grade":"Raw","price":"12.0"}],"similarity":"80.73"}],"query_id":"","message":"Best variant-matched card identified."}}}},"400":{"description":"Bad request — missing image input, invalid base64 data, or an image that cannot be loaded (not an image, an unsupported format such as AVIF, or an unreachable URL)"},"413":{"description":"Image too large (max 10MB)"},"502":{"description":"External API error — Ximilar visual recall or vision-LLM disambiguation failed"},"503":{"description":"Image search or variant disambiguation service is not configured on the server"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/prices-by-cert":{"post":{"tags":["agent"],"summary":"Get Price History by Certificate Number","description":"Get card information and pricing by grader certificate number.\n\nThis endpoint performs a multi-step lookup:\n1. Checks the persistent validated-certificate cache; queries GemRate only\n   when that certificate has not been successfully retrieved before\n2. Fetches card details from CardHedge using GemRate IDs\n3. Fallback: if step 2 finds no card, matches the GemRate description\n   against the AI `card-match` endpoint\n4. Retrieves price history for the card at the specified grade, served\n   from the synced `card_prices` table with upstream fallback for cards\n   the sync does not cover\n\n**Related:** to look up many certificates at once, use `details-by-certs`\n(card details only) or `batch-prices-by-cert` (one price estimate per cert\ninstead of price history).\n\n`card_source` reports how the card was resolved -- `gemrate_id` for the\ndirect GemRate ID lookup, or `card_match` for the description fallback.\nWhen the fallback is used, `match_confidence` carries the AI match score\n(0-1); treat prices derived from a low-confidence match with care. Cards\nresolved via the `card_match` fallback have null `category_group` and\n`set_type` -- the matcher does not return those two fields.\n\n**Example curl:**\n```bash\n# Default: 180 days of price history\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"cert\": \"76676185\",\n       \"grader\": \"PSA\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/prices-by-cert\"\n\n# Custom: 30 days of price history\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"cert\": \"76676185\",\n       \"grader\": \"PSA\",\n       \"days\": 30\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/prices-by-cert\"\n```\n\nReturns certificate info, card details, and price history (default: 180 days, max: 365 days).\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/prices-by-cert` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_prices_by_cert","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertLookupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertLookupResponse"},"examples":{"default":{"summary":"Prices by certificate response","value":{"cert_info":{"grader":"psa","cert":"50000000","grade":"PSA 10","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","universal_gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","description":"1999 Bowman Chrome C.C. Sabathia 344"},"card":{"card_id":"1699670576265x928796749151534600","description":"C.C. Sabathia 1999 Bowman Chrome Baseball","player":"C.C. Sabathia","set":"1999 Bowman Chrome Baseball","number":"344","variant":"Base","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1699670857725x475053799924132860/resized_20231111_024737.jpeg","category":"Baseball","category_group":"Sports Cards","set_type":"Bowman Chrome Baseball","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885"},"prices":[{"closing_date":"2025-10-26T23:59:00.000Z","Grade":"PSA 10","card_id":"1699670576265x928796749151534600","price":"125.50"},{"closing_date":"2025-10-25T23:59:00.000Z","Grade":"PSA 10","card_id":"1699670576265x928796749151534600","price":"122.00"}]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/prices-by-card":{"post":{"tags":["agent"],"summary":"Get Price History for a Card","description":"Get price history for a specific card and grade.\n\nRequires a card_id. If you only have a card name/description, call `card-match` or\n`card-search` first to get the card_id, then use it here.\n\nReturns daily price points for the card at the requested grade. By default the\nwindow ends today, so `days` alone reaches back at most one year (366 days).\nResults are cached for improved performance.\n\n## Getting price history older than one year\n\nSet `end_date` to shift the `days` window into the past and page backwards,\none window at a time. Each response covers `(end_date - days, end_date]` —\nexclusive start, inclusive end — so consecutive pages are contiguous and\nnever overlap or skip a day.\n\n**Paging by calendar year:**\n\n| Page | Request body |\n|------|--------------|\n| This year to date | `{\"card_id\": \"...\", \"grade\": \"PSA 9\", \"days\": <days since Dec 31>}` |\n| 2025 | `{\"card_id\": \"...\", \"grade\": \"PSA 9\", \"days\": 365, \"end_date\": \"2025-12-31\"}` |\n| 2024 (leap year) | `{\"card_id\": \"...\", \"grade\": \"PSA 9\", \"days\": 366, \"end_date\": \"2024-12-31\"}` |\n| 2023 | `{\"card_id\": \"...\", \"grade\": \"PSA 9\", \"days\": 365, \"end_date\": \"2023-12-31\"}` |\n| ... | continue stepping `end_date` back a year at a time |\n\nStop paging when a response returns an empty `prices` list — you have reached\nthe start of the card's history (price coverage generally begins around\nspring 2020). Use `days: 366` for leap years so the page covers the full\ncalendar year; `end_date` may not be in the future.\n\nWindows that end in the past are immutable, so they are cached longer\n(24 hours) than live windows (1 hour) — historical pages are fast and cheap\nto re-request.\n\n**Example curl:**\n```bash\n# Default: 180 days of price history\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"grade\": \"PSA 9\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/prices-by-card\"\n\n# Custom: 30 days of price history\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"grade\": \"PSA 9\",\n       \"days\": 30\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/prices-by-card\"\n\n# Historical: calendar year 2024 (366 days, leap year)\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"grade\": \"PSA 9\",\n       \"days\": 366,\n       \"end_date\": \"2024-12-31\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/prices-by-card\"\n```\n\nReturns price history (default window: 180 days; max: 366 days per window).\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/prices-by-card` and pay **$0.020 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_prices_by_card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricesByCardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricesByCardResponse"},"examples":{"default":{"summary":"Price history response","value":{"prices":[{"closing_date":"2025-10-26T23:59:00.000Z","Grade":"PSA 9","card_id":"1587446850514x224832321163624450","price":"337.67"},{"closing_date":"2025-10-25T23:59:00.000Z","Grade":"PSA 9","card_id":"1587446850514x224832321163624450","price":"337.00"},{"closing_date":"2025-10-24T23:59:00.000Z","Grade":"PSA 9","card_id":"1587446850514x224832321163624450","price":"331.29"}]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/all-prices-by-card":{"post":{"tags":["agent"],"summary":"Get Latest Prices Across All Grades","description":"Get all latest prices for a card across all available grades.\n\nRequires a card_id. If you only have a card name/description, call `card-match` or\n`card-search` first to get the card_id, then use it here.\n\nThis endpoint returns the most recent price for each grade/grader combination\navailable for the specified card. Includes prices from all major grading companies\n(PSA, BGS, SGC, CGC, CSG, HGA) plus raw (ungraded) prices.\n\nThe response includes:\n- Grade and grader information\n- Latest price for each grade\n- Display order for sorting grades consistently\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1586414093385x612765462196125700\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/all-prices-by-card\"\n```\n\nReturns all available grades with their latest prices for the card.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/all-prices-by-card` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_all_prices_by_card","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllPricesByCardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllPricesByCardResponse"},"examples":{"default":{"summary":"All latest prices by card response","value":{"prices":[{"card_id":"1586414093385x612765462196125700","grade":"Raw","grader":"Raw","price":"1299.99","display_order":"-1"},{"card_id":"1586414093385x612765462196125700","grade":"PSA 10","grader":"PSA","price":"16999.99","display_order":"1"},{"card_id":"1586414093385x612765462196125700","grade":"PSA 9","grader":"PSA","price":"3700.00","display_order":"2"},{"card_id":"1586414093385x612765462196125700","grade":"BGS 9.5","grader":"BGS","price":"5200.00","display_order":"323"}]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/comps":{"post":{"tags":["agent"],"summary":"Get Comparable Sales (Comps)","description":"Get comparable sales (comps) for a card, with anomaly filtering and optional time-weighting.\n\nRequires a card_id. If you only have a card name/description, call `card-match` or\n`card-search` first to get the card_id, then use it here.\n\nThis endpoint:\n1. Fetches the most recent sales for the card at the requested grade\n2. Filters only statistical price anomalies using IQR fences (keeps non-anomalous highs/lows)\n3. Calculates comp price using either:\n   - Simple average (default)\n   - Weighted Moving Average (if time_weighted=True), giving recent sales more weight\n4. Returns `high`/`low` from the filtered sales used in the comp\n5. Returns `raw_high`/`raw_low` from the unfiltered sales fetched for the request\n6. Optionally returns raw price data (if include_raw_prices=True)\n\n**Time-Weighting Algorithm (WMA):**\nWhen time_weighted=True, recent sales are weighted more heavily:\n- Most recent sale: weight = n\n- Second most recent: weight = n-1\n- ...\n- Oldest sale: weight = 1\n- Formula: (P1*n + P2*(n-1) + ... + Pn*1) / (n + (n-1) + ... + 1)\n\n**Example curl:**\n```bash\n# Basic comp (simple average)\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"count\": 10,\n       \"grade\": \"PSA 9\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/comps\"\n\n# Time-weighted comp with raw prices\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"count\": 10,\n       \"grade\": \"PSA 10\",\n       \"time_weighted\": true,\n       \"include_raw_prices\": true\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/comps\"\n```\n\n**Paging (optional)**\n\nSend ``offset`` (and/or ``date_range``) to page through a card's sales the\nsame way ``comps-by-cert`` does. Without them the endpoint behaves exactly\nas described above.\n\n- ``count`` is the page size (1-100) and ``offset`` a zero-based position.\n- The comp, ``high``/``low`` and ``raw_high``/``raw_low`` are calculated\n  over the current page only; ``raw_prices`` is exactly the page.\n- The response adds ``total_count``, ``offset``, ``count_returned``,\n  ``has_more`` and ``date_range``. When ``has_more`` is true, request the\n  next page with ``offset + count_returned``.\n- ``offset + count`` cannot exceed 10000; narrow with ``date_range``.\n- Sales are newest-first across page boundaries. A page with no sales\n  returns 404, the same as a card/grade with no sales.\n\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"grade\": \"PSA 9\",\n       \"count\": 20,\n       \"offset\": 20,\n       \"include_raw_prices\": true\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/comps\"\n```\n\n**Venue filters (optional)**\n\n`include_venues` keeps only sales from the listed venues; `exclude_venues`\nleaves the listed venues out. Both are lists, both are optional, and they\ncan be combined. Venue names are the `price_source` values on returned\nsales, in any case: `ebay`, `tcgplayer`, `fanatics` (also matches `pwcc`),\n`goldin`, `alt`, `pristine`, `starstock`, `myslabs`, `heritage`, `lelands`.\nThe filter is applied before sales are counted and paged, so `count` is\nthe most recent sales from the venues you allowed, and when paging,\n`total_count`, `offset` and `has_more` cover only those sales. A venue\nwith no sales matches nothing (a 404 if no sales are left). Omit both, or\nsend empty lists, for all venues.\n\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"grade\": \"PSA 9\",\n       \"count\": 10,\n       \"exclude_venues\": [\"goldin\"]\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/comps\"\n```\n\n**All grades (optional)**\n\nSend `\"grade\": \"ALL\"` (any case) to get the card's most recent sales at\nevery grade in one call, instead of one call per grade. Paging,\n`date_range` and the venue filters work the same, over all grades. Each\nsale in `raw_prices` carries its own `grade` (send\n`include_raw_prices: true` to see them). `comp_price`, `high` and `low`\nare then calculated across mixed grades, so read them as a summary of the\nsales returned rather than the value of one grade.\n\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1587446850514x224832321163624450\",\n       \"grade\": \"ALL\",\n       \"count\": 20,\n       \"include_raw_prices\": true\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/comps\"\n```\n\nReturns calculated comp price with anomaly-aware filtering.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/comps` and pay **$0.020 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_comps","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompsResponse"},"examples":{"with_raw_prices":{"summary":"Comp with raw sale prices","value":{"comp_price":336.0,"high":348.0,"low":325.0,"raw_high":348.0,"raw_low":325.0,"count_requested":5,"count_used":5,"time_weighted":true,"raw_prices":[{"price":325.0,"sale_date":"2025-10-26T13:00:00.000Z","price_source":"marketplace","card_id":"1587446850514x224832321163624450","price_history_id":"1761480061129x501444455762531900","grade":"PSA 9","sale_type":"Best Offer","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"},{"price":348.0,"sale_date":"2025-10-26T03:36:00.000Z","price_source":"marketplace","card_id":"1587446850514x224832321163624450","price_history_id":"1761446206940x522975047258362750","grade":"PSA 9","sale_type":"Auction","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"}]}},"paged":{"summary":"Paged comp (offset sent)","description":"Response to {\"count\": 3, \"offset\": 3, \"include_raw_prices\": true}. The comp covers this page only; raw_prices is exactly the page. Request the next page with offset + count_returned while has_more is true. date_range is also returned: null here, since none was sent (the docs renderer hides null values).","value":{"comp_price":416.66,"high":441.0,"low":395.0,"raw_high":441.0,"raw_low":395.0,"count_requested":3,"count_used":3,"time_weighted":false,"raw_prices":[{"price":395.0,"sale_date":"2026-11-09T03:45:32.000Z","price_source":"eBay","card_id":"1587446850514x224832321163624450","price_history_id":"[sale record id]","grade":"PSA 9","sale_type":"Auction","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"},{"price":413.98,"sale_date":"2026-11-09T03:45:00.000Z","price_source":"eBay","card_id":"1587446850514x224832321163624450","price_history_id":"[sale record id]","grade":"PSA 9","sale_type":"Best Offer","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"},{"price":441.0,"sale_date":"2026-11-09T03:34:01.000Z","price_source":"eBay","card_id":"1587446850514x224832321163624450","price_history_id":"[sale record id]","grade":"PSA 9","sale_type":"Auction","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"}],"total_count":6712,"offset":3,"count_returned":3,"has_more":true}},"all_grades":{"summary":"All grades (grade ALL)","description":"Response to {\"grade\": \"ALL\", \"count\": 3, \"include_raw_prices\": true}. The three most recent sales of the card at any grade; each sale carries its own grade. comp_price, high and low are across mixed grades.","value":{"comp_price":185.0,"high":400.0,"low":40.0,"raw_high":400.0,"raw_low":40.0,"count_requested":3,"count_used":3,"time_weighted":false,"raw_prices":[{"price":40.0,"sale_date":"2026-11-21T15:47:59.000Z","price_source":"eBay","card_id":"1587446850514x224832321163624450","price_history_id":"[sale record id]","grade":"Raw","sale_type":"Auction","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"},{"price":400.0,"sale_date":"2026-11-21T14:10:00.000Z","price_source":"eBay","card_id":"1587446850514x224832321163624450","price_history_id":"[sale record id]","grade":"PSA 9","sale_type":"Best Offer","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"},{"price":115.0,"sale_date":"2026-11-21T12:02:31.000Z","price_source":"eBay","card_id":"1587446850514x224832321163624450","price_history_id":"[sale record id]","grade":"PSA 8","sale_type":"Auction","title":"[listing title]","sale_url":"[sale url]","image":"[image url]"}]}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/price-updates":{"post":{"tags":["agent"],"summary":"Get Price Updates (Delta Poll)","description":"Get price updates since a specified timestamp (delta polling).\n\n> **New integrations: use the watchlist feed instead.** This endpoint\n> returns the *global* tracked set — every subscribed card across all\n> clients — which you must filter client-side. `POST\n> /v1/cards/watchlist-updates` delivers only *your* watched cards'\n> changes, with cursors that never expire and no `client_id` setup.\n\nThis endpoint enables efficient **delta polling** - clients only request data that has\nchanged since their last request, rather than fetching the entire dataset each time.\n\nTo add cards to the tracked set, see `subscribe-price-updates`.\n\n## How Delta Polling Works\n\n1. **Initial Request**: Make your first request with a timestamp from when you want to start tracking\n2. **Store the Latest Timestamp**: Save the `update_timestamp` from the most recent item in the response\n3. **Subsequent Requests**: Use that saved timestamp as the `since` parameter for your next request\n4. **Repeat**: Continue polling at your desired interval (e.g., every 5 seconds)\n\n## Polling Flow Example\n\n```\nPoll 1: since=\"2024-01-01T00:00:00.000Z\"\nResponse: 50 updates, latest: \"2024-01-01T01:30:00.000Z\"\n→ Save timestamp\n                ↓ (wait 5 sec)\nPoll 2: since=\"2024-01-01T01:30:00.000Z\"\nResponse: 3 updates, latest: \"2024-01-01T01:30:05.000Z\"\n→ Save timestamp\n                ↓ (wait 5 sec)\nPoll 3: since=\"2024-01-01T01:30:05.000Z\"\nResponse: 0 updates (no new data)\n→ Keep existing timestamp\n```\n\n## Parameters\n- `since`: ISO 8601 timestamp to fetch updates after (e.g., '2023-07-16T01:28:57.000Z')\n- `ignore_grades`: Optional list of grades to exclude (e.g., ['Raw'] to exclude ungraded cards)\n\n## Best Practices\n\n| Practice | Recommendation |\n|----------|----------------|\n| Poll Interval | 5-10 seconds for real-time updates |\n| Checkpoint Storage | Persist `last_timestamp` to disk/database to resume after restarts |\n| Empty Responses | Normal - means no new updates; keep your existing timestamp |\n| Error Handling | On failure, retry with the same timestamp (don't advance it) |\n| Grade Filtering | Use `ignore_grades` to reduce payload if you don't need all grades |\n\n## Example curl\n\n```bash\n# Get all updates since timestamp\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"since\": \"2023-07-16T01:28:57.000Z\"}' \\\n     \"https://api.cardhedger.com/v1/cards/price-updates\"\n\n# Exclude Raw grades\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"since\": \"2023-07-16T01:28:57.000Z\", \"ignore_grades\": [\"Raw\"]}' \\\n     \"https://api.cardhedger.com/v1/cards/price-updates\"\n```\n\n## Python Example\n\n```python\nimport requests\nimport time\nfrom datetime import datetime, timezone\n\nAPI_KEY = \"your-api-key\"\nBASE_URL = \"https://api.cardhedger.com/v1/cards/price-updates\"\n\n# Start from current time\nlast_timestamp = datetime.now(timezone.utc).strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n\nwhile True:\n    response = requests.post(\n        BASE_URL,\n        headers={\"X-API-Key\": API_KEY, \"Content-Type\": \"application/json\"},\n        json={\"since\": last_timestamp, \"ignore_grades\": [\"Raw\"]}\n    )\n    data = response.json()\n\n    if data[\"count\"] > 0:\n        for update in data[\"updates\"]:\n            print(f\"{update['card_desc']} - {update['grade']}: ${update['price']}\")\n        # Update checkpoint to latest timestamp\n        last_timestamp = data[\"updates\"][-1][\"update_timestamp\"]\n\n    time.sleep(5)  # Poll every 5 seconds\n```\n\nReturns list of price updates with card details and timestamps.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/price-updates` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_price_updates","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceUpdatesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceUpdatesResponse"},"examples":{"default":{"summary":"Price updates response","value":{"updates":[{"price":"53.88","sale_date":"2023-07-15","grade":"PSA 9","card_desc":"James Wood 2022 Bowman Chrome Prospects Sapphire Baseball","card_set":"2022 Bowman Chrome Prospects Sapphire Baseball","card_number":"BCP-108","player":"James Wood","variant":"Base","card_id":"1669693578344x525012276222885900","update_timestamp":"2023-07-16T01:29:01.227Z"},{"price":"116.5","sale_date":"2023-07-15","grade":"PSA 10","card_desc":"James Wood 2022 Bowman Chrome Prospects Sapphire Baseball","card_set":"2022 Bowman Chrome Prospects Sapphire Baseball","card_number":"BCP-108","player":"James Wood","variant":"Base","card_id":"1669693578344x525012276222885900","update_timestamp":"2023-07-16T01:29:02.774Z"}],"count":2}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/additions-summary":{"post":{"tags":["agent"],"summary":"Get Daily Card Addition Counts","description":"Get daily counts of cards newly added to the catalog.\n\nReturns per-day addition counts grouped by category, set, and subset —\nuseful for tracking catalog growth and spotting new releases.\nData is refreshed daily.\n\n**Example curl:**\n```bash\n# Cards added since March 1st\ncurl -X POST \"https://api.cardhedger.com/v1/cards/additions-summary\" \\\n     -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"start_date\": \"2026-03-01\"}'\n\n# Baseball cards added in a date range\ncurl -X POST \"https://api.cardhedger.com/v1/cards/additions-summary\" \\\n     -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"start_date\": \"2026-03-01\", \"end_date\": \"2026-03-15\", \"category\": \"Baseball\"}'\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/additions-summary` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_additions_summary","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdditionsSummaryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdditionsSummaryResponse"},"examples":{"default":{"summary":"Additions summary response","value":{"data":[{"category":"Baseball","set_name":"2024 Topps Chrome Baseball","subset":"Base Set","variants":"Base, Gold, Refractor","added_date":"2026-03-15","card_count":42}],"page":1,"page_size":50}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/card-fmv":{"post":{"tags":["agent"],"summary":"Get Fair Market Value (FMV) for a Card","description":"Get the Fair Market Value (FMV) for a card at a specific grade.\n\nRequires a `card_id`. If you only have a card name/description, call\n`card-match` or `card-search` first to resolve it.\n\n## What FMV is\n\nFMV is CardHedge's smoothed valuation for a card at a specific grade,\ncomputed by an underlying pricing service that:\n\n1. Looks for a direct price for this card+grade, and if found, replaces\n   the raw `latest_price` with a **Winsorized-median FMV** computed over a\n   7/15/30/90-day window (the shortest window with enough daily prints\n   wins). Winsorizing trims outlier sales so a single hot/cold day\n   doesn't move the value.\n2. If no direct price exists, falls back through a cascade of related\n   data: other grades of the same card → other graders → grade\n   multipliers → segment baselines.\n3. If the chosen base price is stale, overlays a **movement index** to\n   project it to today. The index is picked from the most specific level\n   with enough sample density (card+grade → card → player → segment).\n4. Returns the price, a confidence score, and full metadata so callers\n   can decide how much to trust the result.\n\nCompared to `price-estimate`, the FMV response includes the smoothing\nwindow, sample counts, confidence grade, and a human-readable\n`price_explanation`.\n\n## FMV calculation methods (the **method** field)\n\nThe `method` field tells you which cascade step produced the price. There\nare **6 base methods** plus an `_indexed` variant of each non-terminal\nmethod (10 indexed + 1 terminal = 11 possible values).\n\n**Base methods**, in cascade priority:\n\n| Method                | Meaning                                                                                                                                                                              |\n| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `direct`              | Exact card+grade lookup. The 7/15/30/90-day Winsorized-median FMV is used when enough daily prints exist; otherwise raw `latest_price` is returned. See `fmv_window_days` / `fmv_sample_count`. |\n| `card_interpolation`  | No direct price; isotonic regression in log-space across the card's OTHER same-provider grades, interpolated/extrapolated to the target grade. Requires 2+ supporting grades.        |\n| `cross_provider`      | No same-provider data; translates from another grader (e.g., BGS 9 → PSA 9) using a learned price ratio.                                                                              |\n| `anchor_multiplier`   | One same-provider grade is the anchor; a within-provider grade multiplier projects it to the target. Variants: same-provider, chained (e.g., BGS 8.5 → BGS 9 → PSA 9), raw (Raw → graded). |\n| `segment_fallback`    | Last resort: uses the (set × year × category) segment baseline price and applies a grade multiplier. Lowest confidence — no card-specific data was used.                              |\n| `no_data`             | Terminal: nothing in the cascade produced a usable price. `price` and the range bounds are null.                                                                                      |\n\n**`_indexed` variants** — `direct_indexed`, `card_interpolation_indexed`,\n`cross_provider_indexed`, `anchor_multiplier_indexed`,\n`segment_fallback_indexed`. The base method produced a stale price (older\nthan the freshness threshold), so a **movement index** was overlaid to\nbring it to today. The index is chosen from a cascade of entities:\n\n- `index_level: \"card_grade\"` — most specific: this card at this grade\n- `index_level: \"card\"` — blended across all grades of this card\n- `index_level: \"player\"` — player-level (all this player's cards)\n- `index_level: \"segment\"` — (year × category) segment-level\n- `index_level: \"none\"` — stale, but no index met the minimum sample\n  threshold (an `un_indexed_penalty` was applied to confidence)\n- `index_level: null` — fresh estimate, no adjustment was needed\n\nExamine `raw_price` (pre-adjustment) vs `price` (post-adjustment) and\n`index_pct_change` to see exactly what the index changed. Filter low-signal\nadjustments by requiring `index_sample_count >= 10`.\n\n## Picking a method by use case\n\n- **Pricing UI for end users** — Trust `confidence_grade` A/B; show\n  `price_explanation` on a \"How was this calculated?\" tooltip. Hide or\n  caveat C/D and `no_data`.\n- **Portfolio valuation** — Use `price` directly; band it with\n  `price_low` / `price_high` for uncertainty visualization.\n- **Sensitive financial decisions** — On C-grade or any `_indexed`\n  method, also show `raw_price` so the user can see what the movement\n  index changed.\n- **Bulk analytics** — Aggregate by `method` to see what % of cards\n  have direct data vs are interpolated vs fall back to segments.\n\n## Response field reference\n\nSee the response schema (CardFMVResponse) for the full field-by-field\ndescription. Highlights:\n\n- `price` / `price_low` / `price_high` — FMV and uncertainty band in USD.\n- `confidence` (0-1) and bucketed `confidence_grade` (A/B/C/D) —\n  single trust score folding in method, FMV quality, and index quality.\n- `raw_price` — pre-adjustment price. Differs from `price` when a\n  movement index was applied (`_indexed`), or shows the FMV value for\n  `direct` when latest_price was replaced.\n- `fmv_window_days` / `fmv_sample_count` — FMV smoothing window\n  (7/15/30/90) and sample density.\n- `index_level` / `index_pct_change` / `index_sample_count` /\n  `index_truncated` / `as_of_date` — movement-index provenance.\n- `cross_grade_fmv_count` — for cross-grade methods, how many source\n  grades had their `latest_price` FMV-substituted before the cascade ran.\n- `price_explanation` — plain-English derivation (debug/audit only).\n\nAny additional fields the upstream returns are passed through unchanged.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"card_id\": \"1586812246197x228181943611293700\",\n       \"grade\": \"PSA 9\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/card-fmv\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/card-fmv` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_card_fmv","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardFMVRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardFMVResponse"},"examples":{"direct_high_confidence":{"summary":"Direct FMV with high confidence (grade A)","description":"FMV calculated directly from a fresh latest_price lookup","value":{"price":2000.0,"price_low":1908.05,"price_high":2091.95,"confidence":0.9772,"method":"direct","freshness_days":3,"support_grades":1,"grade_label":"BGS 9.5","provider":"BGS","grade_value":9.5,"index_truncated":false,"confidence_grade":"A","price_explanation":"Used latest_price $2000.00 (card_grade_prints direct lookup). Fresh (3d) — no movement adjustment applied."}},"windowed_fmv":{"summary":"Windowed FMV (winsorized median over multiple prints)","description":"FMV smoothed over a rolling window when recent sales are noisy","value":{"price":416.25,"price_low":397.26,"price_high":435.24,"confidence":0.3499,"method":"direct","freshness_days":1,"support_grades":1,"grade_label":"PSA 9","provider":"PSA","grade_value":9.0,"raw_price":416.25,"index_truncated":false,"fmv_window_days":7,"fmv_sample_count":3,"confidence_grade":"B","price_explanation":"Used 7d FMV ($416.25, Winsorized median of 3 daily prints) in place of latest_price $416.25. Fresh (1d) — no movement adjustment applied."}},"direct_indexed_stale":{"summary":"Direct lookup adjusted by card-level movement index","description":"Latest price was stale, so the upstream applied a card-level movement index. Note `index_level` is a string identifier ('card'), not a number.","value":{"price":9484.38,"price_low":8878.2,"price_high":10090.56,"confidence":0.1384,"method":"direct_indexed","freshness_days":0,"support_grades":1,"grade_label":"BGS 10","provider":"BGS","grade_value":10.0,"as_of_date":"2026-05-16","index_level":"card","index_pct_change":0.1566,"raw_price":8200.0,"index_truncated":false,"index_sample_count":1525,"confidence_grade":"C","price_explanation":"Used latest_price $9484.38 (card_grade_prints direct lookup). Stale (146d) → applied card-level movement index +15.7% (1525 samples)."}},"no_data":{"summary":"No data available","description":"Returned when the upstream cannot compute an FMV for this card/grade","value":{"confidence":0.0,"method":"no_data","support_grades":0,"grade_label":"PSA 10","provider":"PSA","grade_value":10.0,"index_truncated":false,"price_explanation":"Insufficient sale data to compute FMV."}}}}}},"400":{"description":"The grade cannot be parsed: unknown grader, or a value that is not a number from 0 to 10. Retrying will not help; `GET /v1/cards/grades` lists the supported grades.","content":{"application/json":{"example":{"detail":"Invalid grade 'BAS AUTO 10': Unknown provider in grade: BAS AUTO 10. A grade is a grader followed by a number, such as 'PSA 10', 'PSA 9', 'BGS 9.5' or 'SGC 8'; use '<grader> Auth' for authentic-only and 'Raw' for ungraded. Supported graders: PSA, BGS, SGC, CGC, CSG, HGA, TAG, AGS. GET /v1/cards/grades lists every supported grade."}}}},"502":{"description":"The FMV service failed or could not be reached."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/fmv-by-cert":{"post":{"tags":["agent"],"summary":"Get Fair Market Value (FMV) by Certificate Number","description":"Get the Fair Market Value (FMV) for a card by grader certificate number.\n\nConvenience wrapper that chains a certificate lookup into an FMV\nvaluation, so callers holding only a cert number do not need to resolve\nthe card themselves.\n\n## How it works\n\n1. Checks the persistent validated-certificate cache; queries GemRate only\n   when that certificate has not been successfully retrieved before.\n2. Resolves the card in CardHedge using the GemRate IDs.\n3. Fallback: if step 2 finds no card, matches the GemRate description\n   against the AI `card-match` endpoint.\n4. Requests the FMV for the resolved card at the certificate's grade.\n\n## Card resolution (`card_source` / `match_confidence`)\n\n- `card_source: \"gemrate_id\"` — direct GemRate ID → CardHedge lookup\n  succeeded. `match_confidence` is null.\n- `card_source: \"card_match\"` — direct lookup found nothing; the card\n  was matched from the GemRate description via the AI fallback.\n  `match_confidence` (0-1) is the matcher's score; **treat an FMV\n  derived from a low-confidence match with care**. Cards resolved this\n  way have null `category_group` and `set_type` because the matcher\n  doesn't return those two fields.\n\n## FMV (`fmv`)\n\nThe `fmv` object is identical to the `/v1/cards/card-fmv` response — see\nthat endpoint for the full method cascade (`direct`, `card_interpolation`,\n`cross_provider`, `anchor_multiplier`, `segment_fallback`, `no_data`),\n`_indexed` variants, confidence grading, and movement-index metadata.\n\n## When fields are null\n\n- `card` and `fmv` are both null only when the certificate cannot be\n  matched to a card by EITHER the GemRate ID lookup or the description\n  fallback.\n- When the card is found but the upstream has insufficient sale data,\n  `fmv` is a populated object with `method: \"no_data\"` and `price: null`\n  — `card` is still populated in this case.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"cert\": \"50000000\",\n       \"grader\": \"PSA\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/fmv-by-cert\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/fmv-by-cert` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_fmv_by_cert","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FMVByCertRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FMVByCertResponse"},"examples":{"default":{"summary":"FMV by certificate response","value":{"cert_info":{"grader":"psa","cert":"50000000","grade":"PSA 10","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","universal_gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","description":"1999 Bowman Chrome C.C. Sabathia 344"},"card":{"card_id":"1699670576265x928796749151534600","description":"C.C. Sabathia 1999 Bowman Chrome Baseball","player":"C.C. Sabathia","set":"1999 Bowman Chrome Baseball","number":"344","variant":"Base","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1699670857725x475053799924132860/resized_20231111_024737.jpeg","category":"Baseball","category_group":"Sports Cards","set_type":"Bowman Chrome Baseball","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885"},"fmv":{"price":416.25,"price_low":397.26,"price_high":435.24,"confidence":0.3499,"method":"direct","freshness_days":1,"support_grades":1,"grade_label":"PSA 10","provider":"PSA","grade_value":10.0,"raw_price":416.25,"index_truncated":false,"fmv_window_days":7,"fmv_sample_count":3,"confidence_grade":"B","price_explanation":"Used 7d FMV ($416.25, Winsorized median of 3 daily prints) in place of latest_price $416.25. Fresh (1d) — no movement adjustment applied."},"card_source":"gemrate_id"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/card-match":{"post":{"tags":["agent"],"summary":"Match a Card from a Text Description (AI)","description":"Match a natural language card description to the best card in the CardHedge database.\n\nUses AI to evaluate search results and return the single best match with a confidence score.\n\n**How it works:**\n1. Your query is sent to the card search API to find candidates\n2. An LLM evaluates each candidate against your description\n3. The best match is returned with a confidence score (0.0 - 1.0)\n\n**Confidence levels:**\n- **0.9 - 1.0**: Very high confidence — near-exact match\n- **0.7 - 0.9**: High confidence — likely correct match\n- **0.5 - 0.7**: Moderate confidence — possible match, verify manually\n- **Below 0.5**: No match returned (threshold not met)\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"query\": \"2025 Topps Chrome Cooper Flagg 251\",\n       \"category\": \"Basketball\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/card-match\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/card-match` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_card_match","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardMatchRequest"}}},"required":true},"responses":{"200":{"description":"Best matching card, or a null match below the confidence threshold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardMatchResponse"},"examples":{"matched_card":{"summary":"High-confidence card match","value":{"match":{"confidence":0.95,"reasoning":"Exact match on player, year, set, and card number.","description":"Shohei Ohtani 2018 Topps Chrome Baseball","player":"Shohei Ohtani","set":"2018 Topps Chrome Baseball","number":"150","variant":"Base","card_id":"1587446850514x224832321163624450","image":"https://images.example.com/ohtani-150.jpg","category":"Baseball","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"}],"gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785"},"candidates_evaluated":10,"search_query_used":"2018 Topps Chrome Shohei Ohtani #150"}},"no_confident_match":{"summary":"No candidate met the confidence threshold","value":{"candidates_evaluated":10,"search_query_used":"unknown card description"}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/sales-by-search":{"post":{"tags":["agent"],"summary":"Get Newest Clean Sales by Text Search and Grade (Commercial Agreement Required)","description":"Return the newest N clean sales for a text-described card and grade.\n\nCommercial access is required. The authenticated API accepts Enterprise\ntier keys; paid calls use the Agent API adapter for this same handler.\n\nSports queries require a release year (including seasons such as 2023-24)\nbefore retrieval. Non-sports queries do not require a year. Category and\nclear sports product/category words establish whether this rule applies;\nambiguous uncategorized text is not assumed to be sports.\nTCG queries require a card number, such as #4, 4/102, or OP01-001.\nA year, grade, set code or explicitly labeled serial is not a card number.\nsales-by-search is not a general free-text search. Use card identifiers to\nspecify one card: player/character, set/product, card number and variant\nwhere applicable. Put the grade in the grade field. A catalog card_id is\nnot required.\n\nThe public contract deliberately has no date range. ``last_n`` is filled\n*after* filtering: the service keeps scanning newest-first index pages until\nN sales survive, the index is exhausted, or the configured safety limit is\nreached.\n\nText retrieval runs concurrently with optional, budgeted ``card-match``\nenrichment. A match must validate against the original query before its\nheader or exact card-ID stream is used. Timeouts and rejected matches fall\nback to an inferred header. Inspect ``results.coverage_complete`` and\n``partial_reasons`` for deadline, unresolved-listing, and identity ambiguity.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/sales-by-search` and pay **$0.020 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_sales_by_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesBySearchRequest"}}},"required":true},"responses":{"200":{"description":"Curated card header when card-match succeeds, plus the newest sales that survive grade and sibling-variant filtering","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesBySearchResponse"},"examples":{"curated_card":{"summary":"Newest filtered sales with a curated card header","value":{"header":{"source":"curated_card","card_match_status":"matched","card":{"confidence":0.95,"reasoning":"Exact player, set, number, and variant match.","description":"Luka Doncic 2018 Panini Prizm Basketball Silver","player":"Luka Doncic","set":"2018 Panini Prizm Basketball","subset":"Base Set","number":"280","variant":"Silver","card_id":"1587446850514x224832321163624450","image":"https://images.example.com/luka-280.jpg","category":"Basketball","prices":[{"grade":"PSA 10","price":"1200"}],"gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785"}},"query":"2018 Panini Prizm Luka Doncic #280 Silver","search_query_used":"2018 Panini Prizm Luka Doncic #280 Silver","grade":"PSA 10","results":{"requested":1,"returned":1,"candidates_scanned":4,"complete":true,"index_exhausted":false,"scan_limit_reached":false,"classifier_mode":"off"},"exclusions":{"duplicate":0,"wrong_grade":2,"wrong_card":0,"sibling_variant":1,"wrong_item":0,"uncertain":0},"sales":[{"id":"sale-1","title":"2018 Prizm Luka Doncic #280 Silver PSA 10","sale_date":"2026-08-29T19:30:00.000Z","price":1150.0,"grade":"PSA 10","grader":"PSA","price_source":"ebay","sale_type":"Auction","sale_url":"https://www.ebay.com/itm/example","image":"https://i.ebayimg.com/example.jpg","card_id":"1587446850514x224832321163624450","match_method":"curated_id"}]}}}}}},"400":{"description":"The grade is unknown or the cleaned query contains no card identity"},"403":{"description":"Enterprise tier required on the authenticated API; paid Agent calls use /v1/agent/cards/sales-by-search"},"422":{"description":"Request validation error, missing sports year or TCG card number, or last_n exceeds 20"},"503":{"description":"The price-history search service is unavailable"},"504":{"description":"The request deadline expired before grade resolution"}}}},"/v1/agent/cards/prices-by-cert-ocr":{"post":{"tags":["agent"],"summary":"Get Price History by Graded Card Image","description":"Extract grader and certificate number from a graded card image, then look up pricing.\n\nThis endpoint uses AI vision to read the grading label from a card image,\nextracts the grading company (PSA, BGS, CGC, etc.) and certificate number,\nthen performs the same lookup as `/prices-by-cert`.\n\nProvide either `image_url` (public URL) or `image_base64` (base64-encoded image).\n\n### Daily limit\n\n**This endpoint is capped at 2000 requests per day per API key.**\n\nThe allowance is shared with `/v1/cards/details-by-cert-ocr` — calls to\neither endpoint draw from the same daily pool. It resets at 00:00 UTC and\napplies on every subscription tier, because each request runs an AI vision\nmodel over your image.\n\nOnce the cap is reached the endpoint returns `429` until reset. The `429`\nresponse carries the quota state in its headers:\n\n| Header | Meaning |\n|---|---|\n| `X-RateLimit-Limit` | Your daily allowance |\n| `X-RateLimit-Remaining` | Calls left today (`0` on a `429`) |\n| `X-RateLimit-Reset` | Unix epoch seconds when the quota resets |\n| `Retry-After` | Seconds until the quota resets |\n\nSuccessful responses do not currently carry these headers, so track your\nown call count if you need to throttle before hitting the cap.\n\n**Contact sales if you need more capacity** —\n[support@cardhedger.com](mailto:support@cardhedger.com?subject=OCR%20capacity%20increase).\nHigher daily allowances are available for this endpoint.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"image_url\": \"https://example.com/graded-card.jpg\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/prices-by-cert-ocr\"\n```\n\nReturns certificate info, card details, and price history (same as prices-by-cert).\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/prices-by-cert-ocr` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_prices_by_cert_ocr","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageCertLookupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertLookupResponse"},"examples":{"default":{"summary":"Prices by cert image response","value":{"cert_info":{"grader":"psa","cert":"50000000","grade":"PSA 10","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","universal_gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","description":"1999 Bowman Chrome C.C. Sabathia 344"},"card":{"card_id":"1699670576265x928796749151534600","description":"C.C. Sabathia 1999 Bowman Chrome Baseball","player":"C.C. Sabathia","set":"1999 Bowman Chrome Baseball","number":"344","variant":"Base","image":"https://example.com/card.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Bowman Chrome Baseball","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885"},"prices":[{"closing_date":"2025-10-26T23:59:00.000Z","Grade":"PSA 10","card_id":"1699670576265x928796749151534600","price":"125.50"}]}}}}}},"429":{"description":"Daily OCR quota exceeded. This endpoint allows 2000 requests per day per API key, shared across `prices-by-cert-ocr` and `details-by-cert-ocr`, resetting at 00:00 UTC. See the `Retry-After` and `X-RateLimit-*` response headers. Contact sales at support@cardhedger.com if you need more capacity.","headers":{"Retry-After":{"description":"Seconds until the daily quota resets.","schema":{"type":"integer","example":43200}},"X-RateLimit-Limit":{"description":"Daily request allowance for this endpoint group.","schema":{"type":"integer","example":2000}},"X-RateLimit-Remaining":{"description":"Requests remaining today (0 on a 429).","schema":{"type":"integer","example":0}},"X-RateLimit-Reset":{"description":"Unix epoch seconds at which the quota resets.","schema":{"type":"integer","example":1785715200}}},"content":{"application/json":{"example":{"detail":"Daily limit of 2000 OCR requests reached. The quota resets at 00:00 UTC."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/details-by-cert-ocr":{"post":{"tags":["agent"],"summary":"Get Card Details by Graded Card Image","description":"Extract grader and certificate number from a graded card image, then look up card details.\n\nThis endpoint uses AI vision to read the grading label from a card image,\nextracts the grading company (PSA, BGS, CGC, etc.) and certificate number,\nthen returns certificate info and card details (without price history).\n\nSame as `/details-by-certs` but accepts an image instead of certificate numbers.\n\nProvide either `image_url` (public URL) or `image_base64` (base64-encoded image).\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"image_url\": \"https://example.com/graded-card.jpg\"\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/details-by-cert-ocr\"\n```\n\n### Daily limit\n\n**This endpoint is capped at 2000 requests per day per API key.**\n\nThe allowance is shared with `/v1/cards/prices-by-cert-ocr` — calls to\neither endpoint draw from the same daily pool. It resets at 00:00 UTC and\napplies on every subscription tier, because each request runs an AI vision\nmodel over your image.\n\nOnce the cap is reached the endpoint returns `429` until reset. The `429`\nresponse carries the quota state in its headers:\n\n| Header | Meaning |\n|---|---|\n| `X-RateLimit-Limit` | Your daily allowance |\n| `X-RateLimit-Remaining` | Calls left today (`0` on a `429`) |\n| `X-RateLimit-Reset` | Unix epoch seconds when the quota resets |\n| `Retry-After` | Seconds until the quota resets |\n\nSuccessful responses do not currently carry these headers, so track your\nown call count if you need to throttle before hitting the cap.\n\n**Contact sales if you need more capacity** —\n[support@cardhedger.com](mailto:support@cardhedger.com?subject=OCR%20capacity%20increase).\nHigher daily allowances are available for this endpoint.\n\nReturns certificate info and card details (no price history).\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/details-by-cert-ocr` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_details_by_cert_ocr","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageCertDetailsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleCertResult"},"examples":{"default":{"summary":"Card details from image","value":{"cert_info":{"grader":"psa","cert":"145110823","grade":"PSA 10","gemrate_id":"abc123","universal_gemrate_id":"abc123","description":"2025 Topps Cooper Flagg 201"},"card":{"card_id":"1699670576265x928796749151534600","description":"Cooper Flagg 2025 Topps Basketball","player":"Cooper Flagg","set":"2025 Topps Basketball","number":"201","variant":"Base","image":"https://example.com/flagg.jpg","category":"Basketball","category_group":"Sports Cards","set_type":"Topps Basketball","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885"}}}}}}},"429":{"description":"Daily OCR quota exceeded. This endpoint allows 2000 requests per day per API key, shared across `prices-by-cert-ocr` and `details-by-cert-ocr`, resetting at 00:00 UTC. See the `Retry-After` and `X-RateLimit-*` response headers. Contact sales at support@cardhedger.com if you need more capacity.","headers":{"Retry-After":{"description":"Seconds until the daily quota resets.","schema":{"type":"integer","example":43200}},"X-RateLimit-Limit":{"description":"Daily request allowance for this endpoint group.","schema":{"type":"integer","example":2000}},"X-RateLimit-Remaining":{"description":"Requests remaining today (0 on a 429).","schema":{"type":"integer","example":0}},"X-RateLimit-Reset":{"description":"Unix epoch seconds at which the quota resets.","schema":{"type":"integer","example":1785715200}}},"content":{"application/json":{"example":{"detail":"Daily limit of 2000 OCR requests reached. The quota resets at 00:00 UTC."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/sales-stats-by-player":{"post":{"tags":["agent"],"summary":"Get Sales Trends by Player (Daily/Weekly/Monthly)","description":"Return sales statistics per player — **count**, **total amount (USD)**, and\n**mean sale price** — bucketed by day, week, or calendar month. Useful for\ntrend charts, period-over-period comparisons, and tracking how a player's\nmarket is moving over time.\n\n### How buckets are aligned\n\nAll buckets are calendar-aligned in UTC:\n\n- **`day`** — midnight-to-midnight UTC.\n- **`week`** — ISO week, Monday → Sunday.\n- **`month`** — first → last calendar day of the month.\n\n### Current (in-progress) period\n\nBy default (`include_current: true`) the newest bucket is the in-progress\nperiod (month-to-date, week-to-date, or today so far) and is flagged with\n`partial: true` so clients can render it differently — e.g. a dashed line\non a chart. Set `include_current: false` to return only fully-closed\nperiods, which is the right choice for clean trend lines.\n\nThe `periods` value is the **total** number of buckets returned, regardless\nof whether the newest is partial. Requesting `periods=12, interval=week`\nwith the default flag returns 11 closed weeks + 1 partial (week-to-date).\n\n### Caps and rate considerations\n\n`periods` is capped per interval to keep request fan-out reasonable:\n\n| Interval | Max periods |\n|----------|-------------|\n| `day`    | 90          |\n| `week`   | 52          |\n| `month`  | 24          |\n\nClosed buckets are cached server-side for 24 hours, so repeat calls for\nthe same player/interval are near-instant. The partial bucket is never\ncached and is recomputed on every request.\n\n### Field meanings\n\n- `count` — number of sales matching the player name in the bucket window.\n- `total_amount` — sum of sale prices in USD.\n- `average_sale` — arithmetic mean (sum ÷ count). Note that the underlying\n  data includes some very low-value sales (e.g. bulk lots), which can pull\n  the mean down for high-volume players.\n- `partial` — `true` only for the in-progress current bucket.\n\nBuckets are returned **oldest → newest**.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/sales-stats-by-player` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_sales_stats_by_player","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesStatsByPlayerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesStatsByPlayerResponse"},"example":{"interval":"week","periods":4,"results":[{"player":"Mike Trout","buckets":[{"start":"2026-03-23","end":"2026-03-29","count":2841,"total_amount":218394.55,"average_sale":76.87,"partial":false},{"start":"2026-03-30","end":"2026-04-05","count":3102,"total_amount":245118.2,"average_sale":79.02,"partial":false},{"start":"2026-04-06","end":"2026-04-12","count":3070,"total_amount":250383.46,"average_sale":81.56,"partial":false},{"start":"2026-04-13","end":"2026-04-15","count":1124,"total_amount":92011.3,"average_sale":81.86,"partial":true}]}]}}}},"422":{"description":"Invalid request — most commonly `periods` exceeds the cap for the requested `interval` (day≤90, week≤52, month≤24)."},"502":{"description":"Upstream search backend error."},"503":{"description":"Search is not configured on the server."}}}},"/v1/agent/cards/total-sales-by-player":{"post":{"tags":["agent"],"summary":"Get Total Sales Count by Player","description":"Get total sales counts per player/character over a recent window.\n\nCounts sales records from the last N days that mention each player or\ncharacter name. Returns only the counts — no individual sale records —\nso it stays fast even for high-volume players.\n\n**Parameters:**\n- `players`: List of player/character names (max 25)\n- `days`: Look-back window in days (default: 30, max: 365)\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/total-sales-by-player` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_total_sales_by_player","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotalSalesByPlayerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotalSalesByPlayerResponse"},"example":{"results":[{"player":"Mike Trout","total_sales":12809,"search_time_ms":391},{"player":"Shohei Ohtani","total_sales":87192,"search_time_ms":618}],"days":30}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/search-cards-wsort":{"post":{"tags":["agent"],"summary":"Search Cards with Sorting","description":"Search for cards from the database with full-text search, filtering, sorting, and pagination.\n\n**⚠️ Required:** At least one filter parameter (`search`, `set`, `category`, or `player`) is required.\n\n**Search Parameter:**\n- `search`: Full-text fuzzy search across card description and player names\n- Supports multiple keywords: \"Shohei Ohtani rookie\" matches cards containing all terms\n\n**Filter Parameters (exact match):**\n- `player`: Exact player name match (e.g., \"Mike Trout\")\n- `set`: Exact set name match (e.g., \"2018 Panini Prizm Basketball\")\n- `category`: Exact category match (e.g., \"Baseball\", \"Pokemon\", \"Basketball\")\n\n**Sorting Options:**\n- `sort_by`:\n  - `\"gain\"` - 7-day price change percentage\n  - `\"gain_30day\"` - 30-day price change percentage\n  - `\"sales_7day\"` - 7-day sales volume\n  - `\"sales_30day\"` - 30-day sales volume\n  - `\"sales\"` - alias for sales_30day (backwards compatible)\n  - `\"price\"` - current price\n  - `\"description\"` - alphabetical\n- `sort_order`: \"asc\" or \"desc\"\n\n**Paging (use the cursor):**\n- Send the first request without `cursor`. Every response has\n  `next_cursor`: send it back as `cursor`, with the same search, filters,\n  `sort_by` and `sort_order`, to get the next page. Repeat until\n  `next_cursor` is null. Every cursor page costs the same at any depth, so\n  this is the way to walk a whole category.\n- `page_size`: Results per page (max 100).\n- `page`: Not needed with `cursor` (ignored when `cursor` is sent).\n  Deprecated past the first 100,000 results (`(page - 1) * page_size` of\n  100,000 or more): those pages slow down with depth and can time out.\n  They are still served, with a `deprecation` notice, until 2026-11-24,\n  when they stop working.\n\n**Other Options:**\n- `raw_images_only`: When true, returns raw card images instead of graded slab images\n\n**Response:**\n- `cards`: Array of card objects including:\n  - `gain`: 7-day price change percentage\n  - `gain_30day`: 30-day price change percentage\n  - `7 Day Sales` / `30 Day Sales`: Sales volume\n  - `prices`: Array of grade/price pairs\n- `next_cursor`: Send as `cursor` for the next page; null on the last page\n- `deprecation`: Set when the request used a deprecated pattern (a page\n  number past the first 100,000 results), saying what to do instead;\n  null otherwise\n- `pages`, `count`: Deprecated, kept for older integrations. `count` is\n  always 0 (the total is not computed); `pages` is the requested page + 1\n  while more results follow. Use `next_cursor` instead.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/search-cards-wsort` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_search_cards_wsort","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardSearchLocalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardSearchLocalResponse"},"examples":{"default":{"summary":"A page with more to follow","description":"`next_cursor` is set because more results follow: send it back as `cursor` to get the next page. It is null on the last page. `pages` and `count` are deprecated, kept for older integrations (`count` is always 0).","value":{"pages":2,"count":0,"cards":[{"description":"Shohei Ohtani 2024 Topps Chrome Baseball","player":"Shohei Ohtani","set":"2024 Topps Chrome Baseball","number":"150","variant":"Base","card_id":"1587446850514x224832321163624450","image":"https://example.com/card.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Topps Chrome Baseball","7 Day Sales":45,"30 Day Sales":187,"rookie":false,"gain":12.5,"gain_30day":18.3,"stats_grade":"PSA 10","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"},{"grade":"Raw","price":"45.99"}],"subset":"Base Set","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785"}],"next_cursor":"eyJ2IjoxLCJzIjoiZGVzY3JpcHRpb24iLCJkIjowLCJmIjoiZTJlYWM1MTY5ZDMyZDc2OCIsImsiOiJTaG9oZWkgT2h0YW5pIDIwMjQgVG9wcHMgQ2hyb21lIEJhc2ViYWxsIiwiaSI6IjE1ODc0NDY4NTA1MTR4MjI0ODMyMzIxMTYzNjI0NDUwIn0"}},"deprecated_deep_page":{"summary":"Deprecated deep page number","description":"A page-number request past the first 100,000 results (here page 1,501 at 100 per page) is still served until 2026-11-24, with a `deprecation` notice. Continue the walk with `next_cursor`.","value":{"pages":1502,"count":0,"cards":[{"description":"Shohei Ohtani 2024 Topps Chrome Baseball","player":"Shohei Ohtani","set":"2024 Topps Chrome Baseball","number":"150","variant":"Base","card_id":"1587446850514x224832321163624450","image":"https://example.com/card.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Topps Chrome Baseball","7 Day Sales":45,"30 Day Sales":187,"rookie":false,"gain":12.5,"gain_30day":18.3,"stats_grade":"PSA 10","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"},{"grade":"Raw","price":"45.99"}],"subset":"Base Set","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785"}],"next_cursor":"eyJ2IjoxLCJzIjoiZGVzY3JpcHRpb24iLCJkIjowLCJmIjoiZTJlYWM1MTY5ZDMyZDc2OCIsImsiOiJTaG9oZWkgT2h0YW5pIDIwMjQgVG9wcHMgQ2hyb21lIEJhc2ViYWxsIiwiaSI6IjE1ODc0NDY4NTA1MTR4MjI0ODMyMzIxMTYzNjI0NDUwIn0","deprecation":"Page numbers past the first 100,000 results are deprecated and stop working on 2026-11-24: deep pages get slower the further they go and can time out. Switch to cursor paging: send this response's `next_cursor` back as `cursor` (with the same search, filters, sort_by and sort_order) to continue from this page. Cursor pages are fast at any depth."}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/player-search":{"post":{"tags":["agent"],"summary":"Search Players","description":"Search Card Hedge's canonical player catalog by partial name.\n\nDuplicate player records (e.g. two \"LeBron James\" records) are folded into\none canonical player: `player_id` is the canonical ID and `aliases` lists\nthe merged IDs, whose stats are summed. `categories` lists every category\nthe player appears in; the optional `category` filter matches any of them.\n`index` says whether a player index is available (`current`, `stale`,\n`withheld`, or `none`).\n\nResults are ranked by 30-day sales and capped by `count`.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\"          -H \"Content-Type: application/json\"          -d '{\"search\":\"Luka\",\"count\":5}'          \"https://api.cardhedger.com/v1/cards/player-search\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/player-search` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_player_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerSearchResponse"},"example":{"count":1,"players":[{"player_id":"1585495598505x695909526016884700","name":"Michael Jordan","categories":["Basketball","Baseball"],"aliases":[],"cards_tracked":3746,"thirty_day_sales":20946,"index":{"has_index":true,"as_of":"2026-09-25","status":"current"}}]}}}},"422":{"description":"Unknown category (the response lists valid ones)"}}}},"/v1/agent/cards/player-index":{"post":{"tags":["agent"],"summary":"Get Player Index","description":"Latest cached player index: a market-cap-weighted average price (USD) of\nthe player's top-10 cards, with 1d/7d/30d/90d/365d changes and the cards\nbehind it.\n\nIdentify the player by `player_id` (recommended — from `player-search`) or\nby `name` (+ optional `category`). A name must match exactly one player,\notherwise the response is 409 with `candidates`. Merged duplicate IDs\nresolve to their canonical player (`resolution.resolved_via: \"alias\"`).\n\n`status` is `current` (updated within `PLAYER_INDEX_STALE_DAYS` days,\ndefault 2), `stale` (older; still served — the API never triggers a\nrecalculation), or `withheld` (at least `PLAYER_INDEX_WITHHOLD_FOREIGN_PCT`\npercent, default 25, of the index's weight comes from other players'\ncards; `value` is null and `integrity.reason` explains).\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\"          -H \"Content-Type: application/json\"          -d '{\"name\":\"Luka Doncic\"}'          \"https://api.cardhedger.com/v1/cards/player-index\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/player-index` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_player_index","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerIndexResponse"},"example":{"player":{"player_id":"1585918730738x583198232556601300","name":"Luka Doncic","categories":["Basketball"],"aliases":[]},"resolution":{"requested_player_id":"1585918730738x583198232556601300","resolved_via":"player_id"},"index":{"value":948.01,"as_of":"2026-09-25","status":"current","days_since_update":0,"volume_30d":357,"card_count":10,"changes":{"1d":{"abs":11.52,"pct":1.23},"7d":{"abs":-20.4,"pct":-2.11}},"methodology":{"algorithm":"market_cap_weighted","base_grade":"PSA 10","version":"2.0.0"}},"integrity":{"verdict":"ok","foreign_weight_pct":0.0,"unknown_weight_pct":0.0},"constituents":[{"card_id":"1588995508450x437304889574424600","card_name":"Luka Doncic 2018 Panini Prizm Basketball Silver","set":"2018 Panini Prizm Basketball","variant":"Silver","grade":"PSA 10","price":1850.0,"weight":40.0,"volume_30d":38,"owned_by_player":true}]}}}},"404":{"description":"`player_not_found` (with `suggestions`) or `index_not_found`"},"409":{"description":"`ambiguous_player`: the name matches several players; `candidates` lists them"},"422":{"description":"`invalid_request`: both/neither of player_id and name, category without name, unknown category, or a bad window"},"502":{"description":"`upstream_error`"},"503":{"description":"`identity_unavailable`: the player catalog has not loaded yet; retry shortly"}}}},"/v1/agent/cards/player-index-history":{"post":{"tags":["agent"],"summary":"Get Player Index History","description":"Player index values over a date range (default: the 365 days up to the\nlatest index date; at most 1,830 days).\n\n`weekly` points are averages keyed by the ISO-week Monday, `monthly` by\nthe 1st. Points built from a constituent set that fails the integrity\ncheck come back with `value: null, withheld: true`.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\"          -H \"Content-Type: application/json\"          -d '{\"name\":\"Luka Doncic\",\"interval\":\"monthly\"}'          \"https://api.cardhedger.com/v1/cards/player-index-history\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/player-index-history` and pay **$0.020 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_player_index_history","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerIndexHistoryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerIndexHistoryResponse"},"example":{"player":{"player_id":"1585918730738x583198232556601300","name":"Luka Doncic","categories":["Basketball"],"aliases":[]},"resolution":{"requested_player_id":"1585918730738x583198232556601300","resolved_via":"player_id"},"interval":"weekly","start_date":"2026-09-21","end_date":"2026-09-25","points":[{"date":"2026-09-21","value":941.2,"volume_30d":350,"card_count":10,"withheld":false}],"integrity":{"verdict":"ok","foreign_weight_pct":0.0,"unknown_weight_pct":0.0}}}}},"404":{"description":"`player_not_found` (with `suggestions`) or `index_not_found`"},"409":{"description":"`ambiguous_player`: the name matches several players; `candidates` lists them"},"422":{"description":"`invalid_request`: both/neither of player_id and name, category without name, unknown category, or a bad window"},"502":{"description":"`upstream_error`"},"503":{"description":"`identity_unavailable`: the player catalog has not loaded yet; retry shortly"}}}},"/v1/agent/cards/category-index-search":{"post":{"tags":["agent"],"summary":"Search Category Indexes","description":"List the category market indexes, or search for one.\n\nEach index is a basket of hand-picked cards (with a grade) for one\ncategory, valued daily. `latest` is the newest daily level (in index\npoints; compare movements in percent) and `changes` compares it with\n1, 7, 30, 90, 180 and 365 days before. Pass an index's `slug` to\n`category-index-history` for its values over time.\n\nSend `{}` (or no body) to list every index. `search` matches part of\nthe name, slug or category; `category` must match exactly. Both ignore\ncase.\n\n**Finding the index you need**\n\n1. Send `{}` to list every index, or narrow the list with `search`\n   (e.g. `{\"search\": \"poke\"}`) or `category` (e.g. `{\"category\": \"Hockey\"}`).\n2. Take the `slug` of the index you want, e.g. `hockey`. The slug is the\n   index's stable key, so you can store it and skip this step next time.\n3. Pass it as `index` to `category-index-history` for its values over time.\n\nOnly need today's level and recent moves, e.g. for a dashboard tile?\nThis response has them: `latest` and `changes`.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{}' \\\n     \"https://api.cardhedger.com/v1/cards/category-index-search\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/category-index-search`; free, no payment or API key required. (Any `X-API-Key` in the examples above is the keyed customer API; the agent surface needs no key.)","operationId":"agent_category_index_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryIndexSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryIndexSearchResponse"},"example":{"count":1,"indexes":[{"slug":"baseball","name":"Baseball","category":"Baseball","description":"A collection of staple baseball cards spanning from the early 1900s through early modern.","base_date":"2021-12-01","latest":{"value":707592.83,"as_of":"2026-11-06","card_count":213,"cards_priced":213,"calc_version":"1.1.0"},"changes":{"1d":{"abs":19.8,"pct":0.0},"7d":{"abs":703.83,"pct":0.1},"30d":{"abs":8995.48,"pct":1.29},"90d":{"abs":65616.95,"pct":10.22},"180d":{"abs":116204.6,"pct":19.65},"365d":{"abs":233172.48,"pct":49.15}}}]}}}},"422":{"description":"`invalid_request`: a malformed body, or start_date after end_date"},"502":{"description":"`upstream_error`: index data is temporarily unavailable"}}}},"/v1/agent/cards/category-index-history":{"post":{"tags":["agent"],"summary":"Get Category Index History","description":"A category index's values over a period of time.\n\nIdentify the index by `slug` (from `category-index-search`) or name.\nThe window defaults to the 365 days up to the latest index date; send a\n`start_date` on or before the index's `base_date` for its whole history.\n`weekly` points are averages keyed by the Monday, `monthly` by the 1st.\n\n`summary` gives the period's start and end values, change, high and low,\nalways from the daily values.\n\nDon't know the slug? List every index with `category-index-search`\n(send `{}`), or pass the index's name instead, e.g. `\"Pokemon\"`. An\nunknown index is a 404 whose `detail.available` lists every valid slug.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"index\":\"baseball\",\"start_date\":\"2026-10-31\",\"end_date\":\"2026-11-06\"}' \\\n     \"https://api.cardhedger.com/v1/cards/category-index-history\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/category-index-history` and pay **$0.020 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_category_index_history","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryIndexHistoryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryIndexHistoryResponse"},"example":{"index":{"slug":"baseball","name":"Baseball","category":"Baseball","description":"A collection of staple baseball cards spanning from the early 1900s through early modern.","base_date":"2021-12-01"},"interval":"daily","start_date":"2026-10-31","end_date":"2026-11-06","summary":{"start_value":707114.17,"end_value":707592.83,"change":{"abs":478.66,"pct":0.07},"high":709120.05,"high_date":"2026-11-03","low":707114.17,"low_date":"2026-10-31"},"points":[{"date":"2026-10-31","value":707114.17},{"date":"2026-11-01","value":707255.18},{"date":"2026-11-02","value":709073.39},{"date":"2026-11-03","value":709120.05},{"date":"2026-11-04","value":708146.84},{"date":"2026-11-05","value":707573.03},{"date":"2026-11-06","value":707592.83}]}}}},"404":{"description":"`index_not_found`: no published index has that slug or name; `available` lists the slugs"},"409":{"description":"`ambiguous_index`: the name is shared by several indexes; `candidates` lists their slugs"},"422":{"description":"`invalid_request`: a malformed body, or start_date after end_date"},"502":{"description":"`upstream_error`: index data is temporarily unavailable"}}}},"/v1/agent/cards/card-feed":{"post":{"tags":["agent"],"summary":"New Cards Feed","description":"Cards newly added to the Card Hedge catalog, newest first, paged with a cursor.\n\nUse it to keep your own copy of the catalog current: ask for every card added\nsince a time you choose (at most 30 days back), optionally in one `category`.\n\n**Access:** Enterprise API keys. Without one, the same feed is sold per call\nover x402 at /v1/agent/cards/card-feed ($0.01 per page).\n\n**How to poll:**\n1. Start a walk: send `{}` or a `category`. Without `since` it covers the\n   last 30 days.\n2. Send each response's `next_cursor` back as `cursor` until it is null.\n3. Next time, send the finished walk's `until` as `since`: you get only the\n   cards added after it.\n\n**Window:** each walk returns the cards added in [`since`, `until`), newest\nfirst (by `created_at`, then `card_id`). `until` is set when the walk\nstarts, two minutes before then, so a card still being written is picked up\nby the next poll rather than skipped. Every page of a walk reads the same\nwindow; cursors never expire. No page returns cards added more than 30 days\nago, so on a walk that takes a long time the window's oldest cards drop off.\nThe feed lists cards by when they were added: it does not report later\nchanges to a card (a new category, new prices) or cards that are removed.\n\n**Request:**\n- `since` (optional): ISO 8601 date or date-time (no time zone = UTC), at\n  most 30 days back. Default: 30 days ago. A date alone means midnight UTC,\n  so the date 30 days ago is already too old for most of the day: omit\n  `since` for the full 30 days.\n- `category` (optional): exact category name, any case ('Baseball',\n  'Pokemon'). Default: every category.\n- `page_size`: 1-100 cards per page (default 100), on the keyed API and x402.\n- `cursor`: the previous response's `next_cursor`. With a cursor, `since`\n  and `category` may be omitted; if sent they must match the walk.\n- `raw_images_only` (optional): image preference, as on `search-cards-wsort`.\n\n**Response:**\n- `cards`: the same card object as `search-cards-wsort` (`card_id`,\n  description, player, set, number, variant, image, category, sales, gains,\n  `prices`, `gemrate_id`) plus `created_at`, when the card was added.\n- `next_cursor`: the next (older) page; null when the walk is complete.\n- `since`, `until`: the walk's window. Send `until` as the next `since`.\n\n**Errors:** 400 for a `since` older than 30 days, a malformed cursor, or a\ncursor sent with a different `category` or `since`; 403 for a key that is\nnot Enterprise.\n\n```bash\ncurl -X POST \"https://api.cardhedger.com/v1/cards/card-feed\" \\\n  -H \"X-API-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"category\": \"Baseball\", \"page_size\": 100}'\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/card-feed` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_card_feed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardFeedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardFeedResponse"},"examples":{"default":{"summary":"A page with more to follow","description":"`next_cursor` is set because older cards follow: send it back as `cursor`. When it is null the walk is complete; send `until` as `since` on your next poll.","value":{"cards":[{"description":"Shohei Ohtani 2024 Topps Chrome Baseball","player":"Shohei Ohtani","set":"2024 Topps Chrome Baseball","number":"150","variant":"Base","card_id":"1587446850514x224832321163624450","image":"https://example.com/card.jpg","category":"Baseball","category_group":"Sports Cards","set_type":"Topps Chrome Baseball","7 Day Sales":45,"30 Day Sales":187,"rookie":false,"gain":12.5,"gain_30day":18.3,"stats_grade":"PSA 10","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"},{"grade":"Raw","price":"45.99"}],"subset":"Base Set","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","created_at":"2026-11-11T17:41:08.512094Z"}],"next_cursor":"eyJ2IjoxLCJjIjoiQmFzZWJhbGwiLCJzIjoiMjAyNi0xMC0xMlQxODowMDowMCswMDowMCIsInUiOiIyMDI2LTExLTExVDE4OjAwOjAwKzAwOjAwIiwiayI6IjIwMjYtMTEtMTFUMTc6NDE6MDguNTEyMDk0KzAwOjAwIiwiaSI6IjE1ODc0NDY4NTA1MTR4MjI0ODMyMzIxMTYzNjI0NDUwIn0","category":"Baseball","since":"2026-10-12T18:00:00Z","until":"2026-11-11T18:00:00Z"}}}}}},"400":{"description":"`since` older than 30 days, a malformed cursor, or a cursor sent with a different `category` or `since`"},"403":{"description":"The API key is not on the Enterprise tier (use the x402 route /v1/agent/cards/card-feed instead)"},"503":{"description":"The catalog is temporarily unavailable; retry"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/set-search":{"post":{"tags":["agent"],"summary":"Search Card Sets","description":"Search for card sets with optional name and category filters.\n\nSearch the CardHedge database for sets by name and/or category. Useful for\npopulating set dropdowns, browsing available sets, or finding specific product lines.\n\n**Parameters:**\n- `search`: Optional text query matched against set names (e.g., \"Topps Chrome\", \"Pokemon 151\")\n- `category`: Optional category filter (e.g., \"Baseball\", \"Basketball\", \"Pokemon\", \"Football\")\n- `count`: Number of results to return (1-100, default: 25)\n- `page`, `sort`, `brand_id`: send any of them for paged mode (below)\n\n**Response includes:**\n- `count`: Number of sets returned\n- `sets`: Array of set objects with name, year, category, image, and 30-day sales volume\n\n**Paged mode (every set, page by page)**\n\nSending `page`, `sort` or `brand_id` switches to paged mode, which reads\nthe synced set catalog instead of the default search and adds\n`total_count`, `page` and `has_more` to the response and `brand_id` and\n`brand` to each set. `count` (1-100) is the page size.\n\n- `sort`: `\"sales\"` (30-day sales, the default) or `\"name\"`. Use `\"name\"`\n  for a complete walk: sales order changes daily, so a walk by sales can\n  skip or repeat sets between pages.\n- `brand_id`: only that brand's sets. Take it from `brand-search`.\n- `search` matches every word against the set name, ignoring case (only\n  the first 10 words are used; the rest are ignored); a `*`, `%` or `_`\n  in it is matched literally.\n- `image` is `\"\"` in paged mode for now; the catalog does not carry set\n  images yet.\n- A set name can be shared by two sets: `id` is the reliable key. Pass it\n  as `set_id` to `subset-search` for the set's subsets.\n\nWithout any of the three, the response has only `count` and `sets`,\nexactly as before.\n\n**Example curl:**\n```bash\n# Walk every Baseball set, 100 per page (repeat with page 2, 3, ...\n# until has_more is false)\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"category\": \"Baseball\",\n       \"sort\": \"name\",\n       \"page\": 1,\n       \"count\": 100\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/set-search\"\n\n# Search by name\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"search\": \"Pokemon 151\",\n       \"count\": 10\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/set-search\"\n\n# Filter by category\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"category\": \"Baseball\",\n       \"count\": 25\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/set-search\"\n\n# Combined search + category\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\n       \"search\": \"Topps Chrome\",\n       \"category\": \"Baseball\",\n       \"count\": 50\n     }' \\\n     \"https://api.cardhedger.com/v1/cards/set-search\"\n```\n\nReturns matching sets with metadata and sales data.\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/set-search`; free, no payment or API key required. (Any `X-API-Key` in the examples above is the keyed customer API; the agent surface needs no key.)","operationId":"agent_set_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSearchResponse"},"examples":{"paged_walk":{"summary":"Paged mode (page, sort or brand_id sent)","value":{"count":2,"total_count":412,"page":1,"has_more":true,"sets":[{"id":"1698172489325x582348120237899800","name":"2024 Topps Chrome Baseball","year":"2024","set_type":"Topps Chrome Baseball","description":"2024 Topps Chrome Baseball","category":"Baseball","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815901/crop_image","30 Day Sales":2340,"brand_id":"1587446850514x224832321163624450","brand":"Topps"},{"id":"1699670576265x928796749151534600","name":"2023 Topps Chrome Baseball","year":"2023","set_type":"Topps Chrome Baseball","description":"2023 Topps Chrome Baseball","category":"Baseball","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815900/crop_image","30 Day Sales":1250,"brand_id":"1587446850514x224832321163624450","brand":"Topps"}]}},"baseball_sets":{"summary":"Baseball set search results","value":{"count":3,"sets":[{"id":"1587446850514x224832321163624450","name":"2023 Topps Chrome Baseball","year":"2023","set_type":"Topps Chrome Baseball","description":"2023 Topps Chrome Baseball","category":"Baseball","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815900/crop_image","30 Day Sales":1250},{"id":"1684286084852x189232814543430100","name":"2024 Topps Chrome Baseball","year":"2024","set_type":"Topps Chrome Baseball","description":"2024 Topps Chrome Baseball","category":"Baseball","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815901/crop_image","30 Day Sales":2340},{"id":"1699670576265x928796749151534600","name":"2022 Topps Chrome Baseball","year":"2022","set_type":"Topps Chrome Baseball","description":"2022 Topps Chrome Baseball","category":"Baseball","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815902/crop_image","30 Day Sales":870}]}},"pokemon_sets":{"summary":"Pokemon set search results","value":{"count":2,"sets":[{"id":"1700000000001x100000000000000001","name":"2023 Pokemon 151","year":"2023","set_type":"Pokemon 151","description":"2023 Pokemon 151","category":"Pokemon","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815903/crop_image","30 Day Sales":3450},{"id":"1700000000002x100000000000000002","name":"2024 Pokemon 151 Japanese","year":"2024","set_type":"Pokemon 151","description":"2024 Pokemon 151 Japanese","category":"Pokemon","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815904/crop_image","30 Day Sales":1820}]}}}}}},"502":{"description":"`upstream_error`: set catalog data is temporarily unavailable (paged mode only)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/brand-search":{"post":{"tags":["agent"],"summary":"Search Brands","description":"List the card brands (Topps, Panini, Upper Deck, ...), or search them.\n\nSend `{}` (or no body) to get every brand in one call: `count` defaults\nto 1,000, more than the catalog holds. `search` matches part of the\nbrand name, ignoring case (a `*`, `%` or `_` in it is matched\nliterally); `category` keeps the brands with at least one set in that\ncategory. Brands are ordered by name, then id.\n\nA brand's `id` is what `set-search` takes as `brand_id`, to list that\nbrand's sets. Two brands can share a name, so keep the `id`, not the\nname.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"category\":\"Baseball\"}' \\\n     \"https://api.cardhedger.com/v1/cards/brand-search\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/brand-search`; free, no payment or API key required. (Any `X-API-Key` in the examples above is the keyed customer API; the agent surface needs no key.)","operationId":"agent_brand_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSearchResponse"},"example":{"total_count":41,"page":1,"count":3,"has_more":true,"brands":[{"id":"1684286084852x189232814543430100","name":"Panini","set_count":538,"categories":["Basketball","Football"],"thirty_day_sales":39877},{"id":"1587446850514x224832321163624450","name":"Topps","set_count":612,"categories":["Baseball","Basketball","Football","Hockey"],"thirty_day_sales":48210},{"id":"1699670576265x928796749151534600","name":"Upper Deck","set_count":274,"categories":["Baseball","Hockey"],"thirty_day_sales":15402}]}}}},"502":{"description":"`upstream_error`: set catalog data is temporarily unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/cards/subset-search":{"post":{"tags":["agent"],"summary":"Search Subsets","description":"List the subsets (parallels and inserts) of a set, with card counts.\n\nName the set with `set_id` (from `set-search`) or `set` (the exact set\nname), not both. `set_id` is the reliable key: a set name can be shared\nby two sets, and then `set` returns the subsets of both. `search`\nmatches part of the subset name, ignoring case; `category` keeps the\nsubsets of sets in that category. A `*`, `%` or `_` in `search` is\nmatched literally.\n\nThe subset list is refreshed nightly. Cards stored with a blank subset\nare counted under `Base Set`. `card-search`'s `subset` filter is exact,\nso `Base Set` there does not include the cards stored with a blank\nsubset.\n\n**Example curl:**\n```bash\ncurl -X POST -H \"X-API-Key: your-api-key-here\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"set\":\"2024 Topps Chrome Baseball\"}' \\\n     \"https://api.cardhedger.com/v1/cards/subset-search\"\n```\n\n---\n\n**Agent access** — call this at `/v1/agent/cards/subset-search` and pay **$0.010 USD** per call via x402: settle the 402 challenge from your wallet (no API key or account needed). Any `X-API-Key` / `/v1/cards/…` in the examples above is the keyed customer API; the agent equivalent is this `/v1/agent/…` path paid via x402. See `GET /v1/agent/pricing` for the catalog.","operationId":"agent_subset_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubsetSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubsetSearchResponse"},"example":{"total_count":120,"page":1,"count":3,"has_more":true,"subsets":[{"set_id":"1698172489325x582348120237899800","set":"2024 Topps Chrome Baseball","category":"Baseball","subset":"Base","card_count":330},{"set_id":"1698172489325x582348120237899800","set":"2024 Topps Chrome Baseball","category":"Baseball","subset":"Refractor","card_count":330},{"set_id":"1698172489325x582348120237899800","set":"2024 Topps Chrome Baseball","category":"Baseball","subset":"Rookie Autographs","card_count":90}]}}}},"503":{"description":"`not_ready`: the subset list is being built; try again shortly"},"502":{"description":"`upstream_error`: set catalog data is temporarily unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/pricing":{"get":{"tags":["agent"],"summary":"Agent pricing manifest","description":"Machine-readable catalog of all pay-per-call agent endpoints, their prices, and payment protocol details. Unauthenticated — no API key or payment required.","operationId":"agent_pricing_manifest","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AdditionsSummaryRequest":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date","description":"Start date (inclusive) for the summary, e.g. 2026-01-01"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"End date (inclusive). Defaults to today if omitted."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Optional category filter (e.g., 'Baseball', 'Pokemon')"},"set_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Name","description":"Optional set name filter"},"page":{"type":"integer","minimum":1.0,"title":"Page","description":"Page number","default":1},"page_size":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Page Size","description":"Rows per page","default":50}},"type":"object","required":["start_date"],"title":"AdditionsSummaryRequest","description":"Request parameters for the card additions summary endpoint."},"AllPricesByCardRequest":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier","examples":["1586414093385x612765462196125700"]}},"type":"object","required":["card_id"],"title":"AllPricesByCardRequest","description":"Request parameters for all latest prices by card endpoint.","examples":[{"card_id":"1586414093385x612765462196125700"}]},"BrandSearchRequest":{"properties":{"search":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search","description":"Substring of the brand name (case-insensitive)"},"category":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Category","description":"Only brands with sets in this category (e.g. 'Baseball')"},"page":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Page","description":"1-based page number","default":1},"count":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Count","description":"Brands per page (1-1000)","default":1000}},"type":"object","title":"BrandSearchRequest","description":"Request parameters for brand-search.","example":{"category":"Baseball"}},"CardDetailsRequest":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier from CardHedge"},"raw_images_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Raw Images Only","description":"Deprecated and ignored: this endpoint now always returns the raw card photo (not the graded slab image). The field is retained for backward compatibility but no longer affects the response."}},"type":"object","required":["card_id"],"title":"CardDetailsRequest","description":"Request parameters for card details endpoint."},"CardFMVRequest":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique CardHedge card identifier. If you only have a card name or description, call `card-match` or `card-search` first to resolve it."},"grade":{"type":"string","title":"Grade","description":"Card grade label. Supported formats: '<Provider> <Grade>' (e.g., 'PSA 9', 'PSA 10', 'BGS 9.5', 'SGC 9', 'CGC 10'), 'Raw' for ungraded, or '<Provider> Auth' for authenticated-only."}},"type":"object","required":["card_id","grade"],"title":"CardFMVRequest","description":"Request parameters for the card FMV endpoint."},"CardFeedRequest":{"properties":{"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since","description":"Return cards added at or after this time (ISO 8601 date or date-time; no time zone means UTC; a date alone means midnight UTC). At most 30 days back: an older `since` is a 400. Omit it for the whole last 30 days. To pick up only what is new since your last walk, send that walk's `until` here. With a `cursor`, omit it or send the same value."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Only cards in this category (exact name, any case: 'Baseball', 'Pokemon', 'Hockey'). Omit for every category. With a `cursor`, omit it or send the same value."},"page_size":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Page Size","description":"Cards per page (1-100).","default":100},"cursor":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Cursor","description":"Send the previous response's `next_cursor` to get the next (older) page; repeat until `next_cursor` is null. Omit it for the first page. A cursor never expires."},"raw_images_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Raw Images Only","description":"Image preference. Omitted (default): the raw card photo, falling back to the graded slab image only when no raw photo exists. true: raw only (no graded fallback). false: prefer the graded slab image."}},"type":"object","title":"CardFeedRequest","description":"Request for the new-cards feed.","examples":[{"category":"Baseball","page_size":100}]},"CardMatchRequest":{"properties":{"query":{"type":"string","maxLength":500,"minLength":3,"title":"Query","description":"Natural language description of the card to match (e.g., '2018 Topps Chrome Shohei Ohtani rookie base')"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Optional category filter to narrow search (e.g., 'Baseball', 'Pokemon')"},"max_candidates":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Candidates","description":"Number of search results to evaluate (1-10, more = slower but potentially more accurate)","default":10},"raw_images_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Raw Images Only","description":"If true, only return actual card photos (not graded slab images). Defaults to true.","default":true}},"type":"object","required":["query"],"title":"CardMatchRequest","description":"Request parameters for AI-powered card matching."},"CardSearchLocalRequest":{"properties":{"search":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search","description":"Full-text search query for fuzzy matching on card description/player (e.g., 'Trout rookie')"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set","description":"Filter by exact set name (e.g., '2024 Topps Chrome Baseball')"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Filter by exact category (e.g., 'Baseball', 'Pokemon', 'Basketball')"},"player":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player","description":"Filter by exact player name (e.g., 'Mike Trout', 'Shohei Ohtani')"},"raw_images_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Raw Images Only","description":"Image preference. Omitted (default): return the raw card photo, falling back to the graded slab image only when no raw photo exists. true: force raw-only (no graded fallback). false: prefer the graded slab image."},"sort_by":{"type":"string","enum":["gain","gain_30day","sales","sales_7day","sales_30day","price","description"],"title":"Sort By","description":"Field to sort by: gain (7-day price change %), gain_30day (30-day price change %), sales_7day (7-day volume), sales_30day or sales (30-day volume), price (current price), description (alphabetical)","default":"gain"},"sort_order":{"type":"string","enum":["asc","desc"],"title":"Sort Order","description":"Sort order: asc (ascending) or desc (descending)","default":"desc"},"page":{"type":"integer","minimum":1.0,"title":"Page","description":"Page number, for jumping to one of the first pages; use `cursor` to page through results. Deprecated past the first 100,000 results ((page - 1) * page_size >= 100,000): those pages slow down with depth and can time out, and are served with a `deprecation` notice until 2026-11-24, when they stop working. Ignored when `cursor` is sent.","default":1},"page_size":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Page Size","description":"Number of results per page (1-100)","default":50},"cursor":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Cursor","description":"The recommended way to page. Send the previous response's `next_cursor`, with the same search, filters, sort_by and sort_order, and repeat until `next_cursor` is null. Every page costs the same at any depth, so use this to walk a whole category. Omit it for the first page."}},"type":"object","title":"CardSearchLocalRequest","description":"Request parameters for the sortable card search endpoint.","examples":[{"category":"Baseball","page_size":100,"sort_by":"description","sort_order":"asc"}]},"CardSearchRequest":{"properties":{"search":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search","description":"Search query for card name/description"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set","description":"Filter by set name (e.g., '2025 Topps Baseball')"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Filter by category (e.g., 'Baseball', 'Basketball')"},"player":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player","description":"Filter by player name"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Filter by card number within the set (exact match, e.g. '150')"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subset","description":"Filter by subset within the set (exact match, e.g. 'Base Set', 'Chrome')"},"rookie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rookie","description":"Filter by rookie status (e.g., 'Rookie')"},"page":{"type":"integer","minimum":1.0,"title":"Page","description":"Page number for pagination","default":1},"page_size":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Page Size","description":"Number of results per page (1-100)","default":50},"raw_images_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Raw Images Only","description":"Image preference. Omitted (default): return the raw card photo, falling back to the graded slab image only when no raw photo exists. true: force raw-only (no graded fallback). false: prefer the graded slab image."}},"type":"object","title":"CardSearchRequest","description":"Request parameters for card search endpoint."},"CategoryIndexHistoryRequest":{"properties":{"index":{"type":"string","maxLength":100,"title":"Index","description":"Index `slug` (from category-index-search, e.g. `baseball`) or name, case-insensitive."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"First day (YYYY-MM-DD). Default: end_date minus 365 days. A date before the index's `base_date` returns its whole history."},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Last day (YYYY-MM-DD). Default: the latest index date."},"interval":{"type":"string","enum":["daily","weekly","monthly"],"title":"Interval","description":"daily | weekly (Monday-keyed averages) | monthly (1st-of-month averages)","default":"daily"}},"type":"object","required":["index"],"title":"CategoryIndexHistoryRequest"},"CategoryIndexSearchRequest":{"properties":{"search":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Search","description":"Optional text to find in the index's name, slug or category (case-insensitive). Omit to list every index."},"category":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Category","description":"Optional exact category, case-insensitive, e.g. `Baseball`."}},"type":"object","title":"CategoryIndexSearchRequest"},"CertCompsDateRange":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date","description":"First sale date to include, inclusive, in YYYY-MM-DD format","examples":["2026-01-01"]},"end_date":{"type":"string","format":"date","title":"End Date","description":"Last sale date to include, inclusive, in YYYY-MM-DD format","examples":["2026-06-30"]}},"type":"object","required":["start_date","end_date"],"title":"CertCompsDateRange","description":"Inclusive UTC sale-date range for cert-to-comps queries."},"CertLookupRequest":{"properties":{"cert":{"type":"string","title":"Cert","description":"Certificate number to lookup","examples":["76676185"]},"grader":{"type":"string","title":"Grader","description":"Grading company (defaults to PSA)","default":"PSA","examples":["PSA"]},"days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Days","description":"Number of days of price history to retrieve (1-365, defaults to 180)","default":180,"examples":[180]}},"type":"object","required":["cert"],"title":"CertLookupRequest","description":"Request parameters for certificate lookup endpoint.","examples":[{"cert":"76676185","days":180,"grader":"PSA"}]},"CompsRequest":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Card ID"},"count":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Count","description":"Number of comp prices (1-100)"},"grade":{"type":"string","title":"Grade","description":"Card grade (e.g., 'PSA 10', 'BGS 9.5'), or 'ALL' for every grade"},"time_weighted":{"type":"boolean","title":"Time Weighted","description":"If true, weight recent sales more heavily using WMA algorithm","default":false},"include_raw_prices":{"type":"boolean","title":"Include Raw Prices","description":"If true, include raw price data in response","default":false},"offset":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Offset","description":"Optional zero-based starting position for paging through sales, newest first. Sending offset (or date_range) switches on paging: count becomes the page size, the comp is calculated over that page only, and the response adds total_count, offset, count_returned, and has_more. For the next page, add count_returned to offset. offset + count cannot exceed 10000. Omit it for the classic comp."},"date_range":{"anyOf":[{"$ref":"#/components/schemas/CertCompsDateRange"},{"type":"null"}],"description":"Optional inclusive UTC sale-date range. Switches on paging (offset defaults to 0)."},"include_venues":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":25},{"type":"null"}],"title":"Include Venues","description":"Optional. Only use sales from these venues, for example [\"ebay\", \"goldin\"]. Venue names are the price_source values on returned sales and are matched in any case: ebay, tcgplayer, fanatics (also matches pwcc), goldin, alt, pristine, starstock, myslabs, heritage, lelands. A venue with no sales simply matches nothing. The filter is applied before counting and paging, so totals, offsets and the comp cover only the sales that pass it. Omit, or send an empty list, for all venues.","examples":[["ebay","goldin"]]},"exclude_venues":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":25},{"type":"null"}],"title":"Exclude Venues","description":"Optional. Leave out sales from these venues, for example [\"goldin\"]. Can be combined with include_venues. Venue names are the price_source values on returned sales and are matched in any case: ebay, tcgplayer, fanatics (also matches pwcc), goldin, alt, pristine, starstock, myslabs, heritage, lelands. A venue with no sales simply matches nothing. The filter is applied before counting and paging, so totals, offsets and the comp cover only the sales that pass it. Omit, or send an empty list, for all venues.","examples":[["goldin"]]}},"type":"object","required":["card_id","count","grade"],"title":"CompsRequest","description":"Request schema for getting comp prices."},"FMVByCertRequest":{"properties":{"cert":{"type":"string","title":"Cert","description":"Certificate number to look up","examples":["50000000"]},"grader":{"type":"string","title":"Grader","description":"Grading company (defaults to PSA)","default":"PSA","examples":["PSA"]}},"type":"object","required":["cert"],"title":"FMVByCertRequest","description":"Request parameters for the FMV-by-certificate endpoint.","examples":[{"cert":"50000000","grader":"PSA"}]},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageCertDetailsRequest":{"properties":{"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Public URL of the graded card image"},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64","description":"Base64-encoded image of the graded card (with or without data URI prefix)"}},"type":"object","title":"ImageCertDetailsRequest","description":"Request parameters for image-based certificate details endpoint (no price history).","examples":[{"image_url":"https://example.com/graded-card.jpg"}]},"ImageCertLookupRequest":{"properties":{"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Public URL of the graded card image"},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64","description":"Base64-encoded image of the graded card (with or without data URI prefix)"},"days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Days","description":"Number of days of price history to retrieve (1-365, defaults to 180)","default":180,"examples":[180]}},"type":"object","title":"ImageCertLookupRequest","description":"Request parameters for image-based certificate lookup endpoint.","examples":[{"days":180,"image_url":"https://example.com/graded-card.jpg"}]},"ImageMatchRequest":{"properties":{"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Public URL to the card image"},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64","description":"Base64-encoded image data (data-URI prefix optional)"},"k":{"type":"integer","maximum":25.0,"minimum":1.0,"title":"K","description":"Ximilar recall breadth — number of similar cards to retrieve","default":10}},"type":"object","title":"ImageMatchRequest","description":"Request model for the image-match endpoint.","examples":[{"image_url":"https://example.com/card.jpg","k":10}]},"ImageSearchRequest":{"properties":{"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Public URL to card image"},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64","description":"Base64-encoded image data (with or without data URI prefix)"},"k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"K","description":"Number of similar results to return (max: 50)","default":10}},"type":"object","title":"ImageSearchRequest","description":"Request model for image search endpoint.","examples":[{"image_url":"https://example.com/card.jpg","k":10},{"image_base64":"data:image/jpeg;base64,/9j/4AAQSkZJRg...","k":5}]},"PlayerIndexHistoryRequest":{"properties":{"player_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Player Id","description":"Card Hedge player ID (from player-search). Alias IDs resolve to their canonical player."},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name","description":"Player name; resolves only when it matches exactly one player (else 409 with candidates)."},"category":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Category","description":"With `name` only: one category (name or slug) to tell same-named players apart."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Default: end_date minus 365 days"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Default: the latest index date"},"interval":{"type":"string","enum":["daily","weekly","monthly"],"title":"Interval","description":"daily | weekly (Monday buckets) | monthly (1st-of-month buckets)","default":"daily"}},"type":"object","title":"PlayerIndexHistoryRequest"},"PlayerIndexRequest":{"properties":{"player_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Player Id","description":"Card Hedge player ID (from player-search). Alias IDs resolve to their canonical player."},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name","description":"Player name; resolves only when it matches exactly one player (else 409 with candidates)."},"category":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Category","description":"With `name` only: one category (name or slug) to tell same-named players apart."},"include_constituents":{"type":"boolean","title":"Include Constituents","description":"Include the cards behind the index","default":true}},"type":"object","title":"PlayerIndexRequest"},"PlayerSearchRequest":{"properties":{"search":{"type":"string","maxLength":100,"minLength":2,"title":"Search","description":"Player or character name to search for (2-100 characters)"},"count":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Count","description":"Maximum number of players to return (1-100)","default":25},"category":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Category","description":"Only return players in this category (name or slug, e.g. 'Baseball' or 'yu-gi-oh'). A multi-category player matches any of its categories."}},"type":"object","required":["search"],"title":"PlayerSearchRequest","description":"Request parameters for the canonical player search endpoint."},"PriceUpdatesRequest":{"properties":{"since":{"type":"string","title":"Since","description":"ISO timestamp to fetch updates since (e.g., '2023-07-16T01:28:57.000Z')"},"ignore_grades":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ignore Grades","description":"List of grades to exclude from results (e.g., ['Raw'])"}},"type":"object","required":["since"],"title":"PriceUpdatesRequest","description":"Request parameters for price updates endpoint."},"PricesByCardRequest":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier","examples":["1587446850514x224832321163624450"]},"grade":{"type":"string","title":"Grade","description":"Grade (e.g., 'PSA 9', 'BGS 9.5')","examples":["PSA 9"]},"days":{"type":"integer","maximum":366.0,"minimum":1.0,"title":"Days","description":"Length of the price window in days (1-366, defaults to 180). 366 is allowed so a single window can cover a full leap year.","default":180,"examples":[180]},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Optional end of the price window (YYYY-MM-DD, inclusive). Defaults to today. Set it in the past to retrieve history older than one year by paging windows back in time, e.g. days=365 with end_date=2025-12-31, then days=366 with end_date=2024-12-31 (leap year), and so on. The window covers (end_date - days, end_date].","examples":["2024-12-31"]}},"type":"object","required":["card_id","grade"],"title":"PricesByCardRequest","description":"Request parameters for prices by card endpoint.","examples":[{"card_id":"1587446850514x224832321163624450","days":180,"grade":"PSA 9"}]},"SalesBySearchRequest":{"properties":{"query":{"type":"string","maxLength":500,"minLength":3,"title":"Query","description":"sales-by-search is not a general free-text search. Use card identifiers to specify one card: player/character, set/product, card number and variant where applicable. Put the grade in the grade field. The card does not need to exist in the Card Hedge catalog. Sports searches require a four-digit release year or season, such as 2025 or 2023-24. Non-sports searches do not require a year. TCG searches require a card number, such as #4, 4/102, or OP01-001.","examples":["2018 Panini Prizm Luka Doncic #280 Silver"]},"grade":{"type":"string","maxLength":50,"minLength":1,"title":"Grade","description":"Exact grade to return, such as PSA 10, BGS 9.5, or Raw.","examples":["PSA 10","Raw"]},"last_n":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Last N","description":"Number of newest matching sales to return. This operation is available only to Enterprise API keys and paid Agent API calls; eligible callers may request 1-20. When omitted, it defaults to 10."},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Optional card category used by card-match, such as Basketball or Pokemon. Supply this when the text does not clearly identify sports versus non-sports; non-sports searches do not require a year. Listed TCG names, including Pokemon, Lorcana and Yu-Gi-Oh, require a card number. Names are matched case-insensitively, including documented accent, spacing and hyphen variants."}},"type":"object","required":["query","grade"],"title":"SalesBySearchRequest","description":"Find the newest clean sales for a text-described card and grade."},"SalesStatsByPlayerRequest":{"properties":{"players":{"items":{"type":"string"},"type":"array","maxItems":25,"minItems":1,"title":"Players","description":"Player or character names to look up. Each name is matched against the sale description text. Up to 25 names per request."},"interval":{"type":"string","enum":["day","week","month"],"title":"Interval","description":"Bucket size. `day` = midnight-to-midnight UTC, `week` = ISO week (Monday → Sunday), `month` = calendar month (1st → last day).","default":"week"},"periods":{"type":"integer","minimum":1.0,"title":"Periods","description":"Total number of buckets to return, ending with the most recent period. When `include_current` is true (default) the newest bucket is the in-progress period and counts toward this total. Caps per interval: day ≤ 90, week ≤ 52, month ≤ 24.","default":12},"include_current":{"type":"boolean","title":"Include Current","description":"When true (default), the newest bucket is the in-progress current period (month-to-date, week-to-date, or today so far) and is flagged `partial: true`. Set false to return only fully-closed periods — preferred for clean trend charts.","default":true}},"type":"object","required":["players"],"title":"SalesStatsByPlayerRequest"},"SetSearchRequest":{"properties":{"search":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search","description":"Search query for set name"},"category":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Category","description":"Filter by category (e.g., 'Baseball', 'Basketball', 'Pokemon')"},"count":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Count","description":"Number of results to return (1-100)","default":25},"page":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Page","description":"1-based page number. Sending page, sort or brand_id switches to paged mode (adds total_count, page, has_more)."},"sort":{"anyOf":[{"type":"string","enum":["sales","name"]},{"type":"null"}],"title":"Sort","description":"Sort order in paged mode: 'sales' (30-day sales, default) or 'name'."},"brand_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Brand Id","description":"Only sets of this brand (see brand-search). Switches to paged mode."}},"type":"object","title":"SetSearchRequest","description":"Request parameters for set search endpoint.","example":{"category":"Baseball","count":100,"page":1,"sort":"name"}},"SubsetSearchRequest":{"properties":{"set_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Set Id","description":"Set identifier (send set_id or set, not both)"},"set":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Set","description":"Exact set name (send set_id or set, not both)"},"category":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Category","description":"Only subsets of sets in this category"},"search":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search","description":"Substring of the subset name (case-insensitive)"},"page":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Page","description":"1-based page number","default":1},"count":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Count","description":"Subsets per page (1-1000)","default":100}},"type":"object","title":"SubsetSearchRequest","description":"Request parameters for subset-search.","example":{"set":"2024 Topps Chrome Baseball"}},"TotalSalesByPlayerRequest":{"properties":{"players":{"items":{"type":"string"},"type":"array","maxItems":25,"minItems":1,"title":"Players","description":"List of player/character names to look up (max 25)"},"days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Days","description":"Number of days to look back (default: 30, max: 365)","default":30}},"type":"object","required":["players"],"title":"TotalSalesByPlayerRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"PlayerIndexResponse":{"properties":{"player":{"$ref":"#/components/schemas/PlayerBlock"},"resolution":{"$ref":"#/components/schemas/ResolutionBlock"},"index":{"$ref":"#/components/schemas/IndexSnapshot"},"integrity":{"$ref":"#/components/schemas/IntegrityBlock"},"constituents":{"items":{"$ref":"#/components/schemas/ConstituentBlock"},"type":"array","title":"Constituents"}},"type":"object","required":["player","resolution","index","integrity"],"title":"PlayerIndexResponse"},"PlayerBlock":{"properties":{"player_id":{"type":"string","title":"Player Id","description":"Canonical Card Hedge player ID"},"name":{"type":"string","title":"Name"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories"},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases","description":"Player IDs merged into this player"}},"type":"object","required":["player_id","name"],"title":"PlayerBlock"},"ResolutionBlock":{"properties":{"requested_player_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Player Id"},"requested_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Name"},"requested_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Category"},"resolved_via":{"type":"string","enum":["player_id","alias","name"],"title":"Resolved Via"}},"type":"object","required":["resolved_via"],"title":"ResolutionBlock"},"IndexSnapshot":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value","description":"USD: market-cap-weighted average price of the top-10 cards; null when withheld"},"as_of":{"type":"string","format":"date","title":"As Of"},"status":{"type":"string","enum":["current","stale","withheld"],"title":"Status"},"days_since_update":{"type":"integer","title":"Days Since Update"},"volume_30d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Volume 30D"},"card_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Card Count"},"changes":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/IndexChange"},{"type":"null"}]},"propertyNames":{"enum":["1d","7d","30d","90d","365d"]},"type":"object","title":"Changes"},"methodology":{"$ref":"#/components/schemas/Methodology"}},"type":"object","required":["value","as_of","status","days_since_update","changes","methodology"],"title":"IndexSnapshot"},"Methodology":{"properties":{"algorithm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Algorithm"},"base_grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Grade"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},"type":"object","title":"Methodology"},"IndexChange":{"properties":{"abs":{"type":"number","title":"Abs","description":"Change in index value (USD)"},"pct":{"type":"number","title":"Pct","description":"Percent change"}},"type":"object","required":["abs","pct"],"title":"IndexChange"},"IntegrityBlock":{"properties":{"verdict":{"type":"string","enum":["ok","warning","withheld"],"title":"Verdict"},"foreign_weight_pct":{"type":"number","title":"Foreign Weight Pct","description":"% of index weight from other players' cards"},"unknown_weight_pct":{"type":"number","title":"Unknown Weight Pct","description":"% of index weight whose card owner is unknown","default":0.0},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["verdict","foreign_weight_pct"],"title":"IntegrityBlock"},"ConstituentBlock":{"properties":{"card_id":{"type":"string","title":"Card Id"},"card_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Name"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant"},"grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grade"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"weight":{"type":"number","title":"Weight","description":"Share of the index (weights sum to 100)"},"volume_30d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Volume 30D"},"owned_by_player":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Owned By Player","description":"False when the card belongs to another player; null when unknown"}},"type":"object","required":["card_id","weight"],"title":"ConstituentBlock"},"PlayerSearchResponse":{"properties":{"count":{"type":"integer","minimum":0.0,"title":"Count","description":"Number of players returned"},"players":{"items":{"$ref":"#/components/schemas/PlayerSearchPlayer"},"type":"array","title":"Players","description":"Canonical players matching the search"}},"type":"object","required":["count"],"title":"PlayerSearchResponse","description":"Response model for canonical player search.","examples":[{"count":1,"players":[{"aliases":[],"cards_tracked":3746,"categories":["Basketball","Baseball"],"index":{"as_of":"2026-09-25","has_index":true,"status":"current"},"name":"Michael Jordan","player_id":"1585495598505x695909526016884700","thirty_day_sales":20946}]}]},"PlayerSearchPlayer":{"properties":{"player_id":{"type":"string","minLength":1,"title":"Player Id","description":"Canonical Card Hedge player ID. Duplicate player records are folded into one player; their IDs are listed in `aliases`."},"name":{"type":"string","minLength":1,"title":"Name","description":"Canonical player or character name"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories","description":"Categories the player appears in, e.g. ['Basketball', 'Baseball']"},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases","description":"Other player IDs merged into this player; requests for them resolve here"},"cards_tracked":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Cards Tracked","description":"Cards tracked for the player, summed across merged records","default":0},"thirty_day_sales":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Thirty Day Sales","description":"Sales in the last 30 days, summed across merged records","default":0},"index":{"anyOf":[{"$ref":"#/components/schemas/PlayerIndexAvailability"},{"type":"null"}],"description":"Player index availability; null when it could not be determined"}},"type":"object","required":["player_id","name"],"title":"PlayerSearchPlayer","description":"Canonical Card Hedge player metadata."},"PlayerIndexAvailability":{"properties":{"has_index":{"type":"boolean","title":"Has Index","description":"True when a cached player index exists"},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of","description":"Date of the latest index value"},"status":{"type":"string","enum":["current","stale","withheld","none"],"title":"Status","description":"`current` (updated within 2 days), `stale` (older, still served), `withheld` (mostly built from other players' cards, so not served), or `none` (no index)."}},"type":"object","required":["has_index","status"],"title":"PlayerIndexAvailability","description":"Whether Card Hedge has a servable player index for this player."},"AdditionsSummaryResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AdditionsSummaryRow"},"type":"array","title":"Data","description":"Summary rows"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Number of rows per page"}},"type":"object","required":["data","page","page_size"],"title":"AdditionsSummaryResponse","description":"Response model for the card additions summary endpoint.","examples":[{"data":[{"added_date":"2026-03-15","card_count":42,"category":"Baseball","set_name":"2024 Topps Chrome Baseball","subset":"Base Set","variants":"Base, Gold, Refractor"},{"added_date":"2026-03-14","card_count":18,"category":"Pokemon","set_name":"2024 Pokemon Prismatic Evolutions","subset":"Illustration Rare","variants":"Base"}],"page":1,"page_size":50}]},"AdditionsSummaryRow":{"properties":{"category":{"type":"string","title":"Category","description":"Card category (e.g., 'Baseball', 'Pokemon')"},"set_name":{"type":"string","title":"Set Name","description":"Card set name"},"subset":{"type":"string","title":"Subset","description":"Card subset (defaults to 'Base Set' if not specified)"},"variants":{"type":"string","title":"Variants","description":"Comma-separated list of distinct variants in this group"},"added_date":{"type":"string","format":"date","title":"Added Date","description":"Date cards were added"},"card_count":{"type":"integer","title":"Card Count","description":"Number of cards added in this group on this date"}},"type":"object","required":["category","set_name","subset","variants","added_date","card_count"],"title":"AdditionsSummaryRow","description":"A single row in the card additions summary."},"SalesBySearchResponse":{"properties":{"header":{"$ref":"#/components/schemas/SalesSearchHeader"},"query":{"type":"string","title":"Query"},"search_query_used":{"type":"string","title":"Search Query Used","description":"Primary cleaned index query; the original query is also searched when cleaning changed it. When both retrieve too few sales, one broader query (subject and card number) is also searched."},"grade":{"type":"string","title":"Grade"},"results":{"$ref":"#/components/schemas/SalesSearchResultInfo"},"exclusions":{"$ref":"#/components/schemas/SalesSearchExclusions"},"sales":{"items":{"$ref":"#/components/schemas/SalesSearchSale"},"type":"array","title":"Sales"}},"type":"object","required":["header","query","search_query_used","grade","results","exclusions"],"title":"SalesBySearchResponse","description":"Curated-or-inferred header plus newest clean sales.","examples":[{"exclusions":{"duplicate":0,"sibling_variant":2,"uncertain":0,"wrong_card":0,"wrong_grade":3,"wrong_item":0},"grade":"PSA 10","header":{"card":{"card_id":"1587446850514x224832321163624450","category":"Basketball","confidence":0.95,"description":"Luka Doncic 2018 Panini Prizm Basketball Silver","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","image":"https://images.example.com/luka-280.jpg","number":"280","player":"Luka Doncic","prices":[{"grade":"PSA 10","price":"1200"}],"reasoning":"Exact player, set, number, and variant match.","set":"2018 Panini Prizm Basketball","subset":"Base Set","variant":"Silver"},"card_match_status":"matched","source":"curated_card"},"query":"2018 Panini Prizm Luka Doncic #280 Silver","results":{"candidates_scanned":7,"classifier_mode":"enforce","complete":true,"index_exhausted":false,"requested":2,"returned":2,"scan_limit_reached":false},"sales":[{"card_id":"1587446850514x224832321163624450","grade":"PSA 10","grader":"PSA","id":"sale-1","image":"https://i.ebayimg.com/example.jpg","match_method":"curated_id","price":1150.0,"price_source":"ebay","sale_date":"2026-08-29T19:30:00.000Z","sale_type":"Auction","sale_url":"https://www.ebay.com/itm/example","title":"2018 Prizm Luka Doncic #280 Silver PSA 10"}],"search_query_used":"2018 Panini Prizm Luka Doncic #280 Silver"}]},"SalesSearchSale":{"properties":{"id":{"type":"string","title":"Id","description":"Stable price-history or index document ID"},"title":{"type":"string","title":"Title"},"sale_date":{"type":"string","title":"Sale Date","description":"Authoritative UTC sale timestamp"},"price":{"type":"number","title":"Price"},"grade":{"type":"string","title":"Grade","description":"Canonical requested grade"},"grader":{"type":"string","title":"Grader"},"price_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Source"},"sale_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sale Type"},"sale_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sale Url"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"card_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Id","description":"Indexed Card Hedge card ID when the sale is curated/linked."},"match_method":{"type":"string","enum":["curated_id","deterministic","model"],"title":"Match Method"}},"type":"object","required":["id","title","sale_date","price","grade","grader","match_method"],"title":"SalesSearchSale","description":"One sale that survived grade, item, and sibling-variant filtering."},"SalesSearchExclusions":{"properties":{"duplicate":{"type":"integer","title":"Duplicate","default":0},"wrong_grade":{"type":"integer","title":"Wrong Grade","default":0},"wrong_card":{"type":"integer","title":"Wrong Card","default":0},"sibling_variant":{"type":"integer","title":"Sibling Variant","default":0},"wrong_item":{"type":"integer","title":"Wrong Item","default":0},"uncertain":{"type":"integer","title":"Uncertain","default":0}},"type":"object","title":"SalesSearchExclusions","description":"Counts explaining how raw candidates were reduced to clean sales."},"SalesSearchHeader":{"properties":{"source":{"type":"string","enum":["curated_card","inferred"],"title":"Source"},"card_match_status":{"type":"string","enum":["matched","not_found","unavailable"],"title":"Card Match Status"},"enrichment_status":{"type":"string","enum":["validated","not_found","unavailable","timeout","rejected","disabled"],"title":"Enrichment Status","default":"unavailable"},"card":{"anyOf":[{"$ref":"#/components/schemas/CardMatchResult"},{"type":"null"}],"description":"The existing card-match result, reused without reconstructing it; null when the card is not curated or card-match is unavailable."},"inferred":{"anyOf":[{"$ref":"#/components/schemas/SalesSearchInferredIdentity"},{"type":"null"}],"description":"Fallback search identity when no curated card was resolved."}},"type":"object","required":["source","card_match_status"],"title":"SalesSearchHeader","description":"Curated card data when available, otherwise a clearly inferred identity."},"SalesSearchInferredIdentity":{"properties":{"display_name":{"type":"string","title":"Display Name","description":"Cleaned text identity searched"},"query":{"type":"string","title":"Query","description":"Original caller-supplied search text"}},"type":"object","required":["display_name","query"],"title":"SalesSearchInferredIdentity","description":"Non-catalog identity retained when card-match cannot resolve a card."},"CardMatchResult":{"properties":{"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Confidence score from 0.0 to 1.0 that this is the correct card"},"reasoning":{"type":"string","title":"Reasoning","description":"Brief explanation of why this card was selected as the best match"},"description":{"type":"string","title":"Description","description":"Full card description"},"player":{"type":"string","title":"Player","description":"Player or character name"},"set":{"type":"string","title":"Set","description":"Card set name"},"number":{"type":"string","title":"Number","description":"Card number in set"},"variant":{"type":"string","title":"Variant","description":"Card variant (e.g., 'Base', 'Reverse Foil')"},"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"image":{"type":"string","title":"Image","description":"Card image URL"},"category":{"type":"string","title":"Category","description":"Card category"},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Price information at different grades"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subset","description":"Card subset within the set (e.g. 'Base Set', 'Chrome'); null when the card has no subset"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."}},"type":"object","required":["confidence","reasoning","description","player","set","number","variant","card_id","image","category"],"title":"CardMatchResult","description":"The top matched card with confidence score."},"CardPrice":{"properties":{"grade":{"type":"string","title":"Grade","description":"Card grade (e.g., 'Raw', 'PSA 10')"},"price":{"type":"string","title":"Price","description":"Price in string format"}},"type":"object","required":["grade","price"],"title":"CardPrice","description":"Price information for a card at different grades."},"SalesSearchResultInfo":{"properties":{"requested":{"type":"integer","title":"Requested"},"returned":{"type":"integer","title":"Returned"},"candidates_scanned":{"type":"integer","title":"Candidates Scanned"},"complete":{"type":"boolean","title":"Complete","description":"True when last_n sales were returned or the index was exhausted; false when the safety scan limit was reached first."},"index_exhausted":{"type":"boolean","title":"Index Exhausted"},"scan_limit_reached":{"type":"boolean","title":"Scan Limit Reached"},"classifier_mode":{"type":"string","enum":["off","shadow","enforce"],"title":"Classifier Mode"},"coverage_complete":{"type":"boolean","title":"Coverage Complete","description":"True only when the newest required prefix is resolved without ambiguity, uncertain candidates, or a safety deadline/limit. Use this, not complete alone, for coverage guarantees.","default":false},"deadline_reached":{"type":"boolean","title":"Deadline Reached","default":false},"unresolved_candidates":{"type":"integer","minimum":0.0,"title":"Unresolved Candidates","description":"Uncertain or unfinished candidates encountered before satisfying last_n; newer qualifying sales may be missing.","default":0},"identity_ambiguous":{"type":"boolean","title":"Identity Ambiguous","description":"The query has not established a unique printing; specify year, product, card number and variant.","default":false},"partial_reasons":{"items":{"type":"string","enum":["deadline","scan_limit","unresolved_candidates","ambiguous_identity"]},"type":"array","title":"Partial Reasons"}},"type":"object","required":["requested","returned","candidates_scanned","complete","index_exhausted","scan_limit_reached","classifier_mode"],"title":"SalesSearchResultInfo"},"PricesByCardResponse":{"properties":{"prices":{"items":{"$ref":"#/components/schemas/PriceHistory"},"type":"array","title":"Prices","description":"Daily price history for the specified card and grade"}},"type":"object","required":["prices"],"title":"PricesByCardResponse","description":"Response model for prices by card endpoint.","examples":[{"prices":[{"Grade":"PSA 9","card_id":"1587446850514x224832321163624450","closing_date":"2025-10-26T23:59:00.000Z","price":"337.67"},{"Grade":"PSA 9","card_id":"1587446850514x224832321163624450","closing_date":"2025-10-25T23:59:00.000Z","price":"337.00"},{"Grade":"PSA 9","card_id":"1587446850514x224832321163624450","closing_date":"2025-10-24T23:59:00.000Z","price":"331.29"}]}]},"PriceHistory":{"properties":{"closing_date":{"type":"string","title":"Closing Date","description":"Date of the price point"},"Grade":{"type":"string","title":"Grade","description":"Card grade"},"card_id":{"type":"string","title":"Card Id","description":"Card ID"},"price":{"type":"string","title":"Price","description":"Price value"}},"type":"object","required":["closing_date","Grade","card_id","price"],"title":"PriceHistory","description":"Individual price point from CardHedge."},"CardFeedResponse":{"properties":{"cards":{"items":{"$ref":"#/components/schemas/CardFeedCard"},"type":"array","title":"Cards","description":"Cards added in [`since`, `until`), newest first (by `created_at`, then `card_id`)."},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Send as `cursor` to get the next, older page. null when this page reaches `since`: the walk is complete."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"The category this walk is filtered to; null for every category."},"since":{"type":"string","format":"date-time","title":"Since","description":"Start of the walk's window (inclusive): cards added at or after this time. The same on every page of a walk. Cards added more than 30 days ago are never returned, even when `since` is a little earlier."},"until":{"type":"string","format":"date-time","title":"Until","description":"End of the walk's window (exclusive). It trails the walk's start by two minutes, so a card still being written then is picked up by the next poll rather than skipped. When the walk is complete, send this as `since` on your next poll to get only cards added after it."}},"type":"object","required":["since","until"],"title":"CardFeedResponse","description":"One page of the new-cards feed, newest first."},"CardFeedCard":{"properties":{"description":{"type":"string","title":"Description","description":"Full card description"},"player":{"type":"string","title":"Player","description":"Player or character name"},"set":{"type":"string","title":"Set","description":"Card set name"},"number":{"type":"string","title":"Number","description":"Card number in set"},"variant":{"type":"string","title":"Variant","description":"Card variant (e.g., 'Base', 'Gold', 'Refractor')"},"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"image":{"type":"string","title":"Image","description":"Card image URL"},"category":{"type":"string","title":"Category","description":"Card category (e.g., 'Baseball', 'Pokemon')"},"category_group":{"type":"string","title":"Category Group","description":"Category group (e.g., 'Sports Cards', 'Trading Cards')"},"set_type":{"type":"string","title":"Set Type","description":"Set type"},"7 Day Sales":{"type":"integer","title":"7 Day Sales","description":"Sales volume in last 7 days"},"30 Day Sales":{"type":"integer","title":"30 Day Sales","description":"Sales volume in last 30 days"},"rookie":{"type":"boolean","title":"Rookie","description":"Whether the card is a rookie card"},"gain":{"type":"number","title":"Gain","description":"Price gain percentage (7-day)"},"gain_30day":{"type":"number","title":"Gain 30Day","description":"Price gain percentage (30-day)"},"stats_grade":{"type":"string","title":"Stats Grade","description":"Primary grade (e.g., 'PSA 10', 'BGS 9.5')"},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Price information at different grades"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subset","description":"Card subset within the set (e.g. 'Base Set', 'Chrome'); null when the card has no subset"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the card was added to the Card Hedge catalog (UTC)."}},"type":"object","required":["description","player","set","number","variant","card_id","image","category","category_group","set_type","7 Day Sales","30 Day Sales","rookie","gain","gain_30day","stats_grade","prices","created_at"],"title":"CardFeedCard","description":"A card from the feed: the search-cards-wsort card plus when it was added."},"CardSearchLocalResponse":{"properties":{"pages":{"type":"integer","title":"Pages","description":"Deprecated, kept for older integrations: use `next_cursor` (null on the last page) to tell whether more results follow. The requested page + 1 while more results follow, else the requested page; the total is not computed.","default":1,"deprecated":true},"count":{"type":"integer","title":"Count","description":"Deprecated, kept for older integrations: always 0. The total number of matching cards is not computed, to keep the query fast.","default":0,"deprecated":true},"cards":{"items":{"$ref":"#/components/schemas/CardSearchLocalCard"},"type":"array","title":"Cards","description":"List of matching cards"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Send as `cursor` in the next request (same search, filters and sort) to get the following page. null when this is the last page."},"deprecation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deprecation","description":"Set when the request used a deprecated pattern, saying what to use instead; null otherwise. Currently: page numbers past the first 100,000 results ((page - 1) * page_size >= 100,000), which stop working on 2026-11-24. Continue with this response's `next_cursor` instead."}},"type":"object","title":"CardSearchLocalResponse","description":"Response model for local card search endpoint.","examples":[{"cards":[{"30 Day Sales":187,"7 Day Sales":45,"card_id":"1587446850514x224832321163624450","category":"Baseball","category_group":"Sports Cards","description":"Shohei Ohtani 2024 Topps Chrome Baseball","gain":12.5,"gain_30day":18.3,"gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","image":"https://example.com/card.jpg","number":"150","player":"Shohei Ohtani","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"},{"grade":"Raw","price":"45.99"}],"rookie":false,"set":"2024 Topps Chrome Baseball","set_type":"Topps Chrome Baseball","stats_grade":"PSA 10","variant":"Base"}],"count":0,"next_cursor":"eyJ2IjoxLCJzIjoiZGVzY3JpcHRpb24iLCJkIjowLCJmIjoiZTJlYWM1MTY5ZDMyZDc2OCIsImsiOiJTaG9oZWkgT2h0YW5pIDIwMjQgVG9wcHMgQ2hyb21lIEJhc2ViYWxsIiwiaSI6IjE1ODc0NDY4NTA1MTR4MjI0ODMyMzIxMTYzNjI0NDUwIn0","pages":2}]},"CardSearchLocalCard":{"properties":{"description":{"type":"string","title":"Description","description":"Full card description"},"player":{"type":"string","title":"Player","description":"Player or character name"},"set":{"type":"string","title":"Set","description":"Card set name"},"number":{"type":"string","title":"Number","description":"Card number in set"},"variant":{"type":"string","title":"Variant","description":"Card variant (e.g., 'Base', 'Gold', 'Refractor')"},"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"image":{"type":"string","title":"Image","description":"Card image URL"},"category":{"type":"string","title":"Category","description":"Card category (e.g., 'Baseball', 'Pokemon')"},"category_group":{"type":"string","title":"Category Group","description":"Category group (e.g., 'Sports Cards', 'Trading Cards')"},"set_type":{"type":"string","title":"Set Type","description":"Set type"},"7 Day Sales":{"type":"integer","title":"7 Day Sales","description":"Sales volume in last 7 days"},"30 Day Sales":{"type":"integer","title":"30 Day Sales","description":"Sales volume in last 30 days"},"rookie":{"type":"boolean","title":"Rookie","description":"Whether the card is a rookie card"},"gain":{"type":"number","title":"Gain","description":"Price gain percentage (7-day)"},"gain_30day":{"type":"number","title":"Gain 30Day","description":"Price gain percentage (30-day)"},"stats_grade":{"type":"string","title":"Stats Grade","description":"Primary grade (e.g., 'PSA 10', 'BGS 9.5')"},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Price information at different grades"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subset","description":"Card subset within the set (e.g. 'Base Set', 'Chrome'); null when the card has no subset"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."}},"type":"object","required":["description","player","set","number","variant","card_id","image","category","category_group","set_type","7 Day Sales","30 Day Sales","rookie","gain","gain_30day","stats_grade","prices"],"title":"CardSearchLocalCard","description":"Card information from local database search results."},"CategoryIndexHistoryResponse":{"properties":{"index":{"$ref":"#/components/schemas/CategoryIndexInfo"},"interval":{"type":"string","enum":["daily","weekly","monthly"],"title":"Interval"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"summary":{"$ref":"#/components/schemas/CategoryIndexPeriodSummary"},"points":{"items":{"$ref":"#/components/schemas/CategoryIndexPoint"},"type":"array","title":"Points"}},"type":"object","required":["index","interval","start_date","end_date","summary","points"],"title":"CategoryIndexHistoryResponse"},"CategoryIndexInfo":{"properties":{"slug":{"type":"string","title":"Slug","description":"Stable key; pass it to category-index-history"},"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"base_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Base Date","description":"First day of the index's history"}},"type":"object","required":["slug","name"],"title":"CategoryIndexInfo"},"CategoryIndexPeriodSummary":{"properties":{"start_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Start Value"},"end_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"End Value"},"change":{"anyOf":[{"$ref":"#/components/schemas/CategoryIndexChange"},{"type":"null"}],"description":"end_value minus start_value"},"high":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"High"},"high_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"High Date"},"low":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Low"},"low_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Low Date"}},"type":"object","title":"CategoryIndexPeriodSummary","description":"The period's numbers, from the daily values whatever the interval."},"CategoryIndexChange":{"properties":{"abs":{"type":"number","title":"Abs","description":"Change in index points"},"pct":{"type":"number","title":"Pct","description":"Percent change"}},"type":"object","required":["abs","pct"],"title":"CategoryIndexChange"},"CategoryIndexPoint":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value","description":"Index level (daily) or the bucket's average"}},"type":"object","required":["date","value"],"title":"CategoryIndexPoint"},"SalesStatsByPlayerResponse":{"properties":{"interval":{"type":"string","enum":["day","week","month"],"title":"Interval","description":"Bucket size used for this response."},"periods":{"type":"integer","title":"Periods","description":"Number of buckets returned per player (matches the request)."},"results":{"items":{"$ref":"#/components/schemas/PlayerSalesStats"},"type":"array","title":"Results","description":"One entry per requested player, in request order."}},"type":"object","required":["interval","periods","results"],"title":"SalesStatsByPlayerResponse"},"PlayerSalesStats":{"properties":{"player":{"type":"string","title":"Player","description":"Player or character name searched."},"buckets":{"items":{"$ref":"#/components/schemas/SalesStatsBucket"},"type":"array","title":"Buckets","description":"Buckets ordered oldest to newest."}},"type":"object","required":["player","buckets"],"title":"PlayerSalesStats"},"SalesStatsBucket":{"properties":{"start":{"type":"string","title":"Start","description":"Bucket start date in UTC, inclusive (YYYY-MM-DD)."},"end":{"type":"string","title":"End","description":"Bucket end date in UTC, inclusive (YYYY-MM-DD). For a partial bucket this is today's date."},"count":{"type":"integer","title":"Count","description":"Number of sales matching the player in this bucket window."},"total_amount":{"type":"number","title":"Total Amount","description":"Sum of sale prices in USD across all matching sales."},"average_sale":{"type":"number","title":"Average Sale","description":"Arithmetic mean sale price in USD (sum ÷ count). Returns 0 when `count` is 0."},"partial":{"type":"boolean","title":"Partial","description":"True only for the in-progress current bucket. Always false for fully-closed historical buckets.","default":false}},"type":"object","required":["start","end","count","total_amount","average_sale"],"title":"SalesStatsBucket"},"ImageMatchResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the search ran without error"},"best_match":{"anyOf":[{"$ref":"#/components/schemas/ImageMatchResult"},{"type":"null"}],"description":"The disambiguated card, or null if no confident match"},"candidates":{"items":{"$ref":"#/components/schemas/ImageMatchCandidate"},"type":"array","title":"Candidates","description":"Candidates the LLM considered — caller fallback when best_match is null"},"query_id":{"type":"string","title":"Query Id","description":"Ximilar query record ID"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Human-readable status"}},"type":"object","required":["success","query_id"],"title":"ImageMatchResponse","description":"Response model for the image-match endpoint."},"ImageMatchResult":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Full card description"},"player":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player","description":"Player or character name"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set","description":"Card set name"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Card number in set"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant","description":"Card variant"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image","description":"Card image URL"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Card category"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Latest price at the card's headline grades (and Raw), as grade/price pairs with one entry per grade -- the `prices` section card-search returns, minus its repeated Raw entry. Empty when the card has no price data."},"similarity":{"type":"string","title":"Similarity","description":"Ximilar visual similarity percentage (e.g. '95.23')"},"confidence":{"type":"number","title":"Confidence","description":"LLM confidence in the variant match (0.0-1.0)"},"reasoning":{"type":"string","title":"Reasoning","description":"Short explanation of the choice: the vision model's own words, or the match probabilities when a decisions model made the choice"}},"type":"object","required":["card_id","similarity","confidence","reasoning"],"title":"ImageMatchResult","description":"The disambiguated best-match card, with the vision LLM's verdict."},"ImageMatchCandidate":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Full card description"},"player":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player","description":"Player or character name"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set","description":"Card set name"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Card number in set"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant","description":"Card variant"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image","description":"Card image URL"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Card category"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Latest price at the card's headline grades (and Raw), as grade/price pairs with one entry per grade -- the `prices` section card-search returns, minus its repeated Raw entry. Empty when the card has no price data."},"similarity":{"type":"string","title":"Similarity","description":"Ximilar visual similarity percentage (e.g. '95.23')"}},"type":"object","required":["card_id","similarity"],"title":"ImageMatchCandidate","description":"A card considered during image-match disambiguation."},"CompsResponse":{"properties":{"comp_price":{"type":"number","title":"Comp Price","description":"Calculated comparable price (after anomaly filtering)"},"high":{"type":"number","title":"High","description":"Highest sale price used in comp calculation"},"low":{"type":"number","title":"Low","description":"Lowest sale price used in comp calculation"},"raw_high":{"type":"number","title":"Raw High","description":"Highest unfiltered sale price fetched for this comp request"},"raw_low":{"type":"number","title":"Raw Low","description":"Lowest unfiltered sale price fetched for this comp request"},"count_requested":{"type":"integer","title":"Count Requested","description":"Number of prices requested"},"count_used":{"type":"integer","title":"Count Used","description":"Number of prices used in calculation (after anomaly filtering)"},"time_weighted":{"type":"boolean","title":"Time Weighted","description":"Whether time-weighted algorithm was used"},"raw_prices":{"anyOf":[{"items":{"$ref":"#/components/schemas/RawSale"},"type":"array"},{"type":"null"}],"title":"Raw Prices","description":"Raw price data (only included if include_raw_prices=true). When paging, this is exactly the requested page, newest first."},"total_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Count","description":"Paging only. Exact total sales matching the card, grade, and optional date range across all pages (sales from 2020-07-01 onward)"},"offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Offset","description":"Paging only. Requested zero-based starting position"},"count_returned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count Returned","description":"Paging only. Sales on this page"},"has_more":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has More","description":"Paging only. Whether another page is available; request it with offset + count_returned"},"date_range":{"anyOf":[{"$ref":"#/components/schemas/CertCompsDateRange"},{"type":"null"}],"description":"Paging only. Applied inclusive UTC sale-date range, or null"}},"type":"object","required":["comp_price","high","low","raw_high","raw_low","count_requested","count_used","time_weighted"],"title":"CompsResponse","description":"Response schema for comp prices.","examples":[{"comp_price":336.0,"count_requested":5,"count_used":5,"high":348.0,"low":325.0,"raw_high":348.0,"raw_low":325.0,"raw_prices":[{"card_id":"1587446850514x224832321163624450","grade":"PSA 9","image":"[image url]","price":325.0,"price_history_id":"1761480061129x501444455762531900","price_source":"marketplace","sale_date":"2025-10-26T13:00:00.000Z","sale_type":"Best Offer","sale_url":"[sale url]","title":"[listing title]"},{"card_id":"1587446850514x224832321163624450","grade":"PSA 9","image":"[image url]","price":348.0,"price_history_id":"1761446206940x522975047258362750","price_source":"marketplace","sale_date":"2025-10-26T03:36:00.000Z","sale_type":"Auction","sale_url":"[sale url]","title":"[listing title]"}],"time_weighted":true}]},"RawSale":{"properties":{"price":{"type":"number","title":"Price","description":"Sale price in USD"},"sale_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sale Date","description":"Sale date"},"price_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Source","description":"Sale source"},"sale_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sale Url","description":"URL to sold eBay listing"}},"additionalProperties":true,"type":"object","required":["price"],"title":"RawSale","description":"Individual raw sale data."},"AllPricesByCardResponse":{"properties":{"prices":{"items":{"$ref":"#/components/schemas/GradePrice"},"type":"array","title":"Prices","description":"Latest prices across all available grades"}},"type":"object","required":["prices"],"title":"AllPricesByCardResponse","description":"Response model for all latest prices by card endpoint.","examples":[{"prices":[{"card_id":"1586414093385x612765462196125700","display_order":"-1","grade":"Raw","grader":"Raw","price":"1299.99"},{"card_id":"1586414093385x612765462196125700","display_order":"1","grade":"PSA 10","grader":"PSA","price":"16999.99"},{"card_id":"1586414093385x612765462196125700","display_order":"2","grade":"PSA 9","grader":"PSA","price":"3700.00"},{"card_id":"1586414093385x612765462196125700","display_order":"323","grade":"BGS 9.5","grader":"BGS","price":"5200.00"}]}]},"GradePrice":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"grade":{"type":"string","title":"Grade","description":"Card grade (e.g., PSA 10, BGS 9.5, Raw)"},"grader":{"type":"string","title":"Grader","description":"Grading company (e.g., PSA, BGS, SGC, CGC)"},"price":{"type":"string","title":"Price","description":"Latest price for this grade"},"display_order":{"type":"string","title":"Display Order","description":"Display order for sorting grades"}},"type":"object","required":["card_id","grade","grader","price","display_order"],"title":"GradePrice","description":"Price information for a specific grade."},"SubsetSearchResponse":{"properties":{"total_count":{"type":"integer","title":"Total Count","description":"Total matching subsets"},"page":{"type":"integer","title":"Page","description":"Page returned"},"count":{"type":"integer","title":"Count","description":"Subsets on this page"},"has_more":{"type":"boolean","title":"Has More","description":"Whether a further page exists"},"subsets":{"items":{"$ref":"#/components/schemas/SetSubset"},"type":"array","title":"Subsets","description":"Matching subsets"}},"type":"object","required":["total_count","page","count","has_more","subsets"],"title":"SubsetSearchResponse"},"SetSubset":{"properties":{"set_id":{"type":"string","title":"Set Id","description":"Set identifier"},"set":{"type":"string","title":"Set","description":"Set name"},"category":{"type":"string","title":"Category","description":"Set category"},"subset":{"type":"string","title":"Subset","description":"Subset (parallel/insert) name"},"card_count":{"type":"integer","title":"Card Count","description":"Cards in this subset"}},"type":"object","required":["set_id","set","category","subset","card_count"],"title":"SetSubset"},"CategoryIndexSearchResponse":{"properties":{"count":{"type":"integer","title":"Count"},"indexes":{"items":{"$ref":"#/components/schemas/CategoryIndexItem"},"type":"array","title":"Indexes"}},"type":"object","required":["count","indexes"],"title":"CategoryIndexSearchResponse"},"CategoryIndexItem":{"properties":{"slug":{"type":"string","title":"Slug","description":"Stable key; pass it to category-index-history"},"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"base_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Base Date","description":"First day of the index's history"},"latest":{"anyOf":[{"$ref":"#/components/schemas/CategoryIndexLatest"},{"type":"null"}],"description":"Null when the index has no values yet"},"changes":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/CategoryIndexChange"},{"type":"null"}]},"propertyNames":{"enum":["1d","7d","30d","90d","180d","365d"]},"type":"object","title":"Changes","description":"Change from N days before `as_of`; null when there is no value to compare with"}},"type":"object","required":["slug","name","latest","changes"],"title":"CategoryIndexItem"},"CategoryIndexLatest":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value","description":"Index level on `as_of`, in points"},"as_of":{"type":"string","format":"date","title":"As Of","description":"The (US Eastern) day of the latest value"},"card_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Card Count","description":"Cards in the index on that day"},"cards_priced":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cards Priced","description":"Cards that had a price on that day"},"calc_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calc Version","description":"Version of the index calculation"}},"type":"object","required":["value","as_of"],"title":"CategoryIndexLatest"},"BrandSearchResponse":{"properties":{"total_count":{"type":"integer","title":"Total Count","description":"Total matching brands"},"page":{"type":"integer","title":"Page","description":"Page returned"},"count":{"type":"integer","title":"Count","description":"Brands on this page"},"has_more":{"type":"boolean","title":"Has More","description":"Whether a further page exists"},"brands":{"items":{"$ref":"#/components/schemas/Brand"},"type":"array","title":"Brands","description":"Brands, ordered by name, then id"}},"type":"object","required":["total_count","page","count","has_more","brands"],"title":"BrandSearchResponse"},"Brand":{"properties":{"id":{"type":"string","title":"Id","description":"Brand identifier"},"name":{"type":"string","title":"Name","description":"Brand name"},"set_count":{"type":"integer","title":"Set Count","description":"Number of sets under this brand"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories","description":"Categories the brand has sets in"},"thirty_day_sales":{"type":"integer","title":"Thirty Day Sales","description":"Sales in the last 30 days across the brand's sets"}},"type":"object","required":["id","name","set_count","categories","thirty_day_sales"],"title":"Brand"},"PlayerIndexHistoryResponse":{"properties":{"player":{"$ref":"#/components/schemas/PlayerBlock"},"resolution":{"$ref":"#/components/schemas/ResolutionBlock"},"interval":{"type":"string","enum":["daily","weekly","monthly"],"title":"Interval"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"points":{"items":{"$ref":"#/components/schemas/HistoryPointBlock"},"type":"array","title":"Points"},"integrity":{"$ref":"#/components/schemas/IntegrityBlock"}},"type":"object","required":["player","resolution","interval","start_date","end_date","points","integrity"],"title":"PlayerIndexHistoryResponse"},"HistoryPointBlock":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"volume_30d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Volume 30D"},"card_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Card Count"},"withheld":{"type":"boolean","title":"Withheld","default":false}},"type":"object","required":["date"],"title":"HistoryPointBlock"},"CardFMVResponse":{"properties":{"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Fair market value in USD (null when no data available)"},"price_low":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Low","description":"Lower bound of the FMV range (null when no data available)"},"price_high":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price High","description":"Upper bound of the FMV range (null when no data available)"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","description":"Confidence score (0-1) for the FMV calculation"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"FMV calculation method. One of 11 values from the cascade:\n\n**Base methods (in priority order):**\n- `direct` — Exact card+grade lookup. Latest_price is replaced with a Winsorized-median FMV over a 7/15/30/90-day window when enough daily prints exist; otherwise latest_price is used as-is.\n- `card_interpolation` — No direct price; isotonic regression in log-space across the card's OTHER same-provider grades, then interpolating/extrapolating to the target grade.\n- `cross_provider` — No same-provider data; translates from another grader (e.g., BGS 9 → PSA 9) using a learned price ratio.\n- `anchor_multiplier` — Uses one same-provider grade as an anchor and applies a within-provider grade multiplier. Variants include same-provider, chained (e.g., BGS 8.5 → BGS 9 → PSA 9), and raw (Raw card price → graded). See `anchor_from_raw` / `anchor_chained_from_provider`.\n- `segment_fallback` — Last resort: uses the set/year × category baseline price and applies a grade multiplier.\n- `no_data` — No sale data could produce a value; `price` is null.\n\n**`_indexed` variants** (`direct_indexed`, `card_interpolation_indexed`, `cross_provider_indexed`, `anchor_multiplier_indexed`, `segment_fallback_indexed`) — the base method produced a stale price, so a movement index was overlaid to bring it to today. See `index_level`, `index_pct_change`, and `raw_price` for the adjustment details."},"freshness_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Freshness Days","description":"Age of the underlying sale data in days (0 = today). On `_indexed` methods this reflects the index's `as_of_date`, not the base price's age. Null on `segment_fallback` and `no_data`."},"support_grades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Support Grades","description":"Number of grade data points contributing to the estimate. 1 for `direct`; 2+ for `card_interpolation` (other grades of this card); 1 for `anchor_multiplier`; 0 for `segment_fallback` / `no_data`."},"grade_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grade Label","description":"Normalized grade label the FMV was computed for (e.g., 'PSA 9', 'BGS 9.5', 'Raw')."},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider","description":"Grading provider (e.g., 'PSA', 'BGS', 'SGC', 'CGC', 'Raw')."},"grade_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Grade Value","description":"Numeric grade value (e.g., 9.0, 9.5, 10.0). 0 for Raw; negative values denote authenticated-only grades (e.g., 'PSA Auth')."},"as_of_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Of Date","description":"ISO 8601 date the applied movement index was last computed. Set only on `_indexed` methods; null otherwise."},"index_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Index Level","description":"Cascade level used for movement adjustment. One of:\n\n- `card_grade` — most specific: this card at this grade\n- `card` — blended across all grades of this card\n- `player` — player-level index (all cards of this player)\n- `segment` — (year × category) segment-level index\n- `none` — stale price, but no index met the minimum sample threshold (an `un_indexed_penalty` is applied to confidence)\n- `null` — fresh estimate, no movement adjustment needed"},"index_pct_change":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Index Pct Change","description":"Cumulative percent change applied by the movement index over the FMV's lookback window (decimal, e.g., 0.157 = +15.7%). Set only on `_indexed` methods."},"raw_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Raw Price","description":"Pre-adjustment price in USD. For `direct`: the chosen FMV value (or the original `latest_price` when no FMV qualified). For other cascade methods: the original method result before any movement adjustment. Compare `price` vs `raw_price` to see what the movement index changed."},"index_truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Index Truncated","description":"True if the FMV's lookback window was capped at the maximum (730 days) because the underlying price was extremely stale. Treat truncated movement adjustments as lower-confidence."},"fmv_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fmv Window Days","description":"FMV smoothing window used for the base price. One of 7, 15, 30, or 90 — the upstream picks the shortest window with enough samples. Null when no FMV smoothing was applied (the lookup fell back to `card_grade_prices.latest_price`, or the method is not `direct`)."},"fmv_sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fmv Sample Count","description":"Number of distinct daily prints that fed the chosen FMV's Winsorized median. Higher = more reliable. Null when no FMV was applied."},"base_sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Sample Count","description":"Number of sales behind the base latest_price (90-day sale count on the source grade row). Only set on `direct` lookups that did NOT substitute a Winsorized-median FMV — where `fmv_sample_count` is present it describes the FMV instead. Use to tell a well-backed latest_price from a single-sale print; null means the source reported no sale count."},"index_sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Index Sample Count","description":"Number of observations at the chosen movement-index window. Useful for filtering low-signal adjustments — e.g., ignore `index_pct_change` when `index_sample_count < 10`."},"confidence_grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Grade","description":"Bucketed confidence grade — a quick proxy for the numeric `confidence`:\n\n- `A` — confidence ≥ 0.42 (~86% of prices within 2× of the actual sale). Trust for valuations.\n- `B` — confidence ≥ 0.25 (~74% within 2×). Usable; consider showing `raw_price` too.\n- `C` — confidence ≥ 0.10 (~63% within 2×). Borderline; consider falling back to `latest_price` for sensitive decisions.\n- `D` — confidence < 0.10 (~49% within 2×). Likely noisy; show with disclaimer.\n\nCutoffs are calibrated to measured accuracy on held-out sales and may be re-tuned as the model improves — rely on the letter grade rather than hard-coding numeric thresholds.\n\nNull on `no_data`. The numeric `confidence` already folds in cascade method, FMV signal strength, and movement-index quality, so this single grade reflects total trust in the returned price."},"price_explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Explanation","description":"Human-readable description of how the FMV was derived — e.g., 'Used 7d FMV ($416.25, Winsorized median of 3 daily prints) in place of latest_price $416.25. Fresh (1d) — no movement adjustment applied.' Useful for debug UIs and audit trails; not intended for programmatic parsing (wording may change)."},"cross_grade_fmv_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cross Grade Fmv Count","description":"For cross-grade methods (`card_interpolation`, `cross_provider`, `anchor_multiplier`): count of source grades whose `latest_price` was replaced with a Winsorized-median FMV before the cascade ran. Higher = more smoothing applied. Null when the method wasn't used; 0 when used but no FMV qualified for any source."}},"additionalProperties":true,"type":"object","title":"CardFMVResponse","description":"Response model for the card FMV endpoint.\n\nMirrors the upstream FMV service response. Any additional fields returned\nby the upstream are preserved via ``extra='allow'`` so consumers receive\nthe full payload even if the upstream adds new fields.","examples":[{"confidence":0.3499,"confidence_grade":"B","fmv_sample_count":3,"fmv_window_days":7,"freshness_days":1,"grade_label":"PSA 9","grade_value":9.0,"index_truncated":false,"method":"direct","price":416.25,"price_explanation":"Used 7d FMV ($416.25, Winsorized median of 3 daily prints) in place of latest_price $416.25. Fresh (1d) — no movement adjustment applied.","price_high":435.24,"price_low":397.26,"provider":"PSA","raw_price":416.25,"support_grades":1}]},"FMVByCertResponse":{"properties":{"cert_info":{"$ref":"#/components/schemas/GemRateCertInfo","description":"Certificate verification details, including the grade and card description"},"card":{"anyOf":[{"$ref":"#/components/schemas/CardDetails"},{"type":"null"}],"description":"Card details and metadata (null when the certificate could not be matched to a card)"},"fmv":{"anyOf":[{"$ref":"#/components/schemas/CardFMVResponse"},{"type":"null"}],"description":"Fair Market Value for the card at the certificate's grade. Null when the certificate could not be matched to a card; a populated object with method 'no_data' indicates the card was found but the upstream had insufficient sale data to value it."},"card_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Source","description":"How the card was resolved: 'gemrate_id' for a direct GemRate ID -> CardHedge lookup, or 'card_match' when that lookup found nothing and the card was matched from the GemRate description via the AI card-match fallback. Null when no card was resolved. Cards resolved via 'card_match' have null 'category_group' and 'set_type' -- the matcher does not return those two fields."},"match_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Match Confidence","description":"AI match confidence (0-1) when 'card_source' is 'card_match'; null otherwise. Treat an FMV derived from a low-confidence match with care."}},"type":"object","required":["cert_info"],"title":"FMVByCertResponse","description":"Response model for the FMV-by-certificate endpoint.","examples":[{"card":{"card_id":"1699670576265x928796749151534600","category":"Baseball","category_group":"Sports Cards","description":"C.C. Sabathia 1999 Bowman Chrome Baseball","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1699670857725x475053799924132860/resized_20231111_024737.jpeg","number":"344","player":"C.C. Sabathia","set":"1999 Bowman Chrome Baseball","set_type":"Bowman Chrome Baseball","variant":"Base"},"card_source":"gemrate_id","cert_info":{"cert":"50000000","description":"1999 Bowman Chrome C.C. Sabathia 344","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","grade":"PSA 10","grader":"psa","universal_gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885"},"fmv":{"confidence":0.3499,"confidence_grade":"B","fmv_sample_count":3,"fmv_window_days":7,"freshness_days":1,"grade_label":"PSA 10","grade_value":10.0,"index_truncated":false,"method":"direct","price":416.25,"price_explanation":"Used 7d FMV ($416.25, Winsorized median of 3 daily prints) in place of latest_price $416.25. Fresh (1d) — no movement adjustment applied.","price_high":435.24,"price_low":397.26,"provider":"PSA","raw_price":416.25,"support_grades":1}}]},"CardDetails":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Full card description"},"player":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player","description":"Player or character name"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set","description":"Card set name"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Card number in set"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant","description":"Card variant (e.g., Base, Refractor, Prizm)"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image","description":"Card image URL"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Card category (e.g., Baseball, Basketball, Pokemon)"},"category_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Group","description":"Category group, derived from the catalog category for indexed cards"},"set_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Type","description":"Set type, derived from the catalog set name for indexed cards"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none. Can differ from the GemRate ID of the certificate (`cert_info.gemrate_id`) or of the request (`gemrate_info.gemrate_id`), for example when the card was resolved by AI match or through a sibling ID."}},"additionalProperties":true,"type":"object","required":["card_id"],"title":"CardDetails","description":"Detailed card information and metadata."},"GemRateCertInfo":{"properties":{"grader":{"type":"string","title":"Grader","description":"Grading company (e.g., PSA, BGS, CGC)"},"cert":{"type":"string","title":"Cert","description":"Certificate number"},"grade":{"type":"string","title":"Grade","description":"Card grade (e.g., PSA 10, BGS 9.5)"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"Unique card identifier"},"universal_gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Universal Gemrate Id","description":"Universal card identifier"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Card description from certificate"}},"additionalProperties":true,"type":"object","required":["grader","cert","grade"],"title":"GemRateCertInfo","description":"Certificate verification information."},"CardSearchResponse":{"properties":{"pages":{"type":"integer","title":"Pages","description":"Total number of pages available","default":1},"count":{"type":"integer","title":"Count","description":"Total number of matching cards","default":0},"count_capped":{"type":"boolean","title":"Count Capped","description":"True when `count` is a capped value and the real total is higher (filter-only browses cap the count for performance). Render as `count`+ — e.g. \"10,000+\".","default":false},"cards":{"items":{"$ref":"#/components/schemas/CardSearchCard"},"type":"array","title":"Cards","description":"List of matching cards"}},"type":"object","required":["cards"],"title":"CardSearchResponse","description":"Response model for card search endpoint.","examples":[{"cards":[{"30 Day Sales":187,"7 Day Sales":45,"card_id":"1587446850514x224832321163624450","category":"Baseball","category_group":"Sports Cards","description":"Shohei Ohtani 2018 Topps Chrome Baseball","gain":2.5,"gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","image":"//s3.amazonaws.com/appforest_uf/example.jpg","number":"150","player":"Shohei Ohtani","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"},{"grade":"Raw","price":"45.99"}],"rookie":true,"set":"2018 Topps Chrome Baseball","set_type":"Topps Chrome Baseball","variant":"Base"}],"count":742,"pages":15}]},"CardSearchCard":{"properties":{"description":{"type":"string","title":"Description","description":"Full card description"},"player":{"type":"string","title":"Player","description":"Player or character name"},"set":{"type":"string","title":"Set","description":"Card set name"},"number":{"type":"string","title":"Number","description":"Card number in set"},"variant":{"type":"string","title":"Variant","description":"Card variant (e.g., 'Base', 'Reverse Foil')"},"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"image":{"type":"string","title":"Image","description":"Card image URL"},"category":{"type":"string","title":"Category","description":"Card category"},"category_group":{"type":"string","title":"Category Group","description":"Category group"},"set_type":{"type":"string","title":"Set Type","description":"Set type"},"7 Day Sales":{"type":"integer","title":"7 Day Sales","description":"Sales in last 7 days"},"30 Day Sales":{"type":"integer","title":"30 Day Sales","description":"Sales in last 30 days"},"rookie":{"type":"boolean","title":"Rookie","description":"Whether the card is a rookie card"},"gain":{"type":"number","title":"Gain","description":"Price gain percentage"},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Price information at different grades"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subset","description":"Card subset within the set (e.g. 'Base Set', 'Chrome'); null when the card has no subset"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."}},"type":"object","required":["description","player","set","number","variant","card_id","image","category","category_group","set_type","7 Day Sales","30 Day Sales","rookie","gain","prices"],"title":"CardSearchCard","description":"Card information from search results."},"PriceUpdatesResponse":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/PriceUpdate"},"type":"array","title":"Updates","description":"List of price updates since the specified timestamp"},"count":{"type":"integer","title":"Count","description":"Number of updates returned"}},"type":"object","required":["updates","count"],"title":"PriceUpdatesResponse","description":"Response model for price updates endpoint.","examples":[{"count":2,"updates":[{"card_desc":"James Wood 2022 Bowman Chrome Prospects Sapphire Baseball","card_id":"1669693578344x525012276222885900","card_number":"BCP-108","card_set":"2022 Bowman Chrome Prospects Sapphire Baseball","grade":"PSA 9","player":"James Wood","price":"53.88","sale_date":"2023-07-15","update_timestamp":"2023-07-16T01:29:01.227Z","variant":"Base"},{"card_desc":"James Wood 2022 Bowman Chrome Prospects Sapphire Baseball","card_id":"1669693578344x525012276222885900","card_number":"BCP-108","card_set":"2022 Bowman Chrome Prospects Sapphire Baseball","grade":"PSA 10","player":"James Wood","price":"116.5","sale_date":"2023-07-15","update_timestamp":"2023-07-16T01:29:02.774Z","variant":"Base"}]}]},"PriceUpdate":{"properties":{"price":{"type":"string","title":"Price","description":"Sale price"},"sale_date":{"type":"string","title":"Sale Date","description":"Date of the sale (YYYY-MM-DD)"},"grade":{"type":"string","title":"Grade","description":"Card grade (e.g., 'PSA 9', 'PSA 10', 'Raw')"},"card_desc":{"type":"string","title":"Card Desc","description":"Full card description"},"card_set":{"type":"string","title":"Card Set","description":"Card set name"},"card_number":{"type":"string","title":"Card Number","description":"Card number in set"},"player":{"type":"string","title":"Player","description":"Player or character name"},"variant":{"type":"string","title":"Variant","description":"Card variant"},"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"update_timestamp":{"type":"string","title":"Update Timestamp","description":"Timestamp when the price was updated (ISO format)"}},"type":"object","required":["price","sale_date","grade","card_desc","card_set","card_number","player","variant","card_id","update_timestamp"],"title":"PriceUpdate","description":"Individual price update from the delta poll API."},"CertLookupResponse":{"properties":{"cert_info":{"$ref":"#/components/schemas/GemRateCertInfo","description":"Certificate verification details including grade and card description"},"card":{"anyOf":[{"$ref":"#/components/schemas/CardDetails"},{"type":"null"}],"description":"Card details and metadata (null if not found in database)"},"prices":{"items":{"$ref":"#/components/schemas/PriceHistory"},"type":"array","title":"Prices","description":"Daily price history for the card"},"card_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Source","description":"How the card was resolved: 'gemrate_id' for a direct GemRate ID -> CardHedge lookup, or 'card_match' when that lookup found nothing and the card was matched from the GemRate description via the AI card-match fallback. Null when no card was resolved. Cards resolved via 'card_match' have null 'category_group' and 'set_type' -- the matcher does not return those two fields."},"match_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Match Confidence","description":"AI match confidence (0-1) when 'card_source' is 'card_match'; null otherwise. Treat results derived from a low-confidence match with care."}},"type":"object","required":["cert_info"],"title":"CertLookupResponse","description":"Response model for certificate lookup endpoint.","examples":[{"card":{"card_id":"1699670576265x928796749151534600","category":"Baseball","category_group":"Sports Cards","description":"C.C. Sabathia 1999 Bowman Chrome Baseball","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","image":"https://942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1699670857725x475053799924132860/resized_20231111_024737.jpeg","number":"344","player":"C.C. Sabathia","set":"1999 Bowman Chrome Baseball","set_type":"Bowman Chrome Baseball","variant":"Base"},"cert_info":{"cert":"50000000","description":"1999 Bowman Chrome C.C. Sabathia 344","gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885","grade":"PSA 10","grader":"psa","universal_gemrate_id":"25783324b9710f1366ca4d54f3dd4689c02b6885"},"prices":[{"Grade":"PSA 10","card_id":"1699670576265x928796749151534600","closing_date":"2025-10-26T23:59:00.000Z","price":"125.50"},{"Grade":"PSA 10","card_id":"1699670576265x928796749151534600","closing_date":"2025-10-25T23:59:00.000Z","price":"122.00"}]}]},"SetSearchResponse":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of sets returned"},"sets":{"items":{"$ref":"#/components/schemas/SetSearchSet"},"type":"array","title":"Sets","description":"List of matching sets"},"total_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Count","description":"Total matching sets (paged mode only)"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page","description":"Page returned (paged mode only)"},"has_more":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has More","description":"Whether a further page exists (paged mode only)"}},"type":"object","required":["count","sets"],"title":"SetSearchResponse","description":"Response model for set search endpoint.","examples":[{"count":3,"sets":[{"30 Day Sales":1250,"category":"Baseball","description":"2023 Topps Chrome Baseball","id":"1587446850514x224832321163624450","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815900/crop_image","name":"2023 Topps Chrome Baseball","set_type":"Topps Chrome Baseball","year":"2023"},{"30 Day Sales":2340,"category":"Baseball","description":"2024 Topps Chrome Baseball","id":"1684286084852x189232814543430100","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815901/crop_image","name":"2024 Topps Chrome Baseball","set_type":"Topps Chrome Baseball","year":"2024"},{"30 Day Sales":870,"category":"Baseball","description":"2022 Topps Chrome Baseball","id":"1699670576265x928796749151534600","image":"//942284f33c575895b4be9de571ca6e40.cdn.bubble.io/d112/f1724143874181x158765543979815902/crop_image","name":"2022 Topps Chrome Baseball","set_type":"Topps Chrome Baseball","year":"2022"}]}]},"SetSearchSet":{"properties":{"id":{"type":"string","title":"Id","description":"Unique set identifier"},"name":{"type":"string","title":"Name","description":"Set name"},"year":{"type":"string","title":"Year","description":"Set year","default":""},"set_type":{"type":"string","title":"Set Type","description":"Set type"},"description":{"type":"string","title":"Description","description":"Set description"},"category":{"type":"string","title":"Category","description":"Set category"},"image":{"type":"string","title":"Image","description":"Set image URL"},"30 Day Sales":{"type":"integer","title":"30 Day Sales","description":"Sales in last 30 days"},"brand_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Id","description":"Brand identifier (paged mode only)"},"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand","description":"Brand name (paged mode only)"}},"type":"object","required":["id","name","set_type","description","category","image","30 Day Sales"],"title":"SetSearchSet","description":"Set information from search results."},"CardMatchResponse":{"properties":{"match":{"anyOf":[{"$ref":"#/components/schemas/CardMatchResult"},{"type":"null"}],"description":"Best matching card with confidence score, or null if no confident match found"},"candidates_evaluated":{"type":"integer","title":"Candidates Evaluated","description":"Number of candidate cards evaluated by the AI"},"search_query_used":{"type":"string","title":"Search Query Used","description":"The search query that was sent to the card search API"}},"type":"object","required":["candidates_evaluated","search_query_used"],"title":"CardMatchResponse","description":"Response model for AI-powered card matching.","examples":[{"candidates_evaluated":10,"match":{"card_id":"1587446850514x224832321163624450","category":"Baseball","confidence":0.95,"description":"Shohei Ohtani 2018 Topps Chrome Baseball","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","image":"//s3.amazonaws.com/appforest_uf/example.jpg","number":"150","player":"Shohei Ohtani","prices":[{"grade":"PSA 10","price":"850"},{"grade":"PSA 9","price":"125"}],"reasoning":"Exact match on player (Shohei Ohtani), year (2018), set (Topps Chrome), and variant (Base). This is the most commonly referenced version of this card.","set":"2018 Topps Chrome Baseball","variant":"Base"},"search_query_used":"Shohei Ohtani 2018 Topps Chrome"}]},"ImageSearchResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the search was successful"},"results":{"items":{"$ref":"#/components/schemas/ImageSearchResultItem"},"type":"array","title":"Results","description":"List of similar cards found"},"total_results":{"type":"integer","title":"Total Results","description":"Total number of results returned"},"query_id":{"type":"string","title":"Query Id","description":"Ximilar query record ID for tracking"},"has_cardhedge_matches":{"type":"boolean","title":"Has Cardhedge Matches","description":"Whether any results have CardHedge data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Additional information about the search"}},"type":"object","required":["success","results","total_results","query_id","has_cardhedge_matches"],"title":"ImageSearchResponse","description":"Response model for image search endpoint.","examples":[{"has_cardhedge_matches":true,"message":"Results include CardHedge data where available, AI identification as fallback","query_id":"query_abc123","results":[{"card_data":{"card_id":"1587446850514x224832321163624450","category":"Baseball","description":"Ken Griffey Jr. 1989 Upper Deck Baseball","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","image":"https://example.com/card.jpg","number":"1","player":"Ken Griffey Jr.","set":"1989 Upper Deck Baseball","variant":"Rookie Card"},"distance":0.0477,"product_id":"1587446850514x224832321163624450","similarity":"95.23","ximilar_id":"xim_abc123"}],"success":true,"total_results":5}]},"ImageSearchResultItem":{"properties":{"similarity":{"type":"string","title":"Similarity","description":"Similarity percentage (e.g., '95.23')"},"distance":{"type":"number","title":"Distance","description":"Distance score from Ximilar (0-1, lower is better)"},"ximilar_id":{"type":"string","title":"Ximilar Id","description":"Ximilar record ID"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id","description":"CardHedge product ID if available"},"card_data":{"anyOf":[{"$ref":"#/components/schemas/CardData"},{"type":"null"}],"description":"Full card data from CardHedge"},"ai_fallback_info":{"anyOf":[{"$ref":"#/components/schemas/AIFallbackInfo"},{"type":"null"}],"description":"AI fallback identification when no CardHedge match"}},"type":"object","required":["similarity","distance","ximilar_id"],"title":"ImageSearchResultItem","description":"Individual image search result.","examples":[{"card_data":{"card_id":"1587446850514x224832321163624450","category":"Baseball","category_group":"Sports Cards","description":"Ken Griffey Jr. 1989 Upper Deck Baseball","gemrate_id":"d9e385cb6805bf7fb8d1451a8b27a332ce527785","image":"https://example.com/card.jpg","number":"1","player":"Ken Griffey Jr.","prices":[{"grade":"PSA 10","price":"2450.0"},{"grade":"PSA 9","price":"380.0"},{"grade":"Raw","price":"45.0"}],"set":"1989 Upper Deck Baseball","set_type":"Upper Deck Baseball","variant":"Rookie Card"},"distance":0.0477,"product_id":"1587446850514x224832321163624450","similarity":"95.23","ximilar_id":"xim_abc123"},{"ai_fallback_info":{"card_name":"2018 Panini Prizm Luka Doncic #280 Rookie Card","card_type":"sports","confidence":87.65,"source":"ximilar"},"distance":0.1235,"similarity":"87.65","ximilar_id":"xim_xyz789"}]},"CardData":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"description":{"type":"string","title":"Description","description":"Full card description"},"player":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player","description":"Player or character name"},"set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set","description":"Card set name"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Card number in set"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant","description":"Card variant"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image","description":"Card image URL"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Card category"},"category_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Group","description":"Category group"},"set_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Type","description":"Set type"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Latest price at the card's headline grades (and Raw), as grade/price pairs with one entry per grade -- the `prices` section card-search returns, minus its repeated Raw entry. Empty when the card has no price data."}},"type":"object","required":["card_id","description"],"title":"CardData","description":"Full card data from CardHedge database."},"AIFallbackInfo":{"properties":{"card_name":{"type":"string","title":"Card Name","description":"Identified card name from AI"},"card_type":{"type":"string","title":"Card Type","description":"Card type: 'sports' or 'tcg'"},"confidence":{"type":"number","title":"Confidence","description":"Identification confidence score (0-100)"},"source":{"type":"string","title":"Source","description":"Data source identifier","default":"ximilar"}},"type":"object","required":["card_name","card_type","confidence"],"title":"AIFallbackInfo","description":"Card identification data from AI fallback (when no CardHedge match)."},"SingleCertResult":{"properties":{"cert_info":{"$ref":"#/components/schemas/GemRateCertInfo","description":"Certificate verification details including grade and card description"},"card":{"anyOf":[{"$ref":"#/components/schemas/CardDetails"},{"type":"null"}],"description":"Card details and metadata (null if not found)"},"card_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Source","description":"How the card was resolved: 'gemrate_id' for a direct GemRate ID -> CardHedge lookup, or 'card_match' when that lookup found nothing and the card was matched from the GemRate description via the AI card-match fallback. Null when no card was resolved. Cards resolved via 'card_match' have null 'category_group' and 'set_type' -- the matcher does not return those two fields."},"match_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Match Confidence","description":"AI match confidence (0-1) when 'card_source' is 'card_match'; null otherwise. Treat results derived from a low-confidence match with care."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Set to 'cert_not_found' when GemRate has no record of this certificate. Set to 'gemrate_daily_quota_exceeded' when this certificate needed an uncached GemRate lookup but the account's daily budget for such lookups was already spent (it resets at 00:00 UTC); retry after the reset. Set to 'cert_lookup_disabled' when this certificate needed a fresh GemRate lookup that this API key may not make (certificates already looked up are still served). In each case the row carries placeholder cert_info (grade 'Unknown') and no card. Null for every other row, including a placeholder row whose lookup failed for another reason (retrying it later may succeed)."}},"type":"object","required":["cert_info"],"title":"SingleCertResult","description":"Single certificate result in batch lookup."},"TopMoversResponse":{"properties":{"cards":{"items":{"$ref":"#/components/schemas/TopMoverCard"},"type":"array","title":"Cards","description":"List of top moving cards"},"total_count":{"type":"integer","title":"Total Count","description":"Total number of cards returned"},"filtered_count":{"type":"integer","title":"Filtered Count","description":"Number of cards after filtering"},"gain_threshold":{"type":"number","title":"Gain Threshold","description":"Minimum gain percentage used for filtering (default: 500%)"}},"type":"object","required":["cards","total_count","filtered_count","gain_threshold"],"title":"TopMoversResponse","description":"Response model for top movers endpoint.","examples":[{"cards":[{"30 Day Sales":45,"7 Day Sales":12,"card_id":"1587446850514x224832321163624450","category":"Baseball","category_group":"Sports Cards","description":"Shohei Ohtani 2018 Topps Chrome Baseball","gain":650.5,"image":"//s3.amazonaws.com/appforest_uf/example.jpg","number":"150","player":"Shohei Ohtani","prices":[{"grade":"PSA 10","price":"2500"},{"grade":"PSA 9","price":"850"}],"rookie":true,"set":"2018 Topps Chrome Baseball","set_type":"Topps Chrome Baseball","variant":"Refractor"}],"filtered_count":1,"gain_threshold":500.0,"total_count":50}]},"TopMoverCard":{"properties":{"description":{"type":"string","title":"Description","description":"Full card description"},"player":{"type":"string","title":"Player","description":"Player or character name"},"set":{"type":"string","title":"Set","description":"Card set name"},"number":{"type":"string","title":"Number","description":"Card number in set"},"variant":{"type":"string","title":"Variant","description":"Card variant (e.g., 'Reverse Foil')"},"card_id":{"type":"string","title":"Card Id","description":"Unique card identifier"},"image":{"type":"string","title":"Image","description":"Card image URL"},"category":{"type":"string","title":"Category","description":"Card category"},"category_group":{"type":"string","title":"Category Group","description":"Category group"},"set_type":{"type":"string","title":"Set Type","description":"Set type"},"7 Day Sales":{"type":"integer","title":"7 Day Sales","description":"Sales in last 7 days"},"30 Day Sales":{"type":"integer","title":"30 Day Sales","description":"Sales in last 30 days"},"rookie":{"type":"boolean","title":"Rookie","description":"Whether the card is a rookie card"},"gain":{"type":"number","title":"Gain","description":"Percentage gain"},"prices":{"items":{"$ref":"#/components/schemas/CardPrice"},"type":"array","title":"Prices","description":"Price information at different grades"},"gemrate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemrate Id","description":"GemRate ID stored on this catalog card (usually GemRate's universal ID); null when the card has none."}},"type":"object","required":["description","player","set","number","variant","card_id","image","category","category_group","set_type","7 Day Sales","30 Day Sales","rookie","gain","prices"],"title":"TopMoverCard","description":"Card information for top movers endpoint."},"TotalSalesByPlayerResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/PlayerSalesResult"},"type":"array","title":"Results"},"days":{"type":"integer","title":"Days","description":"Number of days looked back"}},"type":"object","required":["results","days"],"title":"TotalSalesByPlayerResponse"},"PlayerSalesResult":{"properties":{"player":{"type":"string","title":"Player","description":"Player/character name searched"},"total_sales":{"type":"integer","title":"Total Sales","description":"Total number of sales found"},"search_time_ms":{"type":"integer","title":"Search Time Ms","description":"Upstream search request time in ms"}},"type":"object","required":["player","total_sales","search_time_ms"],"title":"PlayerSalesResult"}}},"servers":[{"url":"https://api.cardhedger.com","description":"Production server"}]}