# BrickLink — 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 the complete BrickLink LEGO catalog to find specific parts, sets, and minifigures, with pricing and availability data. Access wanted lists and explore the full color guide across all catalog items.

**Category:** Marketplaces | **Website:** [bricklink.com/](https://bricklink.com/) | **Docs:** [parse.bot/marketplace/64c86e4c-b1af-4273-bcca-edf353f07d75/bricklink-com-api](https://parse.bot/marketplace/64c86e4c-b1af-4273-bcca-edf353f07d75/bricklink-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/bricklink/`
**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 color guide

Retrieve the complete BrickLink color reference with per-color counts of available parts, sets containing that color, wanted-list demand, and for-sale inventory. Useful for discovering color IDs and assessing market depth by color.

**Estimated cost:** Metered

_No parameters required._

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

### Get item details

Retrieve detailed information for a single LEGO item by its catalog number, including its name, internal BrickLink ID, and a preview of up to 10 currently-for-sale listings with seller info and pricing. The item is looked up via exact match on item_no within the specified item_type.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `item_no` | string | Yes | Item number (e.g., '3001', '75192') |
| `item_type` | string | No | Item type: P (Parts), S (Sets), M (Minifigures), B (Books), G (Gear), C (Catalogs), I (Instructions), O (Original Boxes) |

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

### Get wanted list items

Get items in a specific wanted list by list ID. Requires valid session cookies.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `list_id` | string | No | Wanted list ID (0 for default) |

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

### Get wanted lists

List all wanted lists for the authenticated user. Requires valid session cookies.

**Estimated cost:** Metered

_No parameters required._

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

### List categories

List all catalog categories for a given item type. Returns category IDs and names that can be used to browse items by classification. Categories are returned in alphabetical order.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `item_type` | string | No | Item type: P (Parts), S (Sets), M (Minifigures), B (Books), G (Gear), C (Catalogs), I (Instructions), O (Original Boxes) |

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

### Search catalog

Full-text search across the BrickLink catalog by keyword. Returns up to 25 items per page with pricing and availability counts for new and used conditions. Results are scoped to one item_type at a time. Each result includes min prices and seller counts sufficient for comparison without a detail fetch.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `item_type` | string | No | Item type filter: P (Parts), S (Sets), M (Minifigures), B (Books), G (Gear), C (Catalogs), I (Instructions), O (Original Boxes) |
| `query` | string | Yes | Search keyword (e.g., 'brick 2x4', 'millennium falcon') |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/bricklink/search-catalog \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"item_type":"<string>","query":"<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.