# Search and IDs

## search

Fuzzy name search across species, sets and cards; typos are fine. Results are ranked best first and are a union, so ask for fields per type:

```graphql
{
  search(query: "charzard", limit: 5) {
    __typename
    ... on Species { nationalDex name }
    ... on Set { code name releaseDate }
    ... on Card { code name number set { name } }
  }
}
```

## resolveId

Translate an ID from another system into our records:

| `source` | `value` example | Returns |
|---|---|---|
| `tcgdex` | `sv03.5-006`, `SV2a-006` | Card or Set |
| `pokemontcg.io` | `sv3pt5-6`, `base1-4` | Card or Set |
| `tcgplayer` | `502558` (product id) | Printing(s), or a SealedProduct |
| `cardmarket` | `719448` (idProduct) | Printing(s), or a SealedProduct |

```graphql
{
  resolveId(source: "pokemontcg.io", value: "base1-4") {
    __typename
    ... on Card { code name set { name } }
  }
}
```

A marketplace ID can match several printings: TCGplayer lists normal and reverse holo under one product, for example. Over MCP, `resolve_ids` translates up to 50 IDs in one call.

## Moving from pokemontcg.io

pokemontcg.io stops serving its API on **1 March 2027**. Every pokemontcg.io set and card ID we could match (all of its sets, 20,000+ cards) is stored, so `resolveId(source: "pokemontcg.io", value: …)` maps your saved IDs to ours. `Card.externalIds` lists the reverse mapping.

## Japanese and other Asian cards in English

Asian cards keep their printed name in `name` (e.g. `リザードンex`) and carry an English one in `englishName`.
- **Where it comes from:** TCGplayer's English listing of the card (`englishNameSource: "tcgplayer"`). Otherwise it's built from the Pokémon's English name plus the card's suffix, such as ex, V or VMAX (`"derived"`). Trainer-owned Pokémon (e.g. Sabrina's Alakazam) and most Trainer cards without a TCGplayer listing have none.
- **Search:** `search` matches both names, so `search(query: "Charizard")` finds Japanese Charizards too.
- **Photos:** for Asian cards without a scan in `image`, `productImage` links to TCGplayer's photo of the card. Show its `credit` and link to `pageUrl`.
