cardcorpus

Quickstart

CardCorpus is every Pokémon card as static JSON files. There is no key, no sign-up and no SDK to install: fetch a url, get JSON.

The basics

Base urlhttps://pokemon.cardcorpus.com/v1/
Sign-inNone. No key, no account.
From a web pageYes. Every file is served with Access-Control-Allow-Origin: *.
CachingFiles may be cached for 5 minutes (Cache-Control: public, max-age=300) and change in place as the data updates.
User-AgentPlease name your app and a way to reach you, such as MyCardApp/1.2 (+https://example.com), so we can warn you before a breaking change. Nothing is refused without one.
LicenseCC BY 4.0: use it for anything, and credit CardCorpus.
OfflineThe same files are on GitHub, with a zip of everything. See Download and license.

1. List the sets

Sets are listed a catalog at a time: english for sets released in English and other western languages, japanese, or zh-hans for Simplified Chinese. sets/english.json lists every English set in release order.

Each set has an id such as english/base-set, and that id is the only thing you need to get its cards. The first part of the id is the set's catalog.

curl https://pokemon.cardcorpus.com/v1/sets/english.json
{
  "catalog": "english",
  "setCount": 324,
  "sets": [
    {
      "id": "english/base-set",
      "catalog": "english",
      "name": "Base Set",
      "type": "expansion",
      "language": "en",
      "cardCount": 102,
      "released": { "date": "1999-01-09" },
      "code": "BS",
      "logo": "04b82b3dfb175c0fcaae417c841a2005",
      "symbol": "beaedcca965c346c6ad9fc57e07480be",
      // … 5 more fields
    },
    // … 323 more
  ]
}
200application/json, cut down here to the fields this page covers

2. Get a set's cards

Put a set's id into sets/{id}.json. One file holds the set and every card in it, in number order, so a set page is one request.

A card has what you would expect: its name, its printed number, its rarity, who drew it, when it came out and an image. It also lists its variants and its links to other prints, which you can ignore until you want them.

curl https://pokemon.cardcorpus.com/v1/sets/english/base-set.json
{
  "id": "english/base-set",
  "name": "Base Set",
  "cardCount": 102,
  "released": { "date": "1999-01-09" },
  "cards": [
    {
      "id": "4",
      "name": "Charizard",
      "number": { "printed": "4/102" },
      "rarity": "Holo Rare",
      "cardType": "pokemon",
      "language": "en",
      "credit": "Mitsuhiro Arita",
      "released": { "date": "1999-01-09" },
      "picture": { "front": { "image": "2aca2cf3e9ca6703b5edea32eb3177ea" } },
      // … 9 more fields
    },
    // … 101 more
  ],
  // … 14 more fields
}
200application/json, cut down here to one card

3. Show an image

An image is an id, not a url. Put the id into the image url at 240, 480 or 960 pixels wide:

https://img.cardcorpus.com/s1/{width}/{id}.avif

The same recipe is in index.json under pictures, so your code never has to hard-code it. More in Images.

images.js
const get = (path) =>
  fetch(`https://pokemon.cardcorpus.com/v1/${path}`).then((res) => res.json());

const { pictures } = await get("index.json");
const set = await get("sets/english/base-set.json");
const charizard = set.cards.find((c) => c.number.printed === "4/102");

// Every variant has its own image, 240, 480 or 960 px wide
for (const variant of charizard.variants.slice(0, 4)) {
  const url = pictures.sized
    .replace("{width}", "240")
    .replace("{id}", variant.picture.front.image);
  console.log(variant.name, url);
}
Prints
Unlimited
Unlimited
1st Edition
1st Edition
Shadowless
Shadowless
4th print
4th print

There is no search endpoint, because there is no server: cards/english.json is every card of a catalog in one list (about 1 MB over the wire, with one more each for japanese and zh-hans), small enough to fetch once and search in your own code.

Each row has the card's set, id, name, number and image. Open its set file when you need the rest.

search.js
const get = (path) =>
  fetch(`https://pokemon.cardcorpus.com/v1/${path}`).then((res) => res.json());

// cards/{catalog}.json is every card of a catalog in one list: fetch it once and search it
const { cards } = await get("cards/english.json");
const found = cards.filter((c) => c.name === "Umbreon ex");

console.log(found.length, "cards named Umbreon ex");
for (const card of found.slice(0, 4)) {
  console.log(card.set, card.number.printed);
}
Prints
8 cards named Umbreon ex
english/ex-unseen-forces 112/115
english/2006-world-championships-deck-eeveelutions 112/115
english/sv-black-star-promos 176
english/prismatic-evolutions 060/131

Where next

  • Cards and Sets: every field, with the ones most code needs first.
  • Variants: holo, reverse holo, 1st Edition and the rest, and how to tell them apart.
  • Links between cards: the same card in another language, its reprints, and every print of one painting.
  • Prices: daily TCGplayer and Cardmarket prices under the same ids.
  • The API reference: every file at pokemon.cardcorpus.com/v1 with its fields and a live example.