CollectalesDevelopers

Choose one example: cURL with jq, Node.js 22+, or Python 3 with requests. Set the three environment variables below before running it.

  1. 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"
  2. Request an access token

    Ask only for the scopes you need. Tokens expire after expires_in seconds; 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')
  3. Read a page of cards

    Send the token as a Bearer token. A response contains data and page; follow page.nextCursor while page.hasMore is true.

    curl --fail-with-body "$COLLECTALES_BASE_URL/v1/games/one-piece/cards?limit=25" \
      --header "authorization: Bearer $COLLECTALES_ACCESS_TOKEN"

Next steps#

Guides and real API endpoints