Get started
Quickstart
Create an access token and read your first page of cards in three steps.
Choose one example: cURL with jq, Node.js 22+, or Python 3 with requests. Set the three environment variables below before running it.
Configure your credentials
Keep the Client Secret on your server — in your shell or secret manager, never in browser code or Git.
export COLLECTALES_BASE_URL="https://api.collectales.com" export COLLECTALES_CLIENT_ID="your-client-id" export COLLECTALES_CLIENT_SECRET="your-client-secret"Request an access token
Ask only for the scopes you need. Tokens expire after
expires_inseconds; request a new one then — there is no refresh token for application credentials.COLLECTALES_ACCESS_TOKEN=$(curl --fail-with-body --silent --show-error \ --request POST "$COLLECTALES_BASE_URL/oauth/token" \ --user "$COLLECTALES_CLIENT_ID:$COLLECTALES_CLIENT_SECRET" \ --data-urlencode "grant_type=client_credentials" \ --data-urlencode "scope=catalog:read" | jq -er '.access_token')const base = process.env.COLLECTALES_BASE_URL; const basic = Buffer.from( `${process.env.COLLECTALES_CLIENT_ID}:${process.env.COLLECTALES_CLIENT_SECRET}`, ).toString("base64"); const tokenResponse = await fetch(`${base}/oauth/token`, { method: "POST", headers: { authorization: `Basic ${basic}`, "content-type": "application/x-www-form-urlencoded", }, body: new URLSearchParams({ grant_type: "client_credentials", scope: "catalog:read" }), }); if (!tokenResponse.ok) throw new Error(`Token request failed: ${tokenResponse.status}`); const { access_token, expires_in } = await tokenResponse.json();import os import requests base = os.environ["COLLECTALES_BASE_URL"] response = requests.post( f"{base}/oauth/token", auth=(os.environ["COLLECTALES_CLIENT_ID"], os.environ["COLLECTALES_CLIENT_SECRET"]), data={"grant_type": "client_credentials", "scope": "catalog:read"}, timeout=10, ) response.raise_for_status() access_token = response.json()["access_token"]Read a page of cards
Send the token as a Bearer token. A response contains
dataandpage; followpage.nextCursorwhilepage.hasMoreis true.curl --fail-with-body "$COLLECTALES_BASE_URL/v1/games/one-piece/cards?limit=25" \ --header "authorization: Bearer $COLLECTALES_ACCESS_TOKEN"const cards = await fetch(`${base}/v1/games/one-piece/cards?limit=25`, { headers: { authorization: `Bearer ${access_token}` }, }); if (!cards.ok) throw new Error(`Card request failed: ${cards.status}`); const { data, page } = await cards.json(); console.log(data.length, "cards · more:", page.hasMore);cards = requests.get( f"{base}/v1/games/one-piece/cards", headers={"authorization": f"Bearer {access_token}"}, params={"limit": 25}, timeout=10, ) cards.raise_for_status() body = cards.json() print(len(body["data"]), "cards · more:", body["page"]["hasMore"])