# 17Lands — 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.

> Analyze Magic: The Gathering Arena draft performance by accessing card ratings, color win rates, trophy-winning decks, and competitive leaderboards from 17lands community data. Track which cards and archetypes perform best across different draft formats to optimize your deck-building strategy.

**Category:** Sports | **Website:** [17lands.com/](https://17lands.com/) | **Docs:** [parse.bot/marketplace/ec11a6a2-f101-4313-bdfa-6ce2cf183a43/17lands-com-api](https://parse.bot/marketplace/ec11a6a2-f101-4313-bdfa-6ce2cf183a43/17lands-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/17lands/`
**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 card ratings

Fetches per-card win rate statistics for a given set and format. Returns detailed performance metrics including seen/pick/play/win rates and drawn improvement for each card. Results cover all cards in the expansion unless filtered by color or rarity. Dates default to full available range when omitted.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `colors` | string | No | Filter by card colors (e.g. W, UB, WUBRG). Concatenated color letters. |
| `end_date` | string | No | End date for statistics in YYYY-MM-DD format. Defaults to today. |
| `expansion` | string | No | Expansion code (e.g. SOS, TMT, ECL, FDN, DFT). Available values from get_filters.expansions. |
| `format` | string | No | Format type (e.g. PremierDraft, TradDraft, QuickDraft, Sealed). Available values from get_filters.formats. |
| `rarity` | string | No | Filter by card rarity: common, uncommon, rare, or mythic. |
| `start_date` | string | No | Start date for statistics in YYYY-MM-DD format. |
| `user_group` | string | No | Filter by user skill group: top, middle, or bottom. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/17lands/get-card-ratings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"colors":"<string>","end_date":"<string>","expansion":"<string>","format":"<string>","rarity":"<string>","start_date":"<string>","user_group":"<string>"}'
```

### Get color ratings

Returns win/game records broken down by deck color combination. Includes mono-color, two-color, three-color, four-color, five-color, and splash variants. Summary rows aggregate categories. Useful for identifying the strongest archetypes in a format.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `combine_splash` | boolean | No | Whether to combine splash variants into their base color pair. |
| `end_date` | string | No | End date for statistics in YYYY-MM-DD format. Defaults to today. |
| `expansion` | string | No | Expansion code (e.g. SOS, TMT, ECL, FDN). Available values from get_filters.expansions. |
| `format` | string | No | Format type (e.g. PremierDraft, TradDraft, QuickDraft). |
| `start_date` | string | No | Start date for statistics in YYYY-MM-DD format. |
| `user_group` | string | No | Filter by user skill group: top, middle, or bottom. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/17lands/get-color-ratings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"combine_splash":"<boolean>","end_date":"<string>","expansion":"<string>","format":"<string>","start_date":"<string>","user_group":"<string>"}'
```

### Get filters

Returns all available expansions, formats, and other filter metadata for constructing queries to other endpoints. A singleton resource — no parameters required. Contains expansion codes, format names, color identifiers, user skill groups, start dates per expansion, and which formats are currently live.

**Estimated cost:** Metered

_No parameters required._

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

### Get leaderboard

Shows top-performing players ranked by multiple categories: total wins, win rate, trophies, trophy rate, and rank. Each category contains the top players sorted by that metric. Only returns data for active or recent expansions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `expansion` | string | No | Expansion code (e.g. SOS, TMT, ECL, FDN). Available values from get_filters.expansions. |
| `format` | string | No | Format type (e.g. PremierDraft, TradDraft, QuickDraft). |

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

### Get trophy decks

Lists 7-win (trophy) decklists for a given expansion and format. Returns the most recent trophy decks with color, rank, and record info. Only returns data for currently active or recent expansions. Filterable by player rank, deck colors, or specific cards.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `card_names` | string | No | Filter by specific cards in deck as a JSON array of strings. |
| `deck_colors` | string | No | Filter by deck color combinations as a JSON array of strings (e.g. ["WR", "UB"]). |
| `expansion` | string | No | Expansion code (e.g. SOS, TMT, ECL). Available values from get_filters.expansions. |
| `format` | string | No | Format type (e.g. PremierDraft, TradDraft, QuickDraft). |
| `ranks` | string | No | Filter by player ranks as a JSON array of strings (e.g. ["Diamond", "Mythic"]). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/17lands/get-trophy-decks \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"card_names":"<string>","deck_colors":"<string>","expansion":"<string>","format":"<string>","ranks":"<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.