Machine-readable API
Pokemon Card API OpenAPI Spec
| Format | Version | Auth | AI resources |
|---|---|---|---|
OpenAPI JSON Compatible with common generators and validators. | 2.0.0 (dragonite) Codename dragonite. Paths are under /v2 and every 1.x field is still returned. | X-API-Key Protected endpoints document the required header. | llms.txt + catalog Use with agent markdown and API catalog routes. |
Endpoint
GET /v2/openapi.json
curl "https://api.poketrace.com/v2/openapi.json"Returns the machine-readable REST contract for client generation, schema validation, agent tools, and integration tests.
- The OpenAPI JSON itself is public.
- Endpoint access still follows API key, plan, and rate-limit rules documented in the spec.
- Agents should read the spec before inventing endpoint paths or field names.
Parameters
Machine-Readable Resources
/v2/openapi.json JSON | OpenAPI contract for REST endpoints. https://api.poketrace.com/v2/openapi.json |
/.well-known/api-catalog JSON | API discovery resource for crawlers and agents. https://api.poketrace.com/.well-known/api-catalog |
/llms.txt text | LLM-oriented resource index for docs and integration pages. https://poketrace.com/llms.txt |
/docs/llm-integration docs | Guidance for tool use, prompts, and agent workflows. https://poketrace.com/docs/llm-integration |
Contract Areas
paths object | Endpoint paths such as /cards, /cards/:id, /prices/:tier/history, and /listings. /cards/{id}/prices/{tier}/history |
parameters array | Path and query params with enum values, limits, and defaults. period default: 7d |
security object | API key authentication rules. X-API-Key |
Response fields
Useful Schema Signals
Fields worth reading before writing an integration or agent tool.
limit constraints schema | Use documented max/default values instead of guessing pagination behavior. history limit max 365 |
enum values schema | Use source-supported values for market, period, grader, variant, and sort. sort: sold_at_desc | price_desc |
response objects schema | Read nested price objects before naming fields in code. prices.PSA_10.EU.cardmarket_unsold.country.DE |
2.0 card fields schema | Card schemas document markets and prices, grouped by grade, then market, then source. The history path documents the optional market query parameter. prices.NEAR_MINT.US.tcgplayer |
error responses schema | Handle upgrade-required, auth, validation, and rate-limit responses explicitly. 403 UPGRADE_REQUIRED |
Integration Uses
Where the spec helps beyond documentation.
client generation workflow | Generate typed SDKs or request clients from the current contract. openapi-typescript |
contract tests workflow | Validate route params and response shapes in CI. schema snapshot |
AI tool schemas workflow | Give agents the actual endpoint contract before they call the API. function calling tools |
docs QA workflow | Check that public docs use real path names and field names. GET /cards/:id/listings |
Examples
npm install -D openapi-typescript
npx openapi-typescript https://api.poketrace.com/v2/openapi.json -o src/generated/poketrace-api.d.tsconst card = await fetch("https://api.poketrace.com/v2/cards?search=charizard&market=US", {
headers: { "X-API-Key": process.env.POKETRACE_API_KEY },
}).then((response) => response.json())Use It Before Coding
The docs pages explain workflows; the OpenAPI document gives exact path, query, response, and auth contracts for production code.
Use It for AI
AI agents should combine /openapi.json with /llms.txt and /docs/llm-integration so generated API calls use real PokeTrace routes and field names.
Use It for Drift Checks
Snapshot the OpenAPI document in CI or generate types during builds to catch route, enum, and response-shape drift before deploys.
Frequently asked questions
Where is the PokeTrace OpenAPI spec?
The public OpenAPI document is available at https://api.poketrace.com/v2/openapi.json.
Can AI tools use the OpenAPI spec?
Yes. Use it as the authoritative API contract for function calling, tool schemas, client generation, and endpoint discovery.