# Card Kingdom — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and browse Magic: The Gathering cards with real-time pricing and availability from Card Kingdom, including buylist prices and current deals. Find card details across all editions and filter by format to discover the best prices across the full catalog.

**Category:** E-commerce | **Website:** [cardkingdom.com/](https://cardkingdom.com/) | **Docs:** [parse.bot/marketplace/28ef2d32-2e57-443f-8417-b36d47502935/cardkingdom-com-api](https://parse.bot/marketplace/28ef2d32-2e57-443f-8417-b36d47502935/cardkingdom-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_buylist_prices

Retrieve buylist (sell-to-Card Kingdom) prices for cards. Shows cash and store credit buy prices.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `edition` | string | No | Filter by set name |
| `page` | integer | No | Page number for pagination |
| `query` | string | No | Search keyword for card name (e.g. 'Mox') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/get_buylist_prices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"edition":"<string>","page":"<integer>","query":"<string>"}'
```

### get_card_detail

Get full details for a specific card listing including all conditions with prices and other available versions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | The path of the card detail page (e.g. /mtg/beta/lightning-bolt) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/get_card_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### get_deals

Get current discounted deals and on-sale products from Card Kingdom.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/get_deals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>"}'
```

### get_formats

Get a list of all game formats and their IDs from Card Kingdom.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/get_formats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_all_editions

List all available MTG editions/sets with their slugs and URLs.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/list_all_editions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_cards

Search for Magic: The Gathering cards by name, edition, and format. Returns paginated results with pricing and condition availability.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `edition` | string | No | Filter by card set/edition name |
| `format` | string | No | Filter by tournament format: Commander, Legacy, Modern, Pauper, Vintage, Pioneer, Brawl, Standard, Premodern |
| `page` | integer | No | Page number for pagination |
| `query` | string | No | Search keyword for card name (e.g. 'Lightning Bolt') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cardkingdom-com-api-28ef2d32/search_cards \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"edition":"<string>","format":"<string>","page":"<integer>","query":"<string>"}'
```
