# Cdkeys — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 digital game keys across thousands of titles, view product details, pricing, and discover best sellers and latest releases from CDKeys. Filter games by category, compare options, and stay updated on the newest game key listings available.

**Category:** E-commerce | **Website:** [cdkeys.com/](https://cdkeys.com/) | **Docs:** [parse.bot/marketplace/f6d0eb9f-3a87-4b9e-928c-d414bb408a5b/cdkeys-com-api](https://parse.bot/marketplace/f6d0eb9f-3a87-4b9e-928c-d414bb408a5b/cdkeys-com-api)

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

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/cdkeys/`
**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 best sellers

Retrieve current best-selling products ordered by 14-day sales volume descending. Returns paginated results. Useful for discovering trending and popular game keys.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results per page. |
| `page` | integer | No | Page number (0-indexed). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cdkeys/get-best-sellers \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","page":"<integer>"}'
```

### Get categories

Retrieve the category hierarchy for filtering products. Returns a list of category objects with path and product count. These category paths are used as input to list_products_by_category.

**Estimated cost:** Metered

_No parameters required._

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

### Get latest games

Retrieve the most recently released or upcoming game keys, sorted by release date descending. Includes pre-orders. Returns paginated results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results per page. |
| `page` | integer | No | Page number (0-indexed). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cdkeys/get-latest-games \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","page":"<integer>"}'
```

### Get product detail

Get full details for a specific product by SKU or slug. At least one must be provided. Returns the best matching product from the catalog including localized names, URLs, full multi-currency pricing, platform, region, language support, genres, and stock status.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `sku` | string | No | Product SKU (e.g. 'D/ELDRINPC', 'D/MNCJBEPC_WW'). |
| `slug` | string | No | Product slug from URL path (e.g. 'elden-ring-pc-steam', 'minecraft-java-bedrock-edition-pc-ww'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cdkeys/get-product-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"sku":"<string>","slug":"<string>"}'
```

### List products by category

List products within a specific category path. Use get_categories to discover valid category strings. Returns paginated results with 24 items per page. Products are sorted by the specified order.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | Yes | Full category path from get_categories (e.g. 'PC /// Games', 'Xbox /// Xbox Games', 'Nintendo /// Nintendo Games'). |
| `page` | integer | No | Page number (0-indexed). |
| `sort` | string | No | Sort order for results. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cdkeys/list-products-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>","page":"<integer>","sort":"<string>"}'
```

### Search products

Full-text search over CDKeys product catalog. Matches game titles and keywords. Supports filtering by platform and region, and sorting by relevance, price, or release date. Returns paginated results with 24 items per page. Each product includes localized names, URLs, pricing in 35+ currencies, platform, region, and stock status.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number (0-indexed). |
| `platform` | string | No | Platform filter (e.g. Steam, Windows, Xbox Play Anywhere, Rockstar Games, Microsoft, Nintendo). |
| `query` | string | Yes | Search query matching product titles (e.g. 'Elden Ring', 'GTA 5', 'minecraft'). |
| `region` | string | No | Region filter (e.g. Worldwide, Europe & UK, Europe Middle East and Africa, North America, UK). |
| `sort` | string | No | Sort order for results. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cdkeys/search-products \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","platform":"<string>","query":"<string>","region":"<string>","sort":"<string>"}'
```

## Next steps

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