Skip to content
Prepaid, no subscription trap. Top up a balance and we draw the monthly fee from it.
tcggraph

Clients

The API is plain REST and GraphQL over HTTPS, so the client you already use works today. Typed first-party SDKs are on the way.

Official SDKs are not published yet.

Nothing on this page is installable from a package registry today. Everything below the fold works right now with a standard HTTP client, and the packages listed at the bottom are what we are building.

You do not need an SDK

There is no signing scheme and no connection to manage: a request is an HTTPS call with a bearer token, and the response is JSON. Each example below fetches Pokémon with at least 300 HP, 100 to a page.

TypeScript

const res = await fetch(
  "https://api.tcggraph.com/v1/cards?game=pokemon&minHp=300&limit=100",
  { headers: { Authorization: `Bearer ${process.env.TCGGRAPH_KEY}` } },
);
if (!res.ok) {
  const { error } = await res.json();
  throw new Error(`${res.status} ${error.code}: ${error.message}`);
}
const { data, meta } = await res.json();

Python

import os, requests

res = requests.get(
    "https://api.tcggraph.com/v1/cards",
    params={"game": "pokemon", "minHp": 300, "limit": 100},
    headers={"Authorization": f"Bearer {os.environ['TCGGRAPH_KEY']}"},
    timeout=10,
)
if not res.ok:
    error = res.json()["error"]
    raise RuntimeError(f"{res.status_code} {error['code']}: {error['message']}")
data = res.json()["data"]

Go

req, _ := http.NewRequest("GET", "https://api.tcggraph.com/v1/cards?game=pokemon&minHp=300&limit=100", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("TCGGRAPH_KEY"))

res, err := http.DefaultClient.Do(req)
if err != nil {
    return err
}
defer res.Body.Close()

Generate a typed client today

The GraphQL schema is printed from the one the endpoint runs. The OpenAPI document is built from the same definitions as this reference, and those are checked against the live API: every parameter, value and response field.

DocumentURL
OpenAPI 3.1, every REST endpoint, parameter and responsehttps://tcggraph.com/openapi.json
GraphQL schema (SDL)https://tcggraph.com/schema.graphql

Both are also served from https://api.tcggraph.com, with CORS open and no key. The GraphQL endpoint answers introspection too, with a key.

# TypeScript types from the OpenAPI 3.1 document
npx openapi-typescript https://tcggraph.com/openapi.json -o tcggraph.d.ts

# A Python client
pipx run openapi-python-client generate --url https://tcggraph.com/openapi.json

# GraphQL: the schema as a file, no key needed
curl -o schema.graphql https://tcggraph.com/schema.graphql
npx graphql-codegen --schema schema.graphql   # plus your documents and plugins

What we are building

These are not published. When they are, they will be generated from the same schemas, and they will share the same behaviour: retry a per-minute 429 and a 5xx honouring Retry-After, ten-second default timeouts, pagination helpers, ETag handling and errors typed after the error codes.

ClientPackageStatus
TypeScriptTyped gameData narrowing, streaming pagination.@tcggraph/sdkIn progress
PythonSync and async clients, dataclass models.tcggraphIn progress
GoContext-aware, zero third-party dependencies.github.com/tcggraph/goIn progress
Rustserde models, optional blocking feature.tcggraphIn progress
MCP serverExposes the catalog to AI agents as tools.@tcggraph/mcpIn progress

If one of these would decide it for you, say which language and we will tell you where it is in the queue rather than guessing at a date.