# Mtggoldfish — 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.

> Access Magic: The Gathering metagame data from MTGGoldfish, including popular deck archetypes with popularity metrics, mana composition, and complete card lists. Retrieve metagame breakdowns by format and look up full deck lists by archetype or deck ID.

**Category:** Entertainment | **Website:** [mtggoldfish.com/](https://mtggoldfish.com/) | **Docs:** [parse.bot/marketplace/6af08928-687c-4c2d-aa30-b46fc50b1479/mtggoldfish-com-api](https://parse.bot/marketplace/6af08928-687c-4c2d-aa30-b46fc50b1479/mtggoldfish-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/mtggoldfish/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get archetype decks

Retrieves a list of recent deck IDs and pilot information for a specific archetype. Returns deck IDs, names, pilots, events, and URLs for recently played decks of that archetype. The path parameter is the archetype_url value from get_metagame results (without the fragment).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `path` | string | Yes | The URL path of the archetype on MTGGoldfish, obtainable from get_metagame archetype_url field (e.g. /archetype/modern-boros-energy). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/mtggoldfish/get-archetype-decks \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"path":"<string>"}'
```

### Get deck

Retrieves the full card list and details for a specific deck by its numeric ID. Returns the deck name, ID, and all cards grouped by section (Mainboard, Sideboard, etc.). Deck IDs can be obtained from get_archetype_decks results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `deck_id` | string | Yes | The numeric deck ID on MTGGoldfish, obtainable from get_archetype_decks results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/mtggoldfish/get-deck \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"deck_id":"<string>"}'
```

### Get metagame

Retrieves MTG metagame archetypes and their popularity statistics for a specific format. Returns archetype names, mana colors, meta share percentages, deck counts, and paper/online prices. Each archetype includes an archetype_url path that can be passed to get_archetype_decks to list recent decks.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `format` | string | No | The MTG format to fetch the metagame for. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/mtggoldfish/get-metagame \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"format":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.