# BrickLink Scraper \[$1.5/1K💰] | LEGO Prices | Market Data (`ahmed_jasarevic/bricklink-scraper`) Actor

Scrape BrickLink price guides for LEGO sets, parts and minifigures — 6-month sold data, current listings, monthly price history, seller counts and category signals. Built for LEGO price research, resale comps and collection valuation. $1.50 per 1,000 items.

- **URL**: https://apify.com/ahmed_jasarevic/bricklink-scraper.md
- **Developed by:** [Ahmed Jasarevic](https://apify.com/ahmed_jasarevic) (community)
- **Stats:** 2 total users, 1 monthly users, 33.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## BrickLink Scraper

Extract BrickLink catalog data and market price guides — current for-sale prices, six-month sales history and seller counts for any LEGO set, part or minifigure — from item numbers, product URLs or search URLs, with no browser and no API key.

**Built for:**

- LEGO price guide data for investing, valuation and resale decisions
- BrickLink store pricing and competitor analysis
- Building a LEGO market database (sets, parts, minifigures, books)
- Arbitrage screening across current listings and recent sales
- Parting-out cost estimation before buying a set

### LEGO Price Guide Data for Investing & Market Research

BrickLink is the world's largest online LEGO marketplace, and its price guide is the reference for market value: what items sell for (last six months of sales) and what sellers ask right now. This actor returns one row per catalog item with both sides of that market — `marketPrices.new/used` (current for-sale min, average, quantity-average and max, total lots and quantity), `sold6m.new/used` (times sold, quantity, min/avg/max price) and `salesHistory6m` (month-by-month sold history with per-month aggregates) — plus catalog identity (name, category breadcrumb, release year, image), seller counts, for-sale quantities and wanted-list interest. Prices come back in USD.

### How It Works

![How the BrickLink Scraper works: item IDs become catalog rows with new and used pricing plus six months of sold history.](https://api.apify.com/v2/key-value-stores/oeuA0kLOyhbRM4fzt/records/how-it-works-bricklink.webp)

The Actor reads the server-rendered catalog page and the same price-guide fragment the site's Price Guide tab calls. It normalizes current new and used lots alongside six months of sold quantities and monthly price history.

Each row covers one set, part, minifigure or other catalog item with its category, release year, image, market statistics and source URL. Use it to value collections and compare resale spreads.

1. The catalog item page is fully server-rendered legacy HTML with an inline JavaScript object (item id, type, number, name, image) — parsed with Cheerio, no headless browser.
2. Market data comes from the server-rendered price-guide fragment that the site's own Price Guide tab calls — fetched directly as plain HTML and parsed into structured statistics (6-month sold NEW/USED + current for-sale NEW/USED + monthly history).
3. Search URLs are expanded through BrickLink's own search JSON endpoint (1 lightweight request per 100 results); query, type tab, filters and page from your URL are honored and every matching catalog item is scraped.
4. Product URLs (current `catalogitem.page` and legacy variants) are normalized to the compact v2 request; parts use their default color (or your `ColorID`) so price-guide responses stay small.
5. Each item produces one dataset row; invalid item numbers produce an `error` row instead of crashing the run.

### Input Parameters

| Field | Type | Required | Default | Notes |
| --- | --- | --- | --- | --- |
| `items` | array | No\* | — | BrickLink items to scrape. Accepts bare item numbers (auto-typed: `10294-1` = Set, `3001` = Part, `hp001` = Minifig), explicit type queries (`S=10294-1`, `P=3001&ColorID=11`, `M=hp001`, `B=bk1989spr`), product URLs and search URLs (`…/v2/search.page?q=star+wars#T=S`, expanded automatically). Provide at least one entry for a useful run. |
| `maxRequestsPerCrawl` | integer | No | `200` | HTTP request cap (2–5,000). Each item costs 2 requests (catalog page + price guide); a search URL costs 1 request per 100 results. Default 200 ≈ 100 items. |
| `proxy` | object | No | disabled | Standard Apify proxy picker — enable only if BrickLink starts rate-limiting your IP. |

Free-plan runs are capped at **10 items**.

### Output Fields

Dataset fields (per `.actor/dataset_schema.json`, with nesting per the actor's field docs):

| Field | Type | Contents |
| --- | --- | --- |
| `itemNumber` | string | e.g. `10294-1` |
| `itemType` | string | `S`, `P`, `M`, `B`, `C`, `G`… |
| `name` | string | Item name |
| `category` | string | Full catalog breadcrumb (e.g. `Sets > Icons > Harbor`) |
| `imageUrl` | string | Main catalog image on img.bricklink.com |
| `yearReleased` | string | Release year |
| `marketPrices` | object | `.new` / `.used` — current for-sale `totalLots`, `totalQty`, `minPrice`, `avgPrice`, `qtyAvgPrice`, `maxPrice` |
| `sellerCounts` | object | `newLots`, `usedLots`, `totalLots` |
| `quantities` | object | `forSaleNew`, `forSaleUsed`, `sold6mNew`, `sold6mUsed` |
| `sold6m` | object | `.new` / `.used` — `timesSold`, `totalQty`, `minPrice`, `avgPrice`, `qtyAvgPrice`, `maxPrice` |
| `salesHistory6m` | object | `.new` / `.used` — array of months: `month`, `salesCount`, `totalQty`, `minPrice`, `maxPrice`, `avgPrice`, plus raw sale `rows` (capped at 100/month) |
| `sourceUrl` | string | Catalog page URL |
| `scrapedAt` | string | Extraction timestamp |
| `error` | string | Present only when an item lookup failed |

Additional documented fields in rows: `itemTypeName` (`Set`/`Part`/`Minifigure`…), `itemId` (internal id), `categoryPath`, `lotsForSale`, `wantedListCount`, `priceGuideUrl`.

### Example Input

```json
{
  "items": ["10294-1", "3001", "hp001", "https://www.bricklink.com/v2/search.page?q=star+wars#T=S"],
  "maxRequestsPerCrawl": 200
}
```

### Example Output

```json
{
  "itemNumber": "10294-1",
  "itemType": "S",
  "itemTypeName": "Set",
  "name": "Titanic",
  "category": "Sets > Icons (Creator Expert & Advanced Models) > Harbor",
  "yearReleased": "2021",
  "imageUrl": "https://img.bricklink.com/ItemImage/SN/0/10294-1.png",
  "marketPrices": {
    "new":  { "totalLots": 71, "totalQty": 88, "minPrice": 570.83, "avgPrice": 926.56, "qtyAvgPrice": 912.69, "maxPrice": 1575.41 },
    "used": { "totalLots": 20, "totalQty": 21, "minPrice": 380.0,  "avgPrice": 661.26, "qtyAvgPrice": 647.87, "maxPrice": 1125.3 }
  },
  "sellerCounts": { "newLots": 71, "usedLots": 20, "totalLots": 91 },
  "quantities": { "forSaleNew": 88, "forSaleUsed": 21, "sold6mNew": 27, "sold6mUsed": 10 },
  "sold6m": { "new": { "timesSold": 27, "totalQty": 27, "minPrice": 316.12, "avgPrice": 575.63, "qtyAvgPrice": 575.63, "maxPrice": 1129.08 } },
  "salesHistory6m": { "new": [ { "month": "October 2026", "salesCount": 3, "totalQty": 3, "minPrice": 510.7, "maxPrice": 569.61, "avgPrice": 550.0, "rows": [ { "qty": 1, "price": 510.7 } ] } ] },
  "sourceUrl": "https://www.bricklink.com/v2/catalog/catalogitem.page?S=10294-1",
  "scrapedAt": "2026-10-19T12:00:00.000Z"
}
```

### Automate LEGO Price Monitoring With Schedules & Webhooks

- **Weekly portfolio valuation:** schedule a run over your holdings' item numbers and diff `marketPrices` / `sold6m` week over week to track value and liquidity.
- **New-set tracking:** run search URLs (`v2/search.page?q=…`) weekly to discover newly listed catalog matches and their opening prices.
- **Webhooks:** pipe completed-run datasets into spreadsheets or inventory tools via dataset webhooks or the Apify API; `error` rows flag items that need a manual look.
- Scheduled recurring runs also improve this actor's Store recommendation signals.

### Related Actors

- [BrickLink LEGO Part & Minifig Price Guide Scraper](https://apify.com/jungle_synthesizer/bricklink-lego-part-minifig-price-scraper) — price-guide focus on parts and minifigures.
- [BrickLink Scraper — LEGO Catalog & Price Guide](https://apify.com/jongoose/bricklink-scraper) — closest direct alternative.
- [BrickLink LEGO Marketplace Scraper](https://apify.com/lulzasaur/bricklink-scraper) — another BrickLink-focused option for redundancy.
- [Lego Product Catalog](https://apify.com/fortuitous_pirate/lego-product-catalog) — official-side LEGO product catalog data without login.
- [BrickOwl Parts & Sets](https://apify.com/bakos_bence/brickowl-catalog) — catalog data from BrickOwl, the main alternative LEGO marketplace.

### Frequently Asked Questions

#### Why use this actor instead of the official API?

BrickLink does have an official API, but it is built for store automation, not bulk market research: you must register a consumer key, sign every request with OAuth 1.0, bind access tokens to registered static IP addresses, and BrickLink's API Terms prohibit calling endpoints that are not part of the public API — with a default ceiling of about 5,000 calls per day. This actor needs no key, no registration and no IP binding: it fetches each item's catalog page and price-guide data, expands search URLs, parses the six-month sales history into one structured row per item, and charges a flat per-result price with a free-plan preview of 10 items.

#### Is there a BrickLink API?

Yes. BrickLink's official API (api.bricklink.com) exposes store and catalog resources — including a price-guide endpoint — under OAuth consumer credentials with static-IP access tokens and roughly 5,000 calls per day by default. It is free to apply for but geared toward store integration; for research-style bulk extraction with search-URL expansion and monthly sales history parsing, use an actor like this one.

#### What are the alternatives to this data source?

- **Official BrickLink API** — per-item price guide via OAuth if you only need a handful of lookups and can manage credentials.
- **BrickOwl** — the sister LEGO marketplace with its own catalog (an actor exists, linked above).
- **Rebrickable** — set inventories and part lists rather than prices.
- **Other Apify actors** — the BrickLink and LEGO scrapers linked under Related Actors.

#### How do I get LEGO price data programmatically?

Three practical routes: the official BrickLink API price-guide endpoint (OAuth + IP registration), third-party LEGO catalog APIs, or this actor — give it item numbers or a BrickLink search URL and receive current prices, six-month sales and monthly history as JSON/CSV, without any credentials.

#### Which prices does the actor return — current listings or actual sales?

Both, in one row: `marketPrices` reflects what sellers ask right now (Current Items for Sale), while `sold6m` and `salesHistory6m` reflect completed sales over the last six months — BrickLink's two price-guide halves. All prices are returned in USD.

#### Can it scrape a whole BrickLink search result?

Yes — paste the search URL; the actor expands it through BrickLink's search endpoint (query, type tab and filters honored) and scrapes every matching catalog item, bounded by `maxRequestsPerCrawl`. Store lots (custom items) are skipped; only catalog matches are scraped.

### For AI Agents & LLM Apps

**Purpose:** returns BrickLink catalog rows with structured price-guide statistics (current for-sale prices, 6-month sales, monthly history, seller counts) for sets, parts and minifigures — keyless.

**Minimal input:**

```json
{ "items": ["10294-1", "3001", "hp001"] }
```

**Search-expansion mode:**

```json
{ "items": ["https://www.bricklink.com/v2/search.page?q=star+wars#T=S"], "maxRequestsPerCrawl": 400 }
```

**Output fields:** itemNumber, itemType, itemTypeName, name, category, imageUrl, yearReleased, marketPrices, sellerCounts, quantities, sold6m, salesHistory6m, sourceUrl, scrapedAt, error.

**Behaviors an agent should know:**

- Every item costs exactly 2 HTTP requests (catalog page + price guide); search URLs add 1 request per 100 results — size `maxRequestsPerCrawl` accordingly (default 200 ≈ 100 items).
- Free-plan runs are capped at 10 items regardless of input size.
- Bare numbers are auto-typed (`10294-1` → Set, `3001` → Part, `hp001` → Minifig); use `P=3001&ColorID=11` for a specific part color — parts default to BrickLink's default color otherwise.
- Items with no sales and no listings still return a row with `null` price statistics; invalid item numbers return an `error` row — neither aborts the run.
- All prices are USD (the price-guide request pins `currency=1`).

**Billing:** pay-per-event — `result` at $0.0015 per result row; free-plan preview runs are uncharged.

### Legal & Compliance Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, or sponsored by BrickLink, the LEGO Group, or any of their brands; LEGO® is a trademark of the LEGO Group. It accesses only publicly accessible catalog and price-guide pages with plain HTTP requests — no account login, and no CAPTCHA interaction. Output is public marketplace information (catalog records and price statistics). Users are responsible for their own compliance with BrickLink's Terms of Service and API terms when storing, republishing or automating access to the extracted data.

### SEO Keywords

bricklink scraper, bricklink api, bricklink price guide, lego price guide, lego price data, lego market data, lego set values, lego investing data, lego catalog data, bricklink alternative, lego minifig prices, lego part prices, lego price history, used lego prices, bricklink search scraper, lego price tracker, bricklink data export, lego resale data, lego price statistics, bricklink scraper api

# Actor input Schema

## `items` (type: `array`):

BrickLink catalog items. Accepts: bare item numbers (auto-detects type: '10294-1' = Set, '3001' = Part, 'hp001' = Minifig), explicit type queries ('S=10294-1', 'P=3001\&ColorID=11', 'M=hp001', 'B=bk1989spr' = Book), product URLs ('https://www.bricklink.com/v2/catalog/catalogitem.page?S=10294-1'), and search URLs ('https://www.bricklink.com/v2/search.page?q=star+wars#T=S') whose results are expanded automatically.

## `maxRequestsPerCrawl` (type: `integer`):

Maximum number of HTTP requests. Each item costs 2 requests (catalog page + price guide); each search URL costs 1 request per 100 search results on top of the 2 per result item.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "items": [
    "10294-1",
    "10303-1",
    "3001",
    "hp001"
  ],
  "maxRequestsPerCrawl": 200,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "items": [
        "10294-1",
        "10303-1",
        "3001",
        "hp001"
    ],
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmed_jasarevic/bricklink-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "items": [
        "10294-1",
        "10303-1",
        "3001",
        "hp001",
    ],
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("ahmed_jasarevic/bricklink-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "items": [
    "10294-1",
    "10303-1",
    "3001",
    "hp001"
  ],
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call ahmed_jasarevic/bricklink-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ahmed_jasarevic/bricklink-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/PbRCgcN5ZutYirqBa/builds/0sQYXolm9rUaLZtyP/openapi.json
