# Moxfield — 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 retrieve Magic: The Gathering card data from Moxfield, including high-resolution card images, pricing, legalities, edition details, and metadata. Supports card name lookups, Scryfall syntax queries, and browsing curated card lists for deck building and collection management.

**Category:** Entertainment | **Website:** [moxfield.com/](https://moxfield.com/) | **Docs:** [parse.bot/marketplace/967626bc-292d-4555-a953-5a2b8e8d4d1e/moxfield-com-api](https://parse.bot/marketplace/967626bc-292d-4555-a953-5a2b8e8d4d1e/moxfield-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-moxfield-com-api-967626bc/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### discover_images

Combines the startup card list and broad type-based searches (creature, artifact, enchantment) to discover a large collection of card images across multiple card types. Returns over 1000 unique 488x680 px card images. No parameters required; useful for bulk image collection.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moxfield-com-api-967626bc/discover_images \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_card_details

Fetches full details for a specific card by its Moxfield card ID. Returns card images, pricing, legalities, editions, and other metadata. The card_id is obtained from search_card_images results (extracted from image URLs as the segment between 'card-' and '-normal').

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `card_id` | string | Yes | Moxfield card ID (alphanumeric string, e.g. 'Yn1Gp'). Obtained from search_card_images image_link URLs. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moxfield-com-api-967626bc/get_card_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"card_id":"<string>"}'
```

### get_startup_card_images

Retrieves card image URLs from the Moxfield startup card list. Returns all standard-resolution (488x680 webp) card images available in the anonymous startup payload. No parameters required; useful for bootstrapping a card image collection without a search query.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moxfield-com-api-967626bc/get_startup_card_images \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_user_decks

Fetches public decklists for a Moxfield user by username. Returns paginated deck metadata including name, format, colors, card counts, legality, and timestamps. Results are sorted by last updated date descending. The username filter is case-insensitive.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for paginated results. |
| `page_size` | integer | No | Number of decks per page (max 100). |
| `username` | string | Yes | Moxfield username to look up public decks for. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moxfield-com-api-967626bc/get_user_decks \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","page_size":"<integer>","username":"<string>"}'
```

### search_card_images

Searches for Magic: The Gathering cards by name or Scryfall syntax query and returns card image URLs. Handles multi-faced cards by returning separate image links for each face. Supports pagination. Returns total matching cards for client-side page calculation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for paginated results. |
| `page_size` | integer | No | Number of results per page (max 175). |
| `query` | string | No | Search query string. Supports Scryfall search syntax (e.g. 't:creature', 'c:blue', card names). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moxfield-com-api-967626bc/search_card_images \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","page_size":"<integer>","query":"<string>"}'
```
