# BrickLink — 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 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/get_color_guide \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/get_item_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/get_wanted_list_items \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/get_wanted_lists \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/list_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-bricklink-com-api-64c86e4c/search_catalog \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"item_type":"<string>","query":"<string>"}'
```
