The API is plain REST returning JSON, which makes it a clean tool for AI assistants and RAG pipelines. This page shows how to wire it up for grounded, citation-safe answers — never hallucinated prices.
Define one or two tools that map directly onto the endpoints — a search_cards tool over /v1/cards/search is enough to start. Return a trimmed projection so the model grounds on exactly the fields you want it to cite. The OpenAPI 3.1 spec can generate these tool schemas for you.
{
"name": "search_cards",
"description": "Find trading cards and their current prices by name, game, or set.",
"input_schema": {
"type": "object",
"properties": {
"q": { "type": "string", "description": "Card name to search for" },
"game": { "type": "string", "enum": ["pokemon", "pokemon-jp", "mtg", "yugioh", "onepiece", "lorcana", "swu", "fab"] },
"set": { "type": "string", "description": "Set slug, e.g. obsidian-flames" }
},
"required": ["q"]
}
}/v1/cards/search with strict filters (game, set) to pin the exact card id./v1/cards/:id for current prices, and /v1/cards/:id/history (paid plans) for trends.A system prompt that forces the model to stay inside the tool data and cite its sources:
Answer only from the data returned by the tools.
If a price field is missing or null, say "not available" — never estimate.
Always cite the source (tcgplayer / ebay), the condition or grade,
and the as_of timestamp for any price you state.
Never invent card names, sets, grades, or prices.Give the model the exact field it's quoting so answers are verifiable:
prices.raw.near_mint.tcgplayer.market — say “TCGplayer market, Near Mint”.prices.raw.near_mint.ebay.avg_7d — say “eBay 7-day average”.prices.graded.psa["10"] — say “PSA 10”.last_price_update so users know how current the figure is.See the full prices object reference for every field and what it means.
id for a normalized query so repeat questions skip the search step.last_price_update in the answer when discussing trends or recent moves.If you publish card data built on the API, keep search and assistant crawlers allowed in robots.txt — OpenAI (OAI-SearchBot, ChatGPT-User), Anthropic (ClaudeBot, Claude-User) and Perplexity (PerplexityBot) — and lead with answer-first sections that state the market, condition, and timestamp explicitly.