# Yu-Gi-Oh! API
> The Yu-Gi-Oh! Trading Card Game as an API, powered by YGOPRODeck. Look up any card by name or passcode id and get its full detail — type and frame, ATK/DEF, level or rank or link rating, attribute and race/monster type, pendulum scale, complete effect/lore text, every set printing with its set code and rarity, current market prices (Cardmarket, TCGplayer, eBay, Amazon), high-resolution artwork, and TCG/OCG/GOAT banlist status. Fuzzy-search the entire database with filters (type, attribute, race, level, ATK, archetype) and pagination, browse every TCG set and every archetype, or pull a random card. Perfect for deck builders, collection trackers, card-price tools, Discord bots and fan sites. No accounts, no upstream key.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/yugioh-api/..."
```

## Pricing
- **Free** (Free) — 3,200 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 38,000 calls/Mo, 5 req/s
- **Pro** ($14/Mo) — 195,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 980,000 calls/Mo, 40 req/s

## Endpoints

### Cards

#### `GET /v1/card` — A single card by name or id

**Parameters:**
- `name` (query, optional, string) — Card name Example: `Dark Magician`
- `id` (query, optional, string) — Passcode id Example: `46986414`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yugioh-api/v1/card?name=Dark+Magician&id=46986414"
```

**Response:**
```json
{
    "data": {
        "card": {
            "id": 46986414,
            "atk": 2500,
            "ban": null,
            "def": 2100,
            "name": "Dark Magician",
            "race": "Spellcaster",
            "rank": null,
            "sets": [
                {
                    "code": "CT13-EN003",
                    "name": "2016 Mega-Tins",
                    "price": "6.97",
                    "rarity": "Ultra Rare"
                },
                {
                    "code": "CT14-EN001",
                    "name": "2017 Mega-Tins",
                    "price": "9.66",
                    "rarity": "Secret Rare"
                },
                {
                    "code": "25TH-EN001",
                    "name": "Battle of Chaos",
                    "price": "0.00",
                    "rarity": "Ultra Rare"
                },
                {
                    "code": "BPT-001",
                    "name": "Booster Pack Collectors Tins 2002",
                    "price": "63.01",
                    "rarity": "Secret Rare"
                },
                {
                    "code": "BPT-007",
                    "name": "Collectible Tins 2003",
                    "price": "19.08",
                    "rarity": "Secret Rare"
                },
                {
                    "code": "DB1-EN102",
                    "name": "Dark Beginning 1",
                    "price": "25.2",
                    "rarity": "Ultra Rare"
     
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/random` — A random card

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yugioh-api/v1/random"
```

**Response:**
```json
{
    "data": {
        "card": {
            "id": 93078761,
            "atk": null,
            "ban": null,
            "def": null,
            "name": "Diced Dice",
            "race": "Quick-Play",
            "rank": null,
            "sets": [
                {
                    "code": "MP21-EN146",
                    "name": "2021 Tin of Ancient Battles",
                    "price": "0.83",
                    "rarity": "Common"
                },
                {
                    "code": "ROTD-EN067",
                    "name": "Rise of the Duelist",
                    "price": "1.42",
                    "rarity": "Common"
                }
            ],
            "type": "Spell Card",
            "level": null,
            "scale": null,
            "images": [
                {
                    "id": 93078761,
                    "url": "https://images.ygoprodeck.com/images/cards/93078761.jpg",
                    "small": "https://images.ygoprodeck.com/images/cards_small/93078761.jpg",
                    "cropped": "https://images.ygoprodeck.com/images/cards_cropped/93078761.jpg"
                }
            ],
            "prices": {
                "ebay": "0.99",
                "amazon": "0.25",
                "tcgplayer": "0.10",
                "cardmarket": "0.04"
            },
            "archetype": null,
            "attribute": null,
            "frame_type": "spell",
            "link_value": null,
            "description": "R
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Fuzzy search + filters

**Parameters:**
- `q` (query, optional, string) — Name contains Example: `Blue-Eyes`
- `type` (query, optional, string) — Card type Example: `Effect Monster`
- `attribute` (query, optional, string) — DARK|LIGHT|EARTH|WATER|FIRE|WIND|DIVINE Example: `LIGHT`
- `race` (query, optional, string) — Race / monster type Example: `Dragon`
- `level` (query, optional, string) — Level/Rank 0-13 Example: `8`
- `archetype` (query, optional, string) — Archetype Example: `Blue-Eyes`
- `limit` (query, optional, string) — Max 1-100 Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yugioh-api/v1/search?q=Blue-Eyes&type=Effect+Monster&attribute=LIGHT&race=Dragon&level=8&archetype=Blue-Eyes&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "cards": [
            {
                "id": 64202399,
                "atk": 2500,
                "ban": null,
                "def": 2500,
                "name": "Blue-Eyes Abyss Dragon",
                "race": "Dragon",
                "rank": null,
                "sets": [
                    {
                        "code": "RA01-EN016",
                        "name": "25th Anniversary Rarity Collection",
                        "price": "0",
                        "rarity": "Super Rare"
                    },
                    {
                        "code": "RA01-EN016",
                        "name": "25th Anniversary Rarity Collection",
                        "price": "0",
                        "rarity": "Ultra Rare"
                    },
                    {
                        "code": "LDS2-EN015",
                        "name": "Legendary Duelists: Season 2",
                        "price": "27.36",
                        "rarity": "Secret Rare"
                    },
                    {
                        "code": "MAMA-EN056",
                        "name": "Magnificent Mavens",
                        "price": "0",
                        "rarity": "Ultra Rare"
                    },
                    {
                        "code": "SDWD-EN007",
                        "name": "Structure Deck: Blue-Eyes White Destiny",
                        "price": "0",
                        "rarity": "Common"
 
…(truncated, see openapi.json for full schema)
```

### Reference

#### `GET /v1/archetypes` — All archetypes

**Parameters:**
- `q` (query, optional, string) — Name contains Example: `Dragon`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yugioh-api/v1/archetypes?q=Dragon"
```

**Response:**
```json
{
    "data": {
        "total": 19,
        "archetypes": [
            "-Eyes Dragon",
            "Albaz Dragon",
            "Ancient Fairy Dragon",
            "Armed Dragon",
            "Curse of Dragon",
            "Cyber Dragon",
            "Divine Dragon",
            "Dragon Mech",
            "Dragon Ruler",
            "Dragonmaid",
            "Gem Dragon",
            "Guardragon",
            "Horus the Black Flame Dragon",
            "Light and Darkness Dragon",
            "Paladins of Dragons",
            "Pendulum Dragon",
            "Rose Dragon",
            "Tenpai Dragon",
            "Thunder Dragon"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:06.920Z",
        "request_id": "2b5ff08e-2e1c-4345-adbe-9a483e22c9be"
    },
    "status": "ok",
    "message": "Archetypes retrieved",
    "success": true
}
```

#### `GET /v1/sets` — All TCG sets

**Parameters:**
- `q` (query, optional, string) — Set name contains Example: `Metal Raiders`
- `limit` (query, optional, string) — Max results Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yugioh-api/v1/sets?q=Metal+Raiders&limit=100"
```

**Response:**
```json
{
    "data": {
        "sets": [
            {
                "code": "MRD",
                "date": "2002-06-26",
                "name": "Metal Raiders",
                "cards": 432
            }
        ],
        "count": 1,
        "total": 1
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:07.107Z",
        "request_id": "6541f7f6-319e-452f-8bde-6d7e16d01c36"
    },
    "status": "ok",
    "message": "Sets retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yugioh-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Yu-Gi-Oh! Trading Card Game database. /v1/card?name=Dark Magician or id=46986414 = a single card (stats, effect, set printings, rarities, prices, artwork, banlist status); /v1/search?q=Blue-Eyes&type=&race=&attribute=DARK&level=&archetype=&limit=&offset= = fuzzy search with filters; /v1/sets = every TCG set; /v1/archetypes = every archetype; /v1/random = a random card. Data from YGOPRODeck. For the Magic: The Gathering card game use the MTG API instead.",
        "source": "YGOPRODeck (db.ygoprodeck.com)",
        "endpoints": [
            "/v1/card",
            "/v1/search",
            "/v1/sets",
            "/v1/archetypes",
            "/v1/random",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:07.180Z",
        "request_id": "0ac61ac4-0bbc-4f93-a091-ebfd7f358041"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/yugioh-api
OpenAPI spec: https://www.oanor.com/api/yugioh-api/openapi.json
