# 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"
```

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

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

#### `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"
```

### 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"
```

#### `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"
```

### Meta

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

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


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