Machine-readable API

Pokemon Card API OpenAPI Spec

Use the OpenAPI document as the source of truth for paths, parameters, schemas, authentication, and error handling.

Endpoint

GET /openapi.json

curl "https://api.poketrace.com/v1/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.
Format
OpenAPI JSON

Compatible with common generators and validators.

Auth
X-API-Key

Protected endpoints document the required header.

AI resources
llms.txt + catalog

Use with agent markdown and API catalog routes.

Parameters

Machine-Readable Resources

/v1/openapi.json
JSON

OpenAPI contract for REST endpoints.

https://api.poketrace.com/v1/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.cardmarket_unsold.PSA_10.country.DE

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

Generate TypeScript types

bash
npm install -D openapi-typescript
npx openapi-typescript https://api.poketrace.com/v1/openapi.json -o src/generated/poketrace-api.d.ts

Minimal authenticated request

javascript
const card = await fetch("https://api.poketrace.com/v1/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/v1/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.