# Digimon API Documentation

Source: https://pokewallet.io/api-docs/digimon

REST reference for the Digimon API: sets, cards, search and images, with prices from TCGPlayer and CardMarket. Same API key as the Pokémon and One Piece APIs.

In short

The Digimon API returns 106 sets with their cards, search and images, and TCGPlayer (USD) and CardMarket (EUR) prices refreshed daily. These endpoints are free (100 requests/hour) with the same key as the other 11 games; prices by set and set analytics need the Ultra plan (€29/month) or its 7-day trial.

At a glance

- **Base path:** `https://api.pokewallet.io/dgm`
- **Sets:** 106 Digimon sets
- **Card IDs:** `dgm_` + hex for cards on TCGPlayer; 64 hex characters for CardMarket-only cards
- **Prices:** TCGPlayer (USD) for every finish and CardMarket (EUR) for `normal` and `foil`, refreshed daily
- **Free on every plan:** Sets, set cards, card details, search and images
- **Ultra plan or 7-day trial:** Prices by set, set statistics, completion value, trending sets and top cards
- **API key:** The same key as the Pokémon and One Piece APIs, with shared rate limits

Updated Oct 19, 2026

## Quick Start

Get started with PokéWallet API in 4 simple steps:

### Create an Account

Sign up for free to start using the API. Upgrade anytime from your dashboard.

[Sign Up Now](https://pokewallet.io/auth/login?source=pokemon)

### Generate an API Key

Create your first API key from the dashboard.

### Make Your First Request

Start querying the API with your key.

*cURL*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
       "https://api.pokewallet.io/dgm/sets"
```

### Join the Discord Community

Stay up to date with new features, ask for help, and connect with other developers.

[Join Discord](https://discord.gg/znDxEjmDVP)

## Authentication

All API requests (except `/health`) require authentication using an API key.

### API Key Format

API keys follow this format:

- **Production keys:** `pk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- **Development keys:** `pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

> **Security Warning:** Never expose your API keys in client-side code, public repositories, or logs. Always use environment variables.

### Authentication Methods

You can authenticate using either the `X-API-Key` header or `Authorization` header:

*X-API-Key Header (Recommended)*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
     "https://api.pokewallet.io/search?q=pikachu"
```

*Authorization Header*

```bash
curl -H "Authorization: Bearer pk_live_your_key_here" \
     "https://api.pokewallet.io/search?q=pikachu"
```

## Rate Limits

Rate limits vary depending on your subscription plan:

| Plan | Per hour | Per day | Paid endpoints | Price |
| --- | --- | --- | --- | --- |
| Free | 100 | 1,000 | — | €0 |
| Coffee | 1,000+ | 10,000+ | — | Buy a coffee on Ko-fi |
| Pro | 5,000 | 50,000 | Pokémon + One Piece | €20/month |
| Ultra | 7,000 | 70,000 | All 12 games | €29/month |
| Business | Custom | Custom | All 12 games | Contact us |
| Early Access | 1,000 | 10,000 | — | No longer available |

> All new users start on the **Free plan**. Upgrade from your [dashboard](https://pokewallet.io/dashboard). Early Access was our initial launch tier and is no longer available for new users.

> **Please note:** After upgrading your plan, activation may require a couple of hours.

[See all plans, pricing and FAQs](https://pokewallet.io/pricing)

### Rate Limit Headers

Every API response includes rate limit information:

```
X-RateLimit-Limit-Hour: 100
X-RateLimit-Remaining-Hour: 95
X-RateLimit-Limit-Day: 1000
X-RateLimit-Remaining-Day: 823
```

### Rate Limit Exceeded (429)

When you exceed your rate limit, you'll receive a `429 Too Many Requests` response:

```json
{
  "error": "Rate limit exceeded",
  "message": "Hourly limit exceeded",
  "limits": {
    "hourly": {
      "limit": 100,
      "used": 100,
      "remaining": 0
    },
    "daily": {
      "limit": 1000,
      "used": 523,
      "remaining": 477
    }
  }
}
```

## Public Endpoints

> **No Authentication Required:** These endpoints are publicly accessible.

### GET /health (No Auth Required)

Check API status, database, cache, and storage health with response times.

### Example Request:

*cURL*

```bash
curl "https://api.pokewallet.io/health"
```

### Response Example (Healthy):

*200 OK*

```json
{
  "status": "healthy",
  "timestamp": "2025-12-16T10:30:00.000Z",
  "version": "1.1.0",
  "checks": {
    "database": {
      "status": "healthy",
      "responseTime": 45
    },
    "cache": {
      "status": "healthy",
      "responseTime": 3
    },
    "storage": {
      "status": "healthy",
      "responseTime": 12
    }
  },
  "responseTime": 60,
  "region": "FRA"
}
```

### Response Example (Unhealthy):

*503 Service Unavailable*

```json
{
  "status": "unhealthy",
  "timestamp": "2025-12-16T10:30:00.000Z",
  "version": "1.1.0",
  "message": "Critical services unavailable - API may not function correctly",
  "checks": {
    "database": {
      "status": "unhealthy",
      "responseTime": null,
      "message": "Connection failed"
    },
    "cache": {
      "status": "healthy",
      "responseTime": 3
    },
    "storage": {
      "status": "healthy",
      "responseTime": 12
    }
  },
  "responseTime": 1050,
  "region": "FRA"
}
```

### GET / (No Auth Required)

Get API information, version, and available endpoints.

### Example Request:

*cURL*

```bash
curl "https://api.pokewallet.io/"
```

### Response Example:

*200 OK*

```json
{
  "name": "PokeWallet API",
  "version": "1.1.0",
  "status": "production",
  "authentication": {
    "required": true,
    "method": "API Key",
    "header": "X-API-Key",
    "format": "pk_live_xxxxxxxxxxxxx"
  },
  "endpoints": {
    "health": { "path": "/health", "auth_required": false },
    "search": { "path": "/search?q=charizard&limit=20", "auth_required": true },
    "cardDetail": { "path": "/cards/:id", "auth_required": true },
    "sets": { "path": "/sets", "auth_required": true },
    "setDetails": { "path": "/sets/:setCode?page=1&limit=50", "auth_required": true },
    "images": { "path": "/images/:id?size=high", "auth_required": true }
  },
  "rate_limits": {
    "per_hour": 100,
    "per_day": 1000,
    "plan": "free"
  }
}
```

### GET /games (No Auth Required)

Lists the games available under their own prefix (`/mtg`, `/ygo`, …) with their routes. Pokémon and One Piece are not in this list: they use `/cards`, `/sets`… and `/op/…`.

### Example Request:

*cURL*

```bash
curl "https://api.pokewallet.io/games"
```

### Response Example (first of ten games):

*200 OK*

```json
{
  "success": true,
  "data": [
    {
      "code": "mtg",
      "name": "Magic: the Gathering",
      "endpoints": {
        "sets": "/mtg/sets",
        "set": "/mtg/sets/:set",
        "card": "/mtg/cards/:id",
        "search": "/mtg/search?q=",
        "image": "/mtg/images/:id"
      }
    }
  ]
}
```

> **Digimon PRO endpoints: Ultra plan required**
>
> The **Pro plan does not include them**: Pro covers Pokémon and One Piece only. Ultra (€29/month) includes everything in Pro plus the paid endpoints of **all 12 games**. Free endpoints (sets, cards, search, images) work on every plan.
>
> [Compare plans →](https://pokewallet.io/pricing)

## Digimon

All Digimon endpoints live under `/dgm`. Same API key, same rate limits and the same response format as the Pokémon endpoints.

### Card IDs

| Format | Example | Used for |
| --- | --- | --- |
| `dgm_` + hex | `dgm_8a6ca66bf034f86b91d1…` | Every card with a TCGPlayer product, even if it also has CardMarket data |
| 64 hex characters, no prefix | `e26f12b8b1fabf19…` | Cards that exist only on CardMarket |

> A `dgm_…` ID only works under `/dgm/`. Finishes of the same product (Normal, Foil, …) are one card with one ID; each finish has its own TCGPlayer price. If you request a card by its CardMarket ID and it is linked to a TCGPlayer product, the response uses the canonical `dgm_…` ID.

### Response Format

Same shape as the Pokémon API: `card_info`, `images`, `tcgplayer.prices` and `cardmarket.prices` as arrays, `pagination`, errors as `{ "error", "message" }`. Differences:

| Field | Digimon |
| --- | --- |
| Game fields in `card_info` | Instead of Pokémon's `hp`, `stage`, `attacks`…, the game's own fields in snake_case (present when the card has them): `color`, `play_cost`, `digimon_type`, `digimon_form`, `level_lv`, `digimon_power_dp`, `digimon_attribute`, `digivolve1_color`, `digivolve1_cost`, `digivolve1_level`, `inherited_effect`, `digivolve2_color`, `digivolve2_level`, `digivolve2_cost`, `security_effect`, `origins`, `digivolve3_level`, `disclaimer` |
| `card_type`, `card_text` | Filled from the game's card type and rules text. `card_text` may contain HTML (`<strong>`, `<em>`…) as provided by TCGPlayer. |
| `card_info.variants`, `card_info.set_id` | Always present, on every endpoint |
| `product_type` | `"card"`, `"sealed"` or `null` when unknown — see [Data Notes](https://pokewallet.io/api-docs/digimon#dgm-data-notes) |
| `release_date` | ISO format, e.g. `"2025-03-07T00:00:00"` (Pokémon uses `"16th June, 2023"`) |
| `images.languages` | `["en"]`, or `[]` when there is no image |

## Digimon Endpoints

### GET /dgm/sets

All Digimon sets.

### Response Fields:

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | Set name |
| `set_code` | string \| null | Short code. **Not unique**: several sets can share it. |
| `set_id` | string | Unique set identifier. Negative for sets that exist only on CardMarket. |
| `card_count` | integer | Cards in the set (sealed products excluded). Omitted, not 0, if temporarily unavailable. |
| `sealed_count` | integer | Sealed products in the set (booster boxes, displays, decks). Omitted, not 0, if temporarily unavailable. |
| `language` | string \| null | Set language |
| `release_date` | string \| null | ISO date |

### Example Request:

*cURL*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
     "https://api.pokewallet.io/dgm/sets"
```

### Response Example (first two sets):

*200 OK*

```json
{
  "success": true,
  "data": [
    {
      "name": "Across Time",
      "set_code": "BT-12",
      "set_id": "23012",
      "card_count": 192,
      "sealed_count": 3,
      "language": "eng",
      "release_date": "2023-04-28T00:00:00"
    },
    {
      "name": "Across Time Pre-Release Cards",
      "set_code": "BT-12_PR",
      "set_id": "23013",
      "card_count": 57,
      "sealed_count": 1,
      "language": "eng",
      "release_date": "2023-04-28T00:00:00"
    }
  ],
  "total": 106
}
```

### GET /dgm/sets/:set

Cards of one set, paginated. Prices are empty in set listings, as on the Pokémon API: use `/dgm/cards/:id` for prices.

### Parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `set` | string | Required | `set_id` (recommended, always unique) or `set_code` (exact match, case-insensitive) |
| `page` | number | Optional | Page number (default: 1) |
| `limit` | number | Optional | Results per page (default: 50, max: 200) |

### Example Request:

*cURL*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
     "https://api.pokewallet.io/dgm/sets/2987?limit=1"
```

### Response Example:

*200 OK*

```json
{
  "success": true,
  "set": {
    "name": "Revision Pack Cards",
    "set_code": "RPC",
    "set_id": "2987",
    "total_cards": 54,
    "language": "eng",
    "release_date": null
  },
  "cards": [
    {
      "id": "dgm_8a6ca66bf034f86b91d102c4d6e31169a41181937a3435202730dcf3fdd1d0ce9b73e9d3418074ec64d2741defa7eedaca",
      "card_info": {
        "name": "Lightning Paw",
        "clean_name": "Lightning Paw",
        "set_name": "Revision Pack Cards",
        "set_code": "RPC",
        "set_id": "2987",
        "card_number": "BT2-097 C",
        "rarity": "Common",
        "card_type": "Option",
        "product_type": "card",
        "variants": [
          "Normal"
        ],
        "card_text": "[Main] 3 of your opponent's level 3 Digimon get -4000 DP for the turn.",
        "color": "Yellow",
        "play_cost": "3",
        "security_effect": "[Security] Activate this card's [Main] effect."
      },
      "images": {
        "languages": [
          "en"
        ]
      },
      "tcgplayer": {
        "prices": [],
        "url": "https://www.tcgplayer.com/product/257742/digimon-card-game-revision-pack-cards-lightning-paw"
      },
      "cardmarket": {
        "product_name": "Lightning Paw",
        "prices": []
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 1,
    "total": 54,
    "total_pages": 54
  }
}
```

### Disambiguation Response:

When a `set_code` is shared by several sets, the API returns the candidates instead of a set (status 200, as on the Pokémon API). Call again with the `set_id` you need.

*200 OK — /dgm/sets/BT-26*

```json
{
  "disambiguation": true,
  "message": "Multiple sets found for set_code 'BT-26'. Use set_id to specify which one.",
  "matches": [
    {
      "set_id": "24623",
      "set_code": "BT-26",
      "name": "Timeless Bonds",
      "language": "eng",
      "release_date": "2026-09-04T00:00:00"
    },
    {
      "set_id": "24824",
      "set_code": "BT-26",
      "name": "Timeless Bonds Release Event Cards",
      "language": "eng",
      "release_date": "2026-08-28T00:00:00"
    }
  ],
  "total": 2
}
```

### GET /dgm/cards/:id

Full card with prices. `id` is a `dgm_…` ID or a 64-character CardMarket ID.

### Example Request:

*cURL*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
     "https://api.pokewallet.io/dgm/cards/dgm_8a6ca66bf034f86b91d102c4d6e31169a41181937a3435202730dcf3fdd1d0ce9b73e9d3418074ec64d2741defa7eedaca"
```

### Response Example:

*200 OK*

```json
{
  "id": "dgm_8a6ca66bf034f86b91d102c4d6e31169a41181937a3435202730dcf3fdd1d0ce9b73e9d3418074ec64d2741defa7eedaca",
  "card_info": {
    "name": "Lightning Paw",
    "clean_name": "Lightning Paw",
    "set_name": "Revision Pack Cards",
    "set_code": "RPC",
    "set_id": "2987",
    "card_number": "BT2-097 C",
    "rarity": "Common",
    "card_type": "Option",
    "product_type": "card",
    "variants": [
      "Normal"
    ],
    "card_text": "[Main] 3 of your opponent's level 3 Digimon get -4000 DP for the turn.",
    "color": "Yellow",
    "play_cost": "3",
    "security_effect": "[Security] Activate this card's [Main] effect."
  },
  "images": {
    "languages": [
      "en"
    ]
  },
  "tcgplayer": {
    "prices": [
      {
        "low_price": 0.17,
        "mid_price": 0.49,
        "high_price": 2.47,
        "market_price": 0.24,
        "direct_low_price": null,
        "updated_at": "2026-09-30T20:41:10.523951+00:00",
        "sub_type_name": "Normal"
      }
    ],
    "url": "https://www.tcgplayer.com/product/257742/digimon-card-game-revision-pack-cards-lightning-paw"
  },
  "cardmarket": {
    "product_name": "Lightning Paw",
    "prices": [
      {
        "variant_type": "normal",
        "avg": 1.49,
        "low": 0.9,
        "trend": 1.27,
        "avg1": 0.99,
        "avg7": 1.65,
        "avg30": 1.65,
        "updated_at": "2026-09-30T14:50:04.161777+00:00"
      }
    ]
  }
}
```

> One entry in `tcgplayer.prices` per finish, identified by `sub_type_name`, and one entry in `cardmarket.prices` per finish, identified by `variant_type` (`normal`, `foil`). `updated_at` is when that price last changed, not when it was last checked. A CardMarket-only card has `tcgplayer: null` and empty `variants`.

### GET /dgm/search

Search cards by name or card number. Results have the same shape as `/dgm/cards/:id`, prices included.

### Parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `q` | string | Required | 2–100 characters. Card name (all words, any order) or card number |
| `page` | number | Optional | Page number (default: 1) |
| `limit` | number | Optional | Results per page (default: 20, max: 100) |

### Example Request:

*cURL*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
     "https://api.pokewallet.io/dgm/search?q=Lightning&limit=2"
```

### Response Example (`results` omitted):

*200 OK*

```json
{
  "query": "Lightning",
  "results": [
    {
      "id": "dgm_67dcdf17a0fe86cbc3c3c8967734865bf34a5873b6de166305cc60d5b73a87dd4dd00ef271a35fc325ce6e763aed75b26de9",
      "card_info": {
        "name": "Lightning Paw",
        "clean_name": "Lightning Paw",
        "set_name": "Release Special Booster 1.5",
        "set_code": "BT01-03B",
        "set_id": "24182",
        "card_number": "BT2-097 C",
        "rarity": "Common",
        "card_type": "Option",
        "product_type": "card",
        "variants": [
          "Normal"
        ],
        "card_text": "[Main] Up to 3 of your opponent's level 3 Digimon get -4000 DP for the turn.",
        "color": "Yellow",
        "origins": "Release Special Booster V.1.5",
        "play_cost": "3",
        "security_effect": "[Security] Activate this card's [Main] effect."
      },
      "images": {
        "languages": [
          "en"
        ]
      },
      "tcgplayer": {
        "prices": [
          {
            "low_price": 0.01,
            "mid_price": 0.2,
            "high_price": 1.51,
            "market_price": 0.07,
            "direct_low_price": null,
            "updated_at": "2026-09-20T12:37:03.528756+00:00",
            "sub_type_name": "Normal"
          }
        ],
        "url": "https://www.tcgplayer.com/product/231717/digimon-card-game-release-special-booster-15-lightning-paw"
      },
      "cardmarket": {
        "product_name": "Lightning Paw (BT2-097)",
        "prices": [
          {
            "variant_type": "normal",
            "avg": 0.13,
            "low": 0.02,
            "trend": 0.1,
            "avg1": 0.02,
            "avg7": 0.04,
            "avg30": 0.06,
            "updated_at": "2026-09-30T14:50:03.973008+00:00"
          }
        ],
        "product_url": "https://www.cardmarket.com/en/Digimon/Products/Singles/Special-Release-Booster-v15/Lightning-Paw-BT2-097-C"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 2,
    "total": 8,
    "total_pages": 4
  },
  "metadata": {
    "total_count": 8,
    "tcg": 7,
    "cardmarket": 7,
    "tcg_only": 1,
    "cardmarket_only": 1,
    "both_sources": 6,
    "truncated": false
  }
}
```

> `metadata.truncated: true` means more cards match than the search returns: add words to narrow it down. Words match anywhere in the name; a query shorter than 3 characters matches names and card numbers that **start** with it (`27` finds `27`, `027/264`, `0027`). Quotes are ignored; `*`, `%` and `_` are plain text, not wildcards.

### GET /dgm/images/:id

The card image, one resolution (`X-Image-Size: unsized`): the `size` parameter of the Pokémon image endpoint does not apply. Cached for 24 hours.

### Example Request:

*cURL*

```bash
curl -H "X-API-Key: pk_live_your_key_here" \
     "https://api.pokewallet.io/dgm/images/dgm_8a6ca66bf034f86b91d102c4d6e31169a41181937a3435202730dcf3fdd1d0ce9b73e9d3418074ec64d2741defa7eedaca" \
     --output card
```

## Ultra endpoints

Available on Ultra and Business plans, or during the 7-day trial. The Pro plan covers Pokémon and One Piece only: with Pro these endpoints answer 403 with an `upgrade_url`. Ultra includes everything in Pro. Same parameters and response format as the Pokémon endpoints of the same name.

| Endpoint | What it returns |
| --- | --- |
| `GET /dgm/prices/:set` | TCGPlayer and CardMarket prices for every card of a set, one row per finish. `?source=tcg\|cm` |
| `GET /dgm/sets/:set/statistics` | Price statistics and rarity breakdown. Sealed products excluded. `?variant=normal\|foil` |
| `GET /dgm/sets/:set/completion-value` | Cost of one copy of every card in the set. Sealed products excluded. |
| `GET /dgm/sets/trending` | Sets whose CardMarket prices moved most: 7-day average against 30-day average, cards from 1 € up. `?period=7d` `?limit=` |
| `GET /dgm/analytics/top-cards` | Most expensive cards, or fastest-growing on CardMarket (7-day average against 30-day average, cards from 1 € up; `current_price` is the 7-day average). `?metric=price\|growth` `?source=tcg\|cm` `?limit=` |

> Price history is a Pokémon feature: for this game there is no `/cards/:id/price-history`. Current prices are in the card detail and in `/dgm/prices/:set`; `metric=growth` works with `source=cm` only, and trending supports `period=7d` only.

### GET /dgm/prices/:set (first rows)

*200 OK*

```json
{
  "success": true,
  "source": "both",
  "set_code": "RPC",
  "set_id": "2987",
  "data": [
    {
      "id": "dgm_8a6ca66bf034f86b91d102c4d6e31169a41181937a3435202730dcf3fdd1d0ce9b73e9d3418074ec64d2741defa7eedaca",
      "card_number": "BT2-097 C",
      "name": "Lightning Paw",
      "product_type": "card",
      "variant": "Normal",
      "tcgplayer": {
        "low_price": 0.17,
        "mid_price": 0.49,
        "high_price": 2.47,
        "market_price": 0.24,
        "direct_low_price": null,
        "updated_at": "2026-09-30T20:41:10.523951+00:00"
      },
      "cardmarket": {
        "avg": 1.49,
        "low": 0.9,
        "trend": 1.27,
        "avg1": 0.99,
        "avg7": 1.65,
        "avg30": 1.65,
        "updated_at": "2026-09-30T14:50:04.161777+00:00"
      }
    },
    {
      "id": "dgm_0c0c1b23b5e2dffe86d45ff23a5b225aeed5607b65c81c5275ccb159bc0669524b585b6c0ca625ba4cf6144dc2134d9b0f",
      "card_number": "BT3-092 R",
      "name": "MaloMyotismon",
      "product_type": "card",
      "variant": "Normal",
      "tcgplayer": {
        "low_price": 2.2,
        "mid_price": 2.99,
        "high_price": 9.99,
        "market_price": 2.97,
        "direct_low_price": null,
        "updated_at": "2026-09-30T20:41:10.523951+00:00"
      },
      "cardmarket": {
        "avg": 3,
        "low": 0.75,
        "trend": 2.23,
        "avg1": 3,
        "avg7": 2.38,
        "avg30": 0.98,
        "updated_at": "2026-09-30T14:50:04.161777+00:00"
      }
    },
    {
      "id": "dgm_8dfe7e94b348739bce5965d88110d1e71aaac21b6d5055a4f7c4e7cc7008955aa231718c7216ed450e41caa07c6dae3174",
      "card_number": "BT3-097 U",
      "name": "A Delicate Plan",
      "product_type": "card",
      "variant": "Normal",
      "tcgplayer": {
        "low_price": 0.21,
        "mid_price": 0.69,
        "high_price": 8,
        "market_price": 0.35,
        "direct_low_price": null,
        "updated_at": "2026-09-20T12:37:08.504636+00:00"
      },
      "cardmarket": {
        "avg": 0.43,
        "low": 0.4,
        "trend": 0.48,
        "avg1": 0.43,
        "avg7": 0.32,
        "avg30": 0.32,
        "updated_at": "2026-09-30T14:50:04.161777+00:00"
      }
    }
  ],
  "total": 54
}
```

### GET /dgm/sets/:set/statistics

*200 OK*

```json
{
  "set_info": {
    "name": "Revision Pack Cards",
    "set_code": "RPC",
    "set_id": "2987",
    "total_cards": 54
  },
  "price_statistics": {
    "tcgplayer": {
      "avg_market_price": "0.83",
      "min_price": 0.11,
      "max_price": 5.1,
      "most_expensive": {
        "id": "dgm_2291e80f3e9aaef8ccd75d616357764d5a38807fa0776de60997284ca7208521062b8dd08f53088d5a468db419a860187462",
        "name": "Imperialdramon: Dragon Mode",
        "price": 5.1
      }
    },
    "cardmarket": {
      "avg_price": "0.64",
      "min_price": 0.02,
      "max_price": 4.35,
      "most_expensive": {
        "id": "dgm_2291e80f3e9aaef8ccd75d616357764d5a38807fa0776de60997284ca7208521062b8dd08f53088d5a468db419a860187462",
        "name": "Imperialdramon: Dragon Mode",
        "price": 4.35
      },
      "trend_direction": "up"
    }
  },
  "rarity_breakdown": {
    "Common": 13,
    "Rare": 15,
    "Uncommon": 10,
    "Secret Rare": 2,
    "Super Rare": 9,
    "Promo": 5
  }
}
```

### GET /dgm/sets/:set/completion-value

*200 OK*

```json
{
  "set_info": {
    "name": "Revision Pack Cards",
    "set_code": "RPC",
    "set_id": "2987",
    "total_cards": 54
  },
  "completion_cost": {
    "tcgplayer": {
      "currency": "USD",
      "low_estimate": 28.78,
      "market_estimate": 42.67,
      "high_estimate": 208.28
    },
    "cardmarket": {
      "currency": "EUR",
      "low_estimate": 14.81,
      "avg_estimate": 32.77,
      "trend_estimate": 29.87
    },
    "note": "One copy per card (base finish). TCGPlayer prices in USD, CardMarket prices in EUR. Cross-currency comparison not available."
  },
  "breakdown_by_rarity": {
    "Common": {
      "count": 13,
      "total_cost": 11.96
    },
    "Rare": {
      "count": 15,
      "total_cost": 9.98
    },
    "Uncommon": {
      "count": 10,
      "total_cost": 5.41
    },
    "Secret Rare": {
      "count": 2,
      "total_cost": 1.64
    },
    "Super Rare": {
      "count": 9,
      "total_cost": 9.66
    },
    "Promo": {
      "count": 5,
      "total_cost": 3.45
    }
  }
}
```

### GET /dgm/analytics/top-cards

*200 OK*

```json
{
  "metric": "price",
  "source": "tcg",
  "top_cards": [
    {
      "id": "dgm_86efe938247f8486d12fcee53828d02f1edf6e3829a10ca9c4bb0bc5ff02d386ed7b0d4429db4ae00daa1729d66f8a222eedefae7f",
      "card_info": {
        "name": "WarGreymon (Rare Pull)",
        "clean_name": "WarGreymon Rare Pull",
        "set_name": "Release Special Booster 2.5",
        "set_code": "BT19-20",
        "set_id": "24178",
        "card_number": "BT14-101 SEC",
        "rarity": "Secret Rare",
        "card_type": "Digimon",
        "product_type": "card",
        "variants": [
          "Normal",
          "Foil"
        ],
        "card_text": "<em>([Digivolve] Lv.5 w/[Greymon] in name: Cost 4)</em>\r\n<br>While you have a Tamer with [Tai Kamiya] in its name and your opponent has a Digimon with 10000 DP or more, one of your [Agumon] may digivolve into this card in your hand for a digivolution cost of 4, ignoring digivolution requirements.\r\n<br>[When Digivolving] This Digimon gains [Raid] for the turn. Then, it may\r\nattack.\r\n<br>[When Attacking] If you have a Tamer, this Digimon gains [Security A. +1] and [Piercing] for the turn.",
        "color": "Red",
        "level_lv": "6",
        "play_cost": "12",
        "digimon_form": "Mega",
        "digimon_type": "Dragonkin",
        "digimon_power_dp": "12000",
        "digivolve1_cost": "4",
        "digivolve1_color": "Red",
        "digivolve1_level": "5",
        "digimon_attribute": "Vaccine"
      },
      "current_price": 3000
    },
    {
      "id": "dgm_df0b0bb5d6671cbb3e1bbc744e61c45fe15e56435c3d383ecb49cb194ed1e689a606f8ca8849ba2447c63471a0b97592380ea2aebf",
      "card_info": {
        "name": "MetalGarurumon (Rare Pull)",
        "clean_name": "MetalGarurumon Rare Pull",
        "set_name": "Release Special Booster 2.5",
        "set_code": "BT19-20",
        "set_id": "24178",
        "card_number": "BT15-101 SEC",
        "rarity": "Secret Rare",
        "card_type": "Digimon",
        "product_type": "card",
        "variants": [
          "Foil"
        ],
        "card_text": "<em>[[Digivolve] Lv.5 w/[Garurumon] in name: Cost 4]</em>\r\n<br>While you have a Tamer with [Matt Ishida] in its name and your opponent has a 10000 DP or higher Digimon, one of your [Gabumon] may digivolve into this card in your hand for a divolution cost of 4, ignoring its digivolution requirements.\r\n<br>[Evade]\r\n<br>[When Digivolving] 3 of your opponent's Digimon and Tamers can't suspend until the end of their turn.\r\n<br>[All Turns] [Once Per Turn] When this Digimon becomes suspended, you may unsuspend it.",
        "color": "Blue",
        "level_lv": "6",
        "play_cost": "12",
        "digimon_form": "Mega",
        "digimon_type": "Cyborg",
        "digimon_power_dp": "12000",
        "digivolve1_cost": "4",
        "digivolve1_color": "Blue",
        "digivolve1_level": "5",
        "digimon_attribute": "Data"
      },
      "current_price": 1700
    },
    {
      "id": "dgm_5f86b3c5016828f2f20323209dd3264f0dc9bc53cdd651da44dfe41dc850fa58941a2691f25b526678dc07fad54d6cc56c932996",
      "card_info": {
        "name": "BeelStarmon (X Antibody) (Textured)",
        "clean_name": "BeelStarmon X Antibody Textured",
        "set_name": "Digimon LIBERATOR",
        "set_code": "EX-07",
        "set_id": "23587",
        "card_number": "EX7-073 SCR",
        "rarity": "Secret Rare",
        "card_type": "Digimon",
        "product_type": "card",
        "variants": [
          "Foil"
        ],
        "card_text": "[When Digivolving] You may use 1 Option card with [Three Musketeers] in its text from your hand without paying the cost.<br>\r\n[When Digivolving] [When Attacking] By trashing 2 cards with the [Three Musketeers] trait in this Digimon's digivolution cards, delete 1 of your opponent's Digimon with the highest level and trash the top card of your opponent's security stack.",
        "color": "Purple",
        "level_lv": "6",
        "play_cost": "12",
        "digimon_form": "Mega",
        "digivolve1_cost": "3",
        "digivolve1_color": "Purple",
        "digivolve1_level": "5",
        "digimon_attribute": "Virus"
      },
      "current_price": 1449.5
    }
  ]
}
```

### GET /dgm/analytics/top-cards?metric=growth&source=cm

*200 OK*

```json
{
  "metric": "growth",
  "source": "cm",
  "top_cards": [
    {
      "id": "dgm_af2c44b58cec3573aff24bdd650daeb0b0f9a8175779abca42cd8299ae59bc1bb7ae6e20387f1c6ec9cb1d455666065213ba",
      "card_info": {
        "name": "Gazimon (Limited Foil)",
        "clean_name": "Gazimon Limited Foil",
        "set_name": "Versus Monsters",
        "set_code": "EX-09",
        "set_id": "24077",
        "card_number": "EX9-058 U",
        "rarity": "Uncommon",
        "card_type": "Digimon",
        "product_type": "card",
        "variants": [
          "Foil"
        ],
        "card_text": "<em>[[Digivolve] Lv.2 w/[DM] trait: Cost 0]</em>\r\n<br>[On Play] Reveal the top 3 cards of your deck. Among them, add 1 card with the [DM] trait to the hand and place 1 card with the [Ver.5] trait face down as the bottom digivolution card of any of your Digimon with the [DM] trait. Return the rest to the bottom of the deck.",
        "color": "Purple",
        "level_lv": "3",
        "play_cost": "3",
        "digimon_form": "Rookie",
        "digimon_type": "Mammal/DM/Ver.5",
        "digimon_power_dp": "1000",
        "digivolve1_cost": "0",
        "digivolve1_color": "Purple",
        "digivolve1_level": "2",
        "digimon_attribute": "Virus",
        "inherited_effect": "[Retaliation] <em>(When only this Digimon is deleted in battle, delete the Digimon it battled.)</em>"
      },
      "current_price": 10.55,
      "change_7d": "+343.3%"
    },
    {
      "id": "dgm_52ddf1834adba4251d6ba73f79b48a176c4511876291f93fde8499efa34b826c7661e3d1cafdbedc0a789097c1b410a7d763",
      "card_info": {
        "name": "Tsunomon (Limited Foil)",
        "clean_name": "Tsunomon Limited Foil",
        "set_name": "Versus Monsters",
        "set_code": "EX-09",
        "set_id": "24077",
        "card_number": "EX9-002 C",
        "rarity": "Common",
        "card_type": "Digi-Egg",
        "product_type": "card",
        "variants": [
          "Foil"
        ],
        "card_text": null,
        "color": "Blue",
        "level_lv": "2",
        "digimon_form": "In-Training",
        "digimon_type": "Lesser/DM/Ver.2",
        "inherited_effect": "[Your Turn] [Once Per Turn] When face-down cards are placed in this Digimon's digivolution cards, this Digimon may digivolve into a [Ver.2] trait Digimon card in the hand with the digivolution cost reduced by 1."
      },
      "current_price": 7.57,
      "change_7d": "+340.1%"
    },
    {
      "id": "dgm_9c24eebb4cc59bf3cd8874373423f812b740900404caf33c358a5a97ebcb991625c737df32fe3b87cc905e19c9ab9e204ee9",
      "card_info": {
        "name": "Starmon (Foil)",
        "clean_name": "Starmon Foil",
        "set_name": "Digimon LIBERATOR",
        "set_code": "EX-07",
        "set_id": "23587",
        "card_number": "EX7-026 C",
        "rarity": "Common",
        "card_type": "Digimon",
        "product_type": "card",
        "variants": [
          "Foil"
        ],
        "card_text": "<em>[[Digivolve] Lv.3 w/[NSp] trait: Cost 2]</em><br>\r\n[On Play] [When Digivolving] 1 of your opponent's Digimon gets -3000 DP for the turn.",
        "color": "Yellow",
        "level_lv": "4",
        "play_cost": "4",
        "digimon_form": "Champion",
        "digimon_type": "Mutant/NSp",
        "digimon_power_dp": "4000",
        "digivolve1_cost": "2",
        "digivolve1_color": "Yellow",
        "digivolve1_level": "3",
        "digimon_attribute": "Data",
        "inherited_effect": "[Barrier] <em>(When this Digimon would be deleted in battle, by trashing the top card of your security stack, prevent that deletion.)</em>"
      },
      "current_price": 8.87,
      "change_7d": "+197.7%"
    }
  ]
}
```

### GET /dgm/sets/trending

*200 OK*

```json
{
  "period": "7d",
  "trending_sets": [
    {
      "set_name": "Starter Deck 21: Hero of Hope Release Event Cards",
      "set_code": "ST-21_PR",
      "set_id": "24271",
      "card_count": 5,
      "cardmarket": {
        "price_change": "-40.5%",
        "avg_price_current": 1.37,
        "avg_price_previous": 2.3,
        "top_movers": [
          {
            "name": "Tsunomon",
            "change": "-64.1%"
          },
          {
            "name": "Gomamon",
            "change": "-46.1%"
          },
          {
            "name": "MetalGarurumon Ace",
            "change": "-27.1%"
          }
        ]
      },
      "tcgplayer": {
        "status": "work_in_progress",
        "message": "TCGPlayer price history not yet available"
      }
    },
    {
      "set_name": "Starter Deck 20: Protector of Light Release Event Cards",
      "set_code": "ST-20_PR",
      "set_id": "24292",
      "card_count": 5,
      "cardmarket": {
        "price_change": "-33.4%",
        "avg_price_current": 1.45,
        "avg_price_previous": 2.18,
        "top_movers": [
          {
            "name": "Birdramon",
            "change": "-51.1%"
          },
          {
            "name": "MegaKabuterimon",
            "change": "-39.0%"
          },
          {
            "name": "Biyomon",
            "change": "-38.8%"
          }
        ]
      },
      "tcgplayer": {
        "status": "work_in_progress",
        "message": "TCGPlayer price history not yet available"
      }
    }
  ]
}
```

## Data Notes

> **Prices.** TCGPlayer and CardMarket prices are refreshed daily. CardMarket has one entry per finish (`normal`, `foil`); a finish CardMarket does not price is left out, so `cardmarket.prices` can be empty. `updated_at` is when that price last changed, not when it was last checked: a stable price keeps an older date.

> **`product_type`.** Cards and sealed products are told apart using TCGPlayer data, then CardTrader. Tokens, emblems and oversized cards count as `"card"`. For the very few products whose type cannot be determined, `product_type` is `null`, not `"card"`.

> **CardMarket-only sets.** Sets with a negative `set_id` exist only on CardMarket: their cards have 64-character IDs and `tcgplayer: null`.

> **Missing links.** `cardmarket.product_url` is absent for some cards; the card data is still valid. Sets with no cards are not listed: they appear as soon as cards are added.

## Error Handling

The API uses standard HTTP status codes to indicate success or failure:

- **200 OK** — Request successful
- **400 Bad Request** — Invalid parameters or malformed request
- **401 Unauthorized** — Missing or invalid API key
- **403 Forbidden** — Paid endpoint without the required plan or an active trial: Pro for Pokémon and One Piece, Ultra for the other games. The body includes `redeem_url` (trial not activated yet) or `upgrade_url` (trial expired).
- **404 Not Found** — Card, set or image does not exist
- **405 Method Not Allowed** — The API only accepts `GET` requests.
- **409 Conflict** — `/sets/:setCode/image`: the set code matches several sets. Retry with `?language=` or the numeric `set_id`.
- **429 Too Many Requests** — Rate limit exceeded
- **500 Internal Server Error** — Something went wrong on our side
- **502 Bad Gateway** — An image could not be fetched from its source. Temporary: retry later.

### Errors on game endpoints (`/mtg`, `/ygo`, …)

| Status | `error` | When |
| --- | --- | --- |
| 400 | `Invalid or corrupted card ID` | ID is neither `<game>_…` nor 64 hex, or belongs to another game |
| 400 | `Query parameter required` | `q` missing, shorter than 2 or longer than 100 characters |
| 400 | `Search query rejected` | `q` contains SQL-like text: rephrase it |
| 400 | `Invalid or corrupted card ID` + `did_you_mean` | The ID belongs to another game (e.g. a `lor_…` ID on `/mtg/cards`): `did_you_mean` has the right path |
| 404 | `Set not found` + `suggestions` | No set with that `set_id`/`set_code`. If you wrote the set *name*, `suggestions` lists the matching sets with their `set_id` |
| 404 | `Card not found`, `Image not found` | Card or image does not exist |
| 502 | `Image not available` | Image source temporarily unreachable |
| 503 | `Search temporarily unavailable` | The search took too long under load. Retry after the seconds in the `Retry-After` header, or use more specific words |

### Error Response Format

Every error has `error` (short, stable) and `message` (what to fix). When the API can tell what you meant, `did_you_mean` contains the corrected path:

```
// GET /magic/sets
  {
    "error": "Endpoint not found",
    "message": "Did you mean /mtg/sets?",
    "did_you_mean": "/mtg/sets",
    "docs": "https://pokewallet.io/api-docs"
  }
```

Authentication errors (401) also include an `example` request. A trailing slash is ignored: `/sets/` and `/sets` are the same endpoint.

## Best Practices

### Use Environment Variables

Never hardcode API keys. Always use environment variables or secure secret management.

### Handle Rate Limits Gracefully

Implement exponential backoff when you receive a 429 response. Check rate limit headers to avoid hitting limits.

### Cache Results

Cache API responses when appropriate to reduce requests and improve performance.

### Use Search Endpoint

Always use `/search` for the most complete and accurate data.

### Monitor Your Usage

Check your dashboard regularly to track API usage and avoid unexpected rate limit hits.

### Error Handling

Always implement proper error handling for network failures, rate limits, and invalid responses.

> **Security Reminder:** Keep your API keys secure. If you suspect a key has been compromised, revoke it immediately from your dashboard and generate a new one.

## Digimon API FAQ

### Is there a free Digimon price API?

Yes. The free tier (100 requests/hour, 1,000/day) opens the Digimon sets, cards, search and images endpoints, with TCGPlayer and CardMarket prices refreshed daily. Prices by set, set statistics, completion value, trending sets and top cards need the Ultra plan (€29/month) or its 7-day trial.

### Does the Digimon API include CardMarket prices?

Yes. Cards return TCGPlayer (USD) prices for every finish and CardMarket (EUR) prices for normal and foil, where that market lists the card. Cards sold only on CardMarket have a 64-character hex id and no TCGPlayer price.

### How do I find the id of a Digimon card?

Search with /dgm/search?q=… or list a set with /dgm/sets/:set. Each card has an id (dgm_ + hex for cards on TCGPlayer) to pass to /dgm/cards/:id and /dgm/images/:id.

### Can I use the same API key for other games?

Yes. One PokéWallet API key works for all 12 games, Pokémon and One Piece included, and the rate limits are shared across them.

## Need Help?

If you have questions or run into issues, we're here to help!

[Go to Dashboard](https://pokewallet.io/dashboard)

[Contact Support](mailto:hello@pokewallet.io)

[Join Discord](https://discord.gg/znDxEjmDVP)
