{
  "openapi": "3.0.3",
  "info": {
    "title": "APITCG",
    "description": "Welcome to **API TCG**. The purpose of this API is to expose the card and product data of each TCG: games, sets/expansions, products (cards, sealed, accessories), market prices and price history. It covers **21 trading card games** and is refreshed every day.\n\n![API TCG](./intro.png)\n\n## Authentication\n\nAll data endpoints require an **API key**. Getting one is free:\n\n1. Create an account at [apitcg.com/register](https://apitcg.com/register) (or sign in at [apitcg.com/login](https://apitcg.com/login)).\n2. Open the [Developer Platform](https://apitcg.com/platform) and go to **[API Key](https://apitcg.com/platform/api-key)** — your key is shown there.\n3. Send it in the `x-api-key` header on every request:\n\n```bash\ncurl 'https://api.apitcg.com/api/products?tcg=one-piece&name=luffy' \\\n  -H 'x-api-key: YOUR_API_KEY'\n```\n\nJavaScript example:\n\n```js\nconst res = await fetch(\n  'https://api.apitcg.com/api/products?tcg=one-piece&name=luffy',\n  { headers: { 'x-api-key': process.env.APITCG_API_KEY } }\n);\nconst body = await res.json();\n```\n\nYou can paste your key in the **Authentication** panel of this documentation to try endpoints live.\n\nKeep your API key secret. If it was exposed, regenerate it from the [API Key](https://apitcg.com/platform/api-key) page: the old key stops working immediately.\n\n### Authentication errors\n\n| Status | `error` in the body | Meaning |\n|--------|------|---------|\n| `401 Unauthorized` | `API key is required, register into: https://apitcg.com/platform` | The `x-api-key` header is missing. |\n| `401 Unauthorized` | `Invalid API key.` | The key does not exist, or it was regenerated. |\n| `429 Too Many Requests` | `Request limit reached for this month.` | The monthly requests of your plan are used up. See [Plans and limits](#description/plans-and-limits). |\n| `429 Too Many Requests` | `Too many requests, slow down.` | More than 300 requests in a minute. Wait the seconds in the `Retry-After` header. |\n\n## Plans and limits\n\n| Plan | Requests per month | Price |\n|------|-------------------:|------:|\n| Free | 1,000 | $0 |\n| Starter | 20,000 | $19 / month |\n| Pro | 200,000 | $99 / month |\n\n- Each request authenticated with your key counts once against your monthly requests, but only if it succeeds. Responses with an error status (`4xx` or `5xx`), such as a path that doesn't exist, an invalid parameter or a product that isn't found, don't count.\n- The counter goes back to zero on the 1st of each month at 00:00, Chile time (America/Santiago).\n- Follow your usage and change plans in the [Developer Platform](https://apitcg.com/platform/plans). Paid plans are billed monthly through PayPal.\n- On top of the monthly requests, each IP can make up to **300 requests per minute**. Every response carries the `RateLimit-Policy` and `RateLimit` headers (`limit`, `remaining`, and `reset` in seconds).\n\nNeed more? Write to [support@apitcg.com](mailto:support@apitcg.com).\n\n## Available TCGs\n\n| Name | Slug |\n|------|------|\n| Cardfight Vanguard | `cardfight-vanguard` |\n| Cyberpunk | `cyberpunk` |\n| Digimon | `digimon` |\n| Dragon Ball Super Fusion World | `dragon-ball-super-fusion-world` |\n| Dragon Ball Super Masters | `dragon-ball-super-masters` |\n| Final Fantasy TCG | `final-fantasy-tcg` |\n| Flesh and Blood | `flesh-and-blood` |\n| Gundam | `gundam` |\n| hololive | `hololive` |\n| Lorcana | `lorcana` |\n| Magic | `magic` |\n| Mitos y Leyendas | `mitos-y-leyendas` |\n| My Little Pony TCG | `my-little-pony-tcg` |\n| Naruto Card Game | `naruto-card-game` |\n| One Piece | `one-piece` |\n| Palworld | `palworld` |\n| Pokémon | `pokemon` |\n| Riftbound | `riftbound` |\n| Star Wars Unlimited | `star-wars-unlimited` |\n| Union Arena | `union-arena` |\n| Yu-Gi-Oh | `yugioh` |\n\nUse the **slug** as the `{tcg}` value in the routes (e.g. `/api/one-piece/sets`) and in the `?tcg=` filter for products.\n\nNaruto Card Game and My Little Pony TCG work a little differently: see [Game notes](#description/game-notes).\n\n## How to use\n\nSearch products by combining filters, for example:\n\n```\nGET /api/products?tcg=one-piece&type=card&name=luffy\n```\n\n- `name` matches any part of the name and ignores case (`luffy` finds `Monkey.D.Luffy`). If nothing matches, a fuzzy fallback runs and the response includes `fallback: true`.\n- With `tcg=pokemon`, or without `tcg`, `name` is more forgiving: it ignores accents, takes the words in any order (`moon roaring` finds `Roaring Moon`) and also searches the names printed in other languages, so `bramaluna` finds `Roaring Moon` too. See [Names in other languages](#description/names-in-other-languages).\n- `code` is the exact card code (`OP03-070`), case-sensitive.\n- `set` takes the set `_id` (`one-piece-pillars-of-strength`), as returned by `/api/{tcg}/sets`.\n\nThe `tcg` and `set` references come back as **full documents**, not as IDs — you do not need `populate` for them. The slug/ID of each one is its `_id`.\n\n## Prices\n\nProducts sold on TCGplayer carry their market prices in `markets.tcgplayer`, in US dollars:\n\n- `prices` — `low`, `mid`, `high` and `market` of the main printing.\n- `printing` — the printing those prices belong to (`Normal`, `Foil`, `Holofoil`, `Reverse Holofoil`, `1st Edition`…). The main printing is the first one with a market price, in that order.\n- `printings` — every printing TCGplayer sells for the product, each with its own prices. A price is `null` when TCGplayer has no data for it.\n\n```json\n\"tcgplayer\": {\n  \"id\": \"253325\",\n  \"prices\": { \"low\": 0.02, \"mid\": 0.2, \"high\": 2.2, \"market\": 0.18 },\n  \"printing\": \"Normal\",\n  \"printings\": [\n    { \"subTypeName\": \"Normal\", \"prices\": { \"low\": 0.02, \"mid\": 0.2, \"high\": 2.2, \"market\": 0.18 } },\n    { \"subTypeName\": \"Reverse Holofoil\", \"prices\": { \"low\": 0.1, \"mid\": 0.3, \"high\": 19.8, \"market\": 0.3 } }\n  ]\n}\n```\n\nPrices are refreshed every day, and each day is kept in the price history of the product (`GET /api/history-prices/{productId}`), together with the printing of that day's prices.\n\nMitos y Leyendas and My Little Pony TCG products do not carry prices: neither game is sold on TCGplayer. Neither do the Naruto Card Game previews (see [Naruto Card Game](#description/naruto-card-game)).\n\n## Product attributes\n\nApart from the fixed fields (`name`, `images`, `markets`…), every product carries an `attributes` object: a map of strings whose **keys depend on the game**. A Lorcana card has `Cost Ink` and `Lore Value`; a Magic card has `OracleText`, `P` and `T`. Values may contain light HTML (`<em>`, `<strong>`, `<br>`), because that is how the source publishes them.\n\nTwo keys are worth calling out:\n\n- **`Artist`** — on a `card`, the illustrator of the card.\n- **`Description`** — on a `card`, its rules text; on a `sealed` product, the description of the product (what the box contains, print run notes, etc.).\n\n### Artist\n\n`attributes.Artist` holds the illustrator of the card. It is filled in progressively, so **not every card has it**:\n\n- **Games that publish the artist:** `cyberpunk`, `digimon`, `flesh-and-blood`, `gundam`, `lorcana`, `magic`, `naruto-card-game` (its released cards), `one-piece`, `pokemon`, `riftbound`, `star-wars-unlimited`.\n- **Games that do not publish it:** `cardfight-vanguard`, `dragon-ball-super-fusion-world`, `dragon-ball-super-masters`, `final-fantasy-tcg`, `hololive`, `mitos-y-leyendas`, `my-little-pony-tcg`, `palworld`, `union-arena`, `yugioh`.\n\nIn `pokemon` the illustrator is checked every week against [TCGdex](https://tcgdex.dev), which fixes and completes what TCGplayer publishes. The card's TCGdex ID travels in `markets.tcgdex.id`.\n\nEven in the games that do publish it the coverage is not 100%, so treat `Artist` as an optional key: check for it before reading it.\n\nThere is no `?artist=` filter — the field travels inside `attributes`.\n\n### Sealed product descriptions\n\n`attributes.Description` on a `type: \"sealed\"` product is the description of the sealed product itself. Most of the sealed catalog already has it:\n\n```\nGET /api/products?tcg=pokemon&type=sealed&limit=1\n```\n\n```json\n{\n  \"_id\": 50733,\n  \"type\": \"sealed\",\n  \"name\": \"10th Movie Commemoration Set\",\n  \"attributes\": {\n    \"Description\": \"To commemorate the 10th Pokémon movie release in Japan, a special card album was released containing 11 cards…\"\n  }\n}\n```\n\n### Attributes from other sources\n\nTCGplayer doesn't publish some of the data that defines a card in its game. API TCG fills it in from other sources, with the same shape as the rest of `attributes` (text, with several values separated by `;`):\n\n- **`pokemon` — `RegulationMark`**, from [TCGdex](https://tcgdex.dev): the letter printed on the card that tells which Standard rotation it belongs to (`\"G\"`, `\"H\"`…). Cards printed before 2020 don't have one.\n- **`magic` — `Color` and `ManaValue`**, from [MTGJSON](https://mtgjson.com): `\"White;Blue\"` or `\"Colorless\"`, and `\"3\"`. On double-faced cards, `Color` joins the colors of both faces and `ManaValue` is the front face's.\n- **`yugioh` — `Level` or `Rank`**, from [YGOPRODeck](https://ygoprodeck.com): `Level` on monsters (`\"4\"`), `Rank` on Xyz monsters. Link monsters have neither; their `LinkRating` comes from TCGplayer.\n\nLike `Artist`, treat them as optional keys: check for them before reading them.\n\n## Names in other languages\n\nPokémon cards carry `alias`: the name printed on the card in each language, from [TCGdex](https://tcgdex.dev). `name` stays the English name that TCGplayer uses.\n\n```json\n\"alias\": {\n  \"en\": \"Roaring Moon\",\n  \"es\": \"Bramaluna\",\n  \"fr\": \"Rugit-Lune\",\n  \"de\": \"Donnersichel\",\n  \"it\": \"Lunaruggente\",\n  \"pt\": \"Lua Estrondo\"\n}\n```\n\n| Key | Language |\n|-----|----------|\n| `en` | English: the printed name, which may differ from TCGplayer's `name` |\n| `es` | Spanish (Spain) |\n| `es-mx` | Spanish (Latin America) |\n| `fr` | French |\n| `de` | German |\n| `it` | Italian |\n| `pt` | Portuguese |\n\n- Cards are printed in Latin American Spanish since Journey Together (March 2025), sometimes with another name: `Judge` is `Juez` in `es` and `Árbitro` in `es-mx`. Older cards get `es-mx` from a newer printing with the same English name.\n- Not every card was printed in every language, so any key may be missing. Japanese is not included.\n- `name` searches these names too, ignoring accents and in any word order:\n\n```\nGET /api/products?tcg=pokemon&name=bramaluna\n```\n\n## Images\n\n`images` is a list, and each entry has the same picture in three sizes: `small`, `medium` and `large`. Most pictures come from TCGplayer's CDN; the games that are not on TCGplayer use the pictures of their source. My Little Pony TCG landscape story cards carry their back as a second entry.\n\n### Silhouettes\n\nTCGplayer often lists a product before its photo. Until the photo arrives, `images` points to a **silhouette**: an SVG card drawn with the product's name, the game's logo, its set and its number.\n\n```\nhttps://api.apitcg.com/api/silhouettes/534.svg?v=da092b78b4\n```\n\n- Silhouettes are public: they need no API key and don't count against your monthly requests, so you can use the URL as is, in an `<img>` for example. They have their own limit of 1,200 requests per minute per IP.\n- The `v` parameter changes when the data the silhouette draws changes, so you can cache each URL for as long as you want.\n- When the photo arrives it replaces the silhouette and the product's `updatedAt` changes, so a sync with `updatedSince` picks it up. To tell a silhouette apart, check whether the URL contains `/api/silhouettes/`.\n\n## Game notes\n\n### Naruto Card Game\n\nBandai's new game. Next to the cards already on the market, the catalog includes the previews from official sources, and `attributes.narutoStatus` tells them apart:\n\n| `narutoStatus` | What it is | Prices |\n|----------------|------------|--------|\n| `released` | On the market and linked to TCGplayer (today, the promo cards) | From TCGplayer |\n| `demo` | Demo cards | No |\n| `artwork-preview` | Artwork previews | No |\n| `announced` | Announced cards | No |\n\n```\nGET /api/products?tcg=naruto-card-game&narutoStatus=released\n```\n\n- Previews are `type: \"card\"` products in descriptive sets that are not official expansions (`Demo cards (provisional)`, `Artwork previews (provisional)`, `Premium Card Collection vol.00 (announced)`), and carry `attributes.narutoProvisional: \"true\"`. Their data can change before release.\n- The other `naruto*` keys hold what the sources show: language, edition, text, traits and stats (`narutoHP`, `narutoPOW`, `narutoDMG`…). Values are text; lists go as JSON strings (`narutoSources`, `narutoTraits`).\n- When a preview reaches the market, its product keeps its `_id` and gets `catalogSupersededBy`: the `_id` of the market product. From then on it leaves the Naruto listings, but `GET /api/products/{id}` still returns it. Add `includeSuperseded=true` (also with `updatedSince`) to list those products and update the IDs you stored.\n\n### My Little Pony TCG\n\nKayou's My Little Pony Trading Card Game: the Friendships Begin starter decks and the Fantasy Wonderland, Discord!!!, Nightmare Night and Hearth's Warming Eve boosters. Kayou is not on TCGplayer, so every card and sealed product comes from Kayou's official site, **without prices**.\n\n- `code` and `cardNumber` hold the printed code (`BP02-C34`). A `※` marks the shining version (`※BP02-SPR24`), also flagged in `attributes.shining`.\n- Card `attributes`: `number`, `rarity`, `shining`, `orientation` (`landscape` story cards carry their back as the second image), `backImage`, `kayouId` and `source`. Names that Kayou doesn't publish come from the community wiki (`nameSource: \"wiki\"`, licensed [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)).\n- Sealed `attributes`: `productName`, `edition`, `model`, `packaging`, `dimensions`, `releaseDate` and, on boxes and packs, `packs`, `cardsPerPack` and `packComposition` (JSON).\n- Set codes are Kayou's (`BP02`, `SD01A`…), and a set's `release_date` is the first day of the month Kayou announces.\n\n## Pagination\n\n- `limit` — number of results per query (maximum `100`, default `25`).\n- `page` — the page you want to show of the total results.\n\nExample: `/api/products?tcg=pokemon&name=charizard&limit=50&page=2`\n\n`total` is the number of matching products. It is cached for up to a minute, so right after a sync it can lag slightly behind.\n\n### Syncing the whole catalog\n\nTo copy a large part of the catalog, page with a **cursor** instead of `page`: sort by `_id` and send the last `_id` you received as `afterId`. Stop when `data` comes back empty. In cursor mode `total` is `null`.\n\n```\nGET /api/products?tcg=pokemon&sortBy=_id&sortOrder=asc&limit=100&afterId=0\nGET /api/products?tcg=pokemon&sortBy=_id&sortOrder=asc&limit=100&afterId=45728\n```\n\nAfterwards, ask only for what changed since your last sync with `updatedSince` (ISO 8601):\n\n```\nGET /api/products?updatedSince=2026-10-01T00:00:00Z&sortBy=_id&sortOrder=asc&limit=100&afterId=0\n```\n\n## Data updates\n\nThe catalog follows TCGplayer and the other sources every day (Chile time, America/Santiago):\n\n| When | What |\n|------|------|\n| Daily, 00:00 | Sets: name, code and release date |\n| Daily, 00:10 | New and updated products |\n| Daily, 01:10 | Prices and price history |\n| Daily, 01:30 | Pokémon names in other languages, from TCGdex |\n| Daily, 01:40 | Magic color and mana value, from MTGJSON |\n| Daily, 01:50 | Silhouettes for products without a photo |\n| Daily, 05:00 | My Little Pony TCG, from Kayou |\n| Daily, 05:30 | Naruto Card Game previews |\n| Mondays | Card artists and sealed product descriptions |\n| Tuesdays | Pokémon illustrators and regulation marks, from TCGdex |\n| Wednesdays | Yu-Gi-Oh level and rank, from YGOPRODeck |\n\nSet codes (such as `OP03` or `OGN`) are the set abbreviations published by TCGplayer.\n\nUpcoming sets show up as soon as TCGplayer lists them, with their expected `release_date`. That date can still move until the set is out; once it has passed, it no longer changes.\n\n## Showcase\n\nList of websites people are building with API TCG:\n\n1. [tcgmatch.cl](https://tcgmatch.cl)\n2. [Search Piece](https://search-piece.vercel.app/)\n\nWant to add your site? Open a pull request on [docs.apitcg.com](https://github.com/apitcg/docs.apitcg.com).\n\n## Questions\n\nIf you have any questions, you can write to: [support@apitcg.com](mailto:support@apitcg.com)",
    "version": "1.0.0",
    "contact": {
      "name": "API TCG Support",
      "email": "support@apitcg.com"
    }
  },
  "servers": [
    {
      "url": "https://api.apitcg.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Health",
      "description": "API status"
    },
    {
      "name": "TCGs",
      "description": "Available trading card games"
    },
    {
      "name": "Sets",
      "description": "Sets/expansions within a TCG"
    },
    {
      "name": "Products",
      "description": "Products (cards, sealed products and accessories)"
    },
    {
      "name": "History Prices",
      "description": "Product price history"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Health check",
        "description": "Checks that the API is up and returns version information.",
        "operationId": "healthCheck",
        "security": [],
        "responses": {
          "200": {
            "description": "API is running correctly",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "APITCG funcionando correctamente"
                    },
                    "version": {
                      "type": "string",
                      "example": "1.0.0"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tcgs": {
      "get": {
        "tags": [
          "TCGs"
        ],
        "summary": "List all TCGs",
        "description": "Returns the list of registered trading card games. Each TCG's `_id` is its **slug**, used across the other routes.",
        "operationId": "listTcgs",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/SortBy"
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          }
        ],
        "responses": {
          "200": {
            "description": "List of TCGs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TCG"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "Number of TCGs returned (this endpoint does not paginate).",
                      "example": 19
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "_id": "one-piece",
                      "name": "One Piece",
                      "description": "One Piece Card Game",
                      "markets": {
                        "tcgplayer": {
                          "id": "68"
                        },
                        "tcgmatch": {
                          "id": "one-piece"
                        }
                      },
                      "createdAt": "2026-03-25T21:08:50.388Z",
                      "updatedAt": "2026-03-25T23:46:15.889Z"
                    },
                    {
                      "_id": "riftbound",
                      "name": "Riftbound",
                      "description": "Riftbound TCG",
                      "logo": "https://www.laughingdragonevents.com/wp-content/uploads/2025/10/Riftbound_Logo_HeroTextured_RGB.png",
                      "markets": {
                        "tcgplayer": {
                          "id": "89"
                        },
                        "tcgmatch": {
                          "id": "riftbound"
                        }
                      },
                      "createdAt": "2026-03-25T21:08:50.330Z",
                      "updatedAt": "2026-03-25T23:46:16.941Z"
                    }
                  ],
                  "total": 2
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/tcgs/{id}": {
      "get": {
        "tags": [
          "TCGs"
        ],
        "summary": "Get a TCG by ID",
        "description": "Returns a TCG by its `_id` (slug).",
        "operationId": "getTcgById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "TCG slug.",
            "schema": {
              "type": "string"
            },
            "example": "one-piece"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested TCG.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TCG"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/{tcg}/sets": {
      "get": {
        "tags": [
          "Sets"
        ],
        "summary": "List the sets of a TCG",
        "description": "Returns all sets/expansions of the given TCG.",
        "operationId": "listSets",
        "parameters": [
          {
            "$ref": "#/components/parameters/TcgSlug"
          },
          {
            "$ref": "#/components/parameters/SortBy"
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "name": "populate",
            "in": "query",
            "description": "If set to `tcg`, includes the full TCG document instead of just its ID.",
            "schema": {
              "type": "string",
              "enum": [
                "tcg"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of sets for the TCG.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Set"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "Number of sets returned (this endpoint does not paginate).",
                      "example": 12
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "_id": "riftbound-origins",
                      "name": "Origins",
                      "slug": "origins",
                      "tcg": "riftbound",
                      "code": "OGN",
                      "release_date": "2025-10-31T00:00:00.000Z",
                      "markets": {
                        "tcgplayer": {
                          "id": "24344"
                        },
                        "tcgmatch": {
                          "id": "riftbound-origins"
                        }
                      },
                      "createdAt": "2026-03-25T21:08:52.225Z",
                      "updatedAt": "2026-08-14T00:00:01.398Z"
                    }
                  ],
                  "total": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/{tcg}/sets/{id}": {
      "get": {
        "tags": [
          "Sets"
        ],
        "summary": "Get a set by ID within a TCG",
        "description": "Returns a set by its `_id` within the given TCG.",
        "operationId": "getSetById",
        "parameters": [
          {
            "$ref": "#/components/parameters/TcgSlug"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Set ID (composed slug).",
            "schema": {
              "type": "string"
            },
            "example": "riftbound-origins-proving-grounds"
          },
          {
            "name": "populate",
            "in": "query",
            "description": "If set to `tcg`, includes the full TCG document.",
            "schema": {
              "type": "string",
              "enum": [
                "tcg"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested set.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Set"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List products (cards, sealed, accessories)",
        "description": "Returns products with combinable filters. `name` matches any part of the name; if nothing matches, a fuzzy fallback search kicks in and the response includes `fallback: true`.\n\nThe `tcg` and `set` references always come back as **full documents** — you do not need `populate` for them.\n\n### Examples\n\n- Search cards by name:\n\n```\nGET /api/products?tcg=one-piece&name=luffy\n```\n\n- Search Pokémon cards by their name in another language (`alias`):\n\n```\nGET /api/products?tcg=pokemon&name=bramaluna\n```\n\n- Search by card code:\n\n```\nGET /api/products?code=OP03-070\n```\n\n- Naruto Card Game cards already on the market (not the previews):\n\n```\nGET /api/products?tcg=naruto-card-game&narutoStatus=released\n```\n\n- Cards of a TCG with pagination and sorting:\n\n```\nGET /api/products?tcg=pokemon&type=card&name=charizard&limit=50&page=2\n```\n\n- Sealed products of a TCG (their description travels in `attributes.Description`):\n\n```\nGET /api/products?tcg=riftbound&type=sealed\n```\n\n- The illustrator of a card is in `attributes.Artist`, when the game publishes it:\n\n```\nGET /api/products?tcg=lorcana&type=card&name=elsa\n```\n\n- Full catalog sync with the cursor (send the last `_id` as `afterId`):\n\n```\nGET /api/products?tcg=pokemon&sortBy=_id&sortOrder=asc&limit=100&afterId=0\n```\n\nSee [Product attributes](#description/product-attributes) for what `attributes` carries and [Prices](#description/prices) for `markets`.",
        "operationId": "listProducts",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Filter by product type. The catalog currently holds `card` and `sealed` products.",
            "schema": {
              "type": "string",
              "enum": [
                "card",
                "sealed",
                "accessory",
                "other"
              ]
            }
          },
          {
            "name": "tcg",
            "in": "query",
            "description": "Filter by TCG (slug — see the list of available TCGs).",
            "schema": {
              "type": "string"
            },
            "example": "one-piece"
          },
          {
            "name": "set",
            "in": "query",
            "description": "Filter by set: the set `_id` (e.g. `one-piece-pillars-of-strength`), as returned by `/api/{tcg}/sets`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serie",
            "in": "query",
            "description": "Filter by series (series ID). Series are not in use in the current catalog.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Search by name: ignores case and matches any part of the name (`luffy` finds `Monkey.D.Luffy`). If nothing matches, a fuzzy fallback runs and the response includes `fallback: true`. With `tcg=pokemon`, or without `tcg`, it also ignores accents, takes the words in any order and searches the Pokémon names in other languages (`bramaluna` finds `Roaring Moon`).",
            "schema": {
              "type": "string"
            },
            "example": "luffy"
          },
          {
            "name": "code",
            "in": "query",
            "description": "Exact card code, case-sensitive (e.g. `OP03-070`).",
            "schema": {
              "type": "string"
            },
            "example": "OP03-070"
          },
          {
            "name": "updatedSince",
            "in": "query",
            "description": "Only products updated since this date (ISO 8601). Combine it with `afterId` to sync only what changed.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "afterId",
            "in": "query",
            "description": "Cursor for full syncs: only products whose `_id` is greater than this value. Use it with `sortBy=_id&sortOrder=asc` and send the last `_id` you received. In cursor mode `total` comes back as `null`. See [Syncing the whole catalog](#description/syncing-the-whole-catalog).",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "example": 45728
          },
          {
            "name": "narutoStatus",
            "in": "query",
            "description": "(Naruto Card Game) Only the cards in this state: `released` (on the market), `demo`, `artwork-preview` or `announced`. Any other value returns `400`. See [Naruto Card Game](#description/naruto-card-game).",
            "schema": {
              "type": "string",
              "enum": [
                "released",
                "demo",
                "artwork-preview",
                "announced"
              ]
            },
            "example": "released"
          },
          {
            "name": "includeSuperseded",
            "in": "query",
            "description": "(Naruto Card Game) Also list the previews already replaced by their market product (`catalogSupersededBy`), which are left out by default. Accepts `true` or `false`.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "populate",
            "in": "query",
            "description": "Comma-separated references to include as full documents. Allowed values: `tcg`, `set`, `serie`. `tcg` and `set` already come populated by default, so in practice you only need this for `serie`.",
            "schema": {
              "type": "string"
            },
            "example": "serie"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/SortBy"
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "nullable": true,
                      "description": "Number of matching products, cached for up to a minute. `null` when you page with `afterId`.",
                      "example": 128
                    },
                    "fallback": {
                      "type": "boolean",
                      "description": "Present and `true` only when the partial name fallback search was used."
                    }
                  }
                },
                "examples": {
                  "card": {
                    "summary": "Card (attributes.Artist)",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "_id": 9804,
                          "type": "card",
                          "name": "Monkey.D.Luffy",
                          "tcg": {
                            "_id": "one-piece",
                            "name": "One Piece",
                            "description": "One Piece Card Game",
                            "markets": {
                              "tcgplayer": {
                                "id": "68"
                              },
                              "tcgmatch": {
                                "id": "one-piece"
                              }
                            }
                          },
                          "set": {
                            "_id": "one-piece-pillars-of-strength",
                            "name": "Pillars of Strength",
                            "slug": "pillars-of-strength",
                            "tcg": "one-piece",
                            "code": "OP03",
                            "release_date": "2023-06-30T00:00:00.000Z",
                            "markets": {
                              "tcgplayer": {
                                "id": "22890"
                              },
                              "tcgmatch": {
                                "id": "one-piece-pillars-of-strength"
                              }
                            }
                          },
                          "code": "OP03-070",
                          "images": [
                            {
                              "small": "https://tcgplayer-cdn.tcgplayer.com/product/500009_200w.jpg",
                              "medium": "https://tcgplayer-cdn.tcgplayer.com/product/500009_400w.jpg",
                              "large": "https://tcgplayer-cdn.tcgplayer.com/product/500009_in_1000x1000.jpg"
                            }
                          ],
                          "attributes": {
                            "Rarity": "R",
                            "Number": "OP03-070",
                            "Description": "[On Play] DON!! -1 <em>(You may return the specified number of DON!! cards from your field to your DON!! deck.)</em> <strong>You may trash 1 Character card with a cost of 5 from your hand</strong>: This Character gains [Rush] during this turn. <em>(This card can attack on the turn in which it is played.)</em>",
                            "Color": "Purple",
                            "CardType": "Character",
                            "Cost": "6",
                            "Power": "7000",
                            "Subtypes": "Straw Hat Crew;Water Seven",
                            "Attribute": "Strike",
                            "Artist": "Nekobayashi"
                          },
                          "markets": {
                            "tcgplayer": {
                              "id": "500009",
                              "url": "https://www.tcgplayer.com/product/500009/one-piece-card-game-pillars-of-strength-monkeydluffy",
                              "prices": {
                                "low": 0.12,
                                "mid": 0.31,
                                "high": 100,
                                "market": 0.25
                              },
                              "printing": "Foil",
                              "printings": [
                                {
                                  "subTypeName": "Foil",
                                  "prices": {
                                    "low": 0.12,
                                    "mid": 0.31,
                                    "high": 100,
                                    "market": 0.25
                                  }
                                }
                              ]
                            }
                          },
                          "createdAt": "2026-03-25T22:37:10.800Z",
                          "updatedAt": "2026-10-18T04:11:47.502Z"
                        }
                      ],
                      "total": 3
                    }
                  },
                  "sealed": {
                    "summary": "Sealed product (attributes.Description)",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "_id": 50733,
                          "type": "sealed",
                          "name": "10th Movie Commemoration Set",
                          "tcg": {
                            "_id": "pokemon",
                            "name": "Pokémon",
                            "description": "Pokémon TCG",
                            "markets": {
                              "tcgplayer": {
                                "id": "3"
                              },
                              "tcgmatch": {
                                "id": "pokemon"
                              }
                            }
                          },
                          "set": {
                            "_id": "pokemon-miscellaneous-cards-products",
                            "name": "Miscellaneous Cards & Products",
                            "slug": "miscellaneous-cards-products",
                            "tcg": "pokemon",
                            "code": "MCAP",
                            "markets": {
                              "tcgplayer": {
                                "id": "2374"
                              },
                              "tcgmatch": {
                                "id": "pokemon-miscellaneous-cards-products"
                              }
                            }
                          },
                          "images": [
                            {
                              "small": "https://tcgplayer-cdn.tcgplayer.com/product/266002_200w.jpg",
                              "medium": "https://tcgplayer-cdn.tcgplayer.com/product/266002_400w.jpg",
                              "large": "https://tcgplayer-cdn.tcgplayer.com/product/266002_in_1000x1000.jpg"
                            }
                          ],
                          "attributes": {
                            "Description": "<strong>Please Note: The product you receive will be in Japanese. Japanese cards from this product are <em>Not Tournament Legal</em> in English Pokemon TCG Tournaments.</strong>\r\n<br><br>To commemorate the 10th Pokémon movie release in Japan, a special card album was released containing 11 cards with central Pokémon from the previous nine movies.",
                            "CardText": "<strong>Please Note: The product you receive will be in Japanese. Japanese cards from this product are <em>Not Tournament Legal</em> in English Pokemon TCG Tournaments.</strong>\r\n<br><br>To commemorate the 10th Pokémon movie release in Japan, a special card album was released containing 11 cards with central Pokémon from the previous nine movies."
                          },
                          "markets": {
                            "tcgplayer": {
                              "id": "266002",
                              "url": "https://www.tcgplayer.com/product/266002/pokemon-miscellaneous-cards-and-products-"
                            }
                          },
                          "createdAt": "2026-03-25T22:39:10.966Z",
                          "updatedAt": "2026-08-14T00:17:55.139Z"
                        }
                      ],
                      "total": 4740
                    }
                  },
                  "pokemon-card": {
                    "summary": "Pokémon card (printings, TCGdex and alias)",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "_id": 45728,
                          "type": "card",
                          "name": "Drakloak",
                          "tcg": {
                            "_id": "pokemon",
                            "name": "Pokémon",
                            "description": "Pokémon TCG",
                            "markets": {
                              "tcgplayer": {
                                "id": "3"
                              },
                              "tcgmatch": {
                                "id": "pokemon"
                              }
                            }
                          },
                          "set": {
                            "_id": "pokemon-swsh08-fusion-strike",
                            "name": "SWSH08: Fusion Strike",
                            "tcg": "pokemon",
                            "code": "SWSH08",
                            "markets": {
                              "tcgplayer": {
                                "id": "2906"
                              },
                              "tcgmatch": {
                                "id": "pokemon-swsh08-fusion-strike"
                              }
                            },
                            "slug": "swsh08-fusion-strike",
                            "serie": null,
                            "release_date": "2021-11-12T00:00:00.000Z"
                          },
                          "images": [
                            {
                              "small": "https://tcgplayer-cdn.tcgplayer.com/product/253325_200w.jpg",
                              "medium": "https://tcgplayer-cdn.tcgplayer.com/product/253325_400w.jpg",
                              "large": "https://tcgplayer-cdn.tcgplayer.com/product/253325_in_1000x1000.jpg"
                            }
                          ],
                          "markets": {
                            "tcgplayer": {
                              "id": "253325",
                              "url": "https://www.tcgplayer.com/product/253325/pokemon-swsh08-fusion-strike-drakloak",
                              "prices": {
                                "low": 0.02,
                                "mid": 0.2,
                                "high": 2.2,
                                "market": 0.18
                              },
                              "printing": "Normal",
                              "printings": [
                                {
                                  "subTypeName": "Normal",
                                  "prices": {
                                    "low": 0.02,
                                    "mid": 0.2,
                                    "high": 2.2,
                                    "market": 0.18
                                  }
                                },
                                {
                                  "subTypeName": "Reverse Holofoil",
                                  "prices": {
                                    "low": 0.1,
                                    "mid": 0.3,
                                    "high": 19.8,
                                    "market": 0.3
                                  }
                                }
                              ]
                            },
                            "tcgdex": {
                              "id": "swsh8-129"
                            }
                          },
                          "code": "129/264",
                          "attributes": {
                            "Number": "129/264",
                            "Rarity": "Uncommon",
                            "Card Type": "Psychic",
                            "HP": "90",
                            "Stage": "Stage 1",
                            "Attack 1": "[P] Spooky Shot (20)",
                            "Weakness": "Dx2",
                            "Artist": "HYOGONOSUKE",
                            "RegulationMark": "E"
                          },
                          "alias": {
                            "en": "Drakloak",
                            "es": "Drakloak",
                            "fr": "Dispareptil",
                            "de": "Phandra",
                            "it": "Drakloak",
                            "pt": "Drakloak",
                            "es-mx": "Drakloak"
                          },
                          "createdAt": "2026-03-25T22:39:03.550Z",
                          "updatedAt": "2026-10-18T03:14:25.664Z"
                        }
                      ],
                      "total": 1
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get a product by ID",
        "description": "Returns a product by its numeric (auto-incremental) `_id`.",
        "operationId": "getProductById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Numeric product ID.",
            "schema": {
              "type": "integer"
            },
            "example": 1024
          },
          {
            "name": "populate",
            "in": "query",
            "description": "Comma-separated references to include as full documents. Allowed values: `tcg`, `set`, `serie`. `tcg` and `set` already come populated by default.",
            "schema": {
              "type": "string"
            },
            "example": "serie"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested product.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/history-prices/{productId}": {
      "get": {
        "tags": [
          "History Prices"
        ],
        "summary": "Price history of a product",
        "description": "Returns the daily price history of a product, newest first: one record per day, with that day's TCGplayer prices and the printing they belong to. An unknown product returns an empty array.\n\n```\nGET /api/history-prices/9804?from=2026-10-01&limit=30\n```",
        "operationId": "getHistoryPrices",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "description": "Numeric product ID.",
            "schema": {
              "type": "integer"
            },
            "example": 1024
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only records from this day on (ISO 8601, e.g. `2026-10-01`).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only records up to this day (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records (default `100`).",
            "schema": {
              "type": "integer",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price history (plain array).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HistoryPrice"
                  }
                },
                "example": [
                  {
                    "markets": {
                      "tcgplayer": {
                        "prices": {
                          "low": 0.12,
                          "mid": 0.31,
                          "high": 100,
                          "market": 0.25
                        },
                        "printing": "Foil"
                      }
                    },
                    "_id": "6ad447046ebc934f9e615a94",
                    "product": "9804",
                    "date": "2026-10-18T00:00:00.000Z",
                    "createdAt": "2026-10-18T04:11:47.511Z",
                    "updatedAt": "2026-10-18T04:11:47.511Z"
                  },
                  {
                    "markets": {
                      "tcgplayer": {
                        "prices": {
                          "low": 0.12,
                          "mid": 0.31,
                          "high": 100,
                          "market": 0.28
                        },
                        "printing": "Foil"
                      }
                    },
                    "_id": "6ad2f5866ebc934f9e556577",
                    "date": "2026-10-17T00:00:00.000Z",
                    "product": "9804",
                    "createdAt": "2026-10-17T04:11:50.094Z",
                    "updatedAt": "2026-10-17T04:11:50.094Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your personal API key from [apitcg.com/platform/api-key](https://apitcg.com/platform/api-key). Create a free account at [apitcg.com/register](https://apitcg.com/register)."
      }
    },
    "parameters": {
      "TcgSlug": {
        "name": "tcg",
        "in": "path",
        "required": true,
        "description": "TCG slug (see the list of available TCGs in the introduction).",
        "schema": {
          "type": "string",
          "enum": [
            "cardfight-vanguard",
            "cyberpunk",
            "digimon",
            "dragon-ball-super-fusion-world",
            "dragon-ball-super-masters",
            "final-fantasy-tcg",
            "flesh-and-blood",
            "gundam",
            "hololive",
            "lorcana",
            "magic",
            "mitos-y-leyendas",
            "my-little-pony-tcg",
            "naruto-card-game",
            "one-piece",
            "palworld",
            "pokemon",
            "riftbound",
            "star-wars-unlimited",
            "union-arena",
            "yugioh"
          ]
        },
        "example": "one-piece"
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Maximum number of results to return (1-100).",
        "schema": {
          "type": "integer",
          "default": 25,
          "minimum": 1,
          "maximum": 100
        }
      },
      "Page": {
        "name": "page",
        "in": "query",
        "description": "Results page to show.",
        "schema": {
          "type": "integer",
          "default": 1,
          "minimum": 1
        }
      },
      "SortBy": {
        "name": "sortBy",
        "in": "query",
        "description": "Field to sort the results by.",
        "schema": {
          "type": "string",
          "default": "name"
        }
      },
      "SortOrder": {
        "name": "sortOrder",
        "in": "query",
        "description": "Sort direction.",
        "schema": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "default": "asc"
        }
      }
    },
    "responses": {
      "NotFound": {
        "description": "Resource not found: `TCG no encontrado`, `Set no encontrado en este TCG` or `Producto no encontrado`.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "error": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error": "Producto no encontrado"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "missing": {
                "summary": "Missing key",
                "value": {
                  "success": false,
                  "error": "API key is required, register into: https://apitcg.com/platform"
                }
              },
              "invalid": {
                "summary": "Invalid key",
                "value": {
                  "success": false,
                  "error": "Invalid API key."
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "The monthly requests of your plan are used up, or more than 300 requests in a minute from the same IP (wait the seconds in `Retry-After`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "monthly": {
                "summary": "Monthly requests used up",
                "value": {
                  "success": false,
                  "error": "Request limit reached for this month."
                }
              },
              "burst": {
                "summary": "More than 300 requests in a minute",
                "value": {
                  "success": false,
                  "error": "Too many requests, slow down."
                }
              }
            }
          }
        },
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait (only on the per-minute limit).",
            "schema": {
              "type": "integer",
              "example": 42
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "error": {
                  "type": "string"
                }
              }
            },
            "example": {
              "success": false,
              "error": "Internal error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "description": "Human-readable error message."
          }
        },
        "x-internal": true
      },
      "TCG": {
        "type": "object",
        "description": "Trading card game. The `_id` is a slug generated from the name.",
        "properties": {
          "_id": {
            "type": "string",
            "description": "TCG slug.",
            "example": "one-piece"
          },
          "name": {
            "type": "string",
            "example": "One Piece"
          },
          "description": {
            "type": "string"
          },
          "logo": {
            "type": "string",
            "description": "TCG logo URL."
          },
          "markets": {
            "type": "object",
            "properties": {
              "tcgplayer": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "68"
                  }
                }
              },
              "tcgmatch": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-internal": true
      },
      "Set": {
        "type": "object",
        "description": "Set/expansion within a TCG. The `_id` is composed as `{tcg}-{slug}`.",
        "properties": {
          "_id": {
            "type": "string",
            "example": "riftbound-origins-proving-grounds"
          },
          "name": {
            "type": "string",
            "example": "Origins: Proving Grounds"
          },
          "slug": {
            "type": "string",
            "example": "origins-proving-grounds"
          },
          "tcg": {
            "type": "string",
            "description": "Slug of the TCG it belongs to (or the full document when using `populate=tcg`).",
            "example": "riftbound"
          },
          "serie": {
            "type": "string",
            "description": "ID of the series it belongs to (optional).",
            "nullable": true
          },
          "release_date": {
            "type": "string",
            "format": "date-time"
          },
          "code": {
            "type": "string",
            "description": "Official set code (optional).",
            "example": "OGN"
          },
          "logo": {
            "type": "string",
            "description": "Set logo URL."
          },
          "markets": {
            "type": "object",
            "properties": {
              "tcgplayer": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "24219"
                  }
                }
              },
              "tcgmatch": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-internal": true
      },
      "Product": {
        "type": "object",
        "description": "Product resource. Fields marked (Card), (Sealed) or (Accessory) only apply to that product type. The catalog currently holds `card` and `sealed` products; fields marked _(not in use)_ exist in the model but the catalog does not fill them today.",
        "properties": {
          "_id": {
            "type": "integer",
            "description": "Auto-incremental numeric ID.",
            "example": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "card",
              "sealed",
              "accessory",
              "other"
            ],
            "description": "Product type. The catalog currently holds `card` and `sealed` products."
          },
          "name": {
            "type": "string",
            "example": "Monkey.D.Luffy"
          },
          "description": {
            "type": "string",
            "description": "Top-level product description _(not in use)_. The description of a sealed product travels in `attributes.Description`."
          },
          "tcg": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TCG"
              }
            ],
            "description": "TCG the product belongs to. The API returns the **full document**; its `_id` is the slug (e.g. `one-piece`)."
          },
          "serie": {
            "type": "string",
            "description": "Series ID (or the full document with `populate=serie`) _(not in use)_."
          },
          "set": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Set"
              }
            ],
            "description": "Set the product belongs to. The API returns the **full document**; its `_id` is the set ID (e.g. `one-piece-pillars-of-strength`). Absent or `null` when the product is not linked to a set."
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "small": {
                  "type": "string"
                },
                "medium": {
                  "type": "string"
                },
                "large": {
                  "type": "string"
                }
              }
            },
            "description": "Product images, each one in three sizes. While the product has no photo, the URLs point to its silhouette (`/api/silhouettes/{id}.svg`, public). See [Images](#description/images)."
          },
          "dimensions": {
            "type": "object",
            "description": "Physical dimensions of the product _(not in use)_.",
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "cm",
                  "mm",
                  "in",
                  "m"
                ]
              },
              "height": {
                "type": "number",
                "minimum": 0
              },
              "width": {
                "type": "number",
                "minimum": 0
              },
              "length": {
                "type": "number",
                "minimum": 0
              }
            }
          },
          "weight": {
            "type": "number",
            "minimum": 0,
            "description": "Weight in grams _(not in use)_."
          },
          "release_date": {
            "type": "string",
            "format": "date-time",
            "description": "Release date of the product _(not in use)_. The release date of the set is in `set.release_date`."
          },
          "markets": {
            "type": "object",
            "description": "Product data and IDs on external markets.",
            "properties": {
              "tcgplayer": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "453022"
                  },
                  "url": {
                    "type": "string"
                  },
                  "prices": {
                    "type": "object",
                    "properties": {
                      "low": {
                        "type": "number",
                        "example": 0.15
                      },
                      "mid": {
                        "type": "number",
                        "example": 0.35
                      },
                      "high": {
                        "type": "number",
                        "example": 2.5
                      },
                      "market": {
                        "type": "number",
                        "example": 0.31
                      }
                    }
                  },
                  "printing": {
                    "type": "string",
                    "description": "Printing whose prices are in `prices`: the first one with a market price, in the order Normal, Unlimited, Holofoil, Unlimited Holofoil, Foil, Cold Foil, Rainbow Foil, Reverse Holofoil, 1st Edition, 1st Edition Holofoil, Limited.",
                    "example": "Normal"
                  },
                  "printings": {
                    "type": "array",
                    "description": "Every printing TCGplayer sells for the product, in the same order, each with its own prices.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "subTypeName": {
                          "type": "string",
                          "example": "Reverse Holofoil"
                        },
                        "prices": {
                          "type": "object",
                          "properties": {
                            "low": {
                              "type": "number",
                              "nullable": true,
                              "example": 0.02
                            },
                            "mid": {
                              "type": "number",
                              "nullable": true,
                              "example": 0.2
                            },
                            "high": {
                              "type": "number",
                              "nullable": true,
                              "example": 2.2
                            },
                            "market": {
                              "type": "number",
                              "nullable": true,
                              "example": 0.18
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "tcgmatch": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "prices": {
                    "type": "object",
                    "properties": {
                      "low": {
                        "type": "number",
                        "example": 0.15
                      },
                      "mid": {
                        "type": "number",
                        "example": 0.35
                      },
                      "high": {
                        "type": "number",
                        "example": 2.5
                      },
                      "market": {
                        "type": "number",
                        "example": 0.31
                      }
                    }
                  }
                },
                "description": "Reserved for TCGmatch (Chile) _(not in use in the current catalog)_."
              },
              "tcgdex": {
                "type": "object",
                "description": "(Pokémon cards) The card on [TCGdex](https://tcgdex.dev), the source of its illustrator, its regulation mark and its names in other languages.",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "swsh8-129"
                  }
                }
              }
            }
          },
          "code": {
            "type": "string",
            "description": "(Card) Card code.",
            "example": "OP03-070"
          },
          "cardNumber": {
            "type": "string",
            "description": "(Card) Card number within the set. Only Mitos y Leyendas and My Little Pony TCG use it; in the other games the number travels in `attributes.Number`."
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Dynamic attributes of the product. The keys depend on the game (see [Product attributes](#description/product-attributes)); values may contain light HTML.\n\n- **(Card)** `Artist` — illustrator of the card, when the game publishes it.\n- **(Card)** `Description` — the rules text of the card.\n- **(Sealed)** `Description` — the description of the sealed product.\n- **(Card)** `RegulationMark` (Pokémon), `Color` and `ManaValue` (Magic), `Level` or `Rank` (Yu-Gi-Oh) — filled in from other sources. See [Attributes from other sources](#description/attributes-from-other-sources).\n- **(Card)** `narutoStatus`, `narutoProvisional` and the other `naruto*` keys — see [Naruto Card Game](#description/naruto-card-game).",
            "example": {
              "Rarity": "R",
              "Number": "OP03-070",
              "Color": "Purple",
              "CardType": "Character",
              "Power": "7000",
              "Artist": "Nekobayashi"
            }
          },
          "alias": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "(Pokémon cards) The name printed on the card in each language: `en`, `es` (Spain), `es-mx` (Latin America), `fr`, `de`, `it` and `pt`. Any key may be missing. `name` searches them too. See [Names in other languages](#description/names-in-other-languages).",
            "example": {
              "en": "Roaring Moon",
              "es": "Bramaluna",
              "fr": "Rugit-Lune",
              "de": "Donnersichel",
              "it": "Lunaruggente",
              "pt": "Lua Estrondo"
            }
          },
          "catalogSupersededBy": {
            "type": "integer",
            "description": "(Naruto Card Game) Present when this preview reached the market as another product: the `_id` of that product. See [Naruto Card Game](#description/naruto-card-game).",
            "example": 338961
          },
          "sealed_type": {
            "type": "string",
            "description": "(Sealed) Sealed product subtype _(not in use)_.",
            "enum": [
              "booster_box",
              "booster_pack",
              "starter_deck",
              "theme_deck",
              "structure_deck",
              "blister",
              "tin",
              "collection_box",
              "elite_trainer_box",
              "bundle",
              "prerelease_kit",
              "other"
            ]
          },
          "status": {
            "type": "string",
            "description": "(Accessory) Accessory condition _(not in use)_.",
            "enum": [
              "new",
              "used"
            ]
          },
          "accesory_type": {
            "type": "string",
            "description": "(Accessory) Accessory subtype _(not in use)_.",
            "enum": [
              "deckbox",
              "double_deckbox",
              "playmat",
              "sleeve",
              "binder",
              "storage_box",
              "dice",
              "toploader",
              "bag",
              "other"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-internal": true
      },
      "HistoryPrice": {
        "type": "object",
        "description": "Daily price record of a product across markets.",
        "properties": {
          "_id": {
            "type": "string"
          },
          "product": {
            "type": "string",
            "description": "Product ID.",
            "example": "1024"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Day of the record, at midnight UTC: read only the date part."
          },
          "markets": {
            "type": "object",
            "properties": {
              "tcgplayer": {
                "type": "object",
                "properties": {
                  "prices": {
                    "type": "object",
                    "properties": {
                      "low": {
                        "type": "number",
                        "example": 0.15
                      },
                      "mid": {
                        "type": "number",
                        "example": 0.35
                      },
                      "high": {
                        "type": "number",
                        "example": 2.5
                      },
                      "market": {
                        "type": "number",
                        "example": 0.31
                      }
                    }
                  },
                  "printing": {
                    "type": "string",
                    "description": "Printing the prices of that day belong to.",
                    "example": "Normal"
                  }
                }
              },
              "tcgmatch": {
                "type": "object",
                "properties": {
                  "prices": {
                    "type": "object",
                    "properties": {
                      "low": {
                        "type": "number",
                        "example": 0.15
                      },
                      "mid": {
                        "type": "number",
                        "example": 0.35
                      },
                      "high": {
                        "type": "number",
                        "example": 2.5
                      },
                      "market": {
                        "type": "number",
                        "example": 0.31
                      }
                    }
                  }
                },
                "description": "_(not in use)_"
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "x-internal": true
      }
    }
  }
}
