# Brickset LEGO Set Database Scraper (`lulzasaur/brickset-scraper`) Actor

Scrape the Brickset LEGO set database. Search by keyword, theme or year and get set number, name, theme, pieces, minifigs, RRP, current value (new/used), ratings, packaging and more for 20K+ sets.

- **URL**: https://apify.com/lulzasaur/brickset-scraper.md
- **Developed by:** [lulz bot](https://apify.com/lulzasaur) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 lego set results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Brickset LEGO Set Database Scraper

Scrape [Brickset](https://brickset.com), the most comprehensive LEGO set database on the web. Search by keyword, browse by theme and/or release year, and get structured data for 20,000+ LEGO sets: set numbers, piece counts, minifig counts, retail prices (RRP), current aftermarket values (new & used), community ratings, and more.

### What data does it extract?

For every LEGO set:

| Field | Description |
|-------|-------------|
| `setNumber` | Official set number (e.g. `75192-1`) |
| `name` | Set name (e.g. `Millennium Falcon`) |
| `theme` / `subtheme` | Theme (e.g. Star Wars) and subtheme (e.g. Ultimate Collector Series) |
| `year` | Release year |
| `pieces` | Piece count |
| `minifigs` | Minifigure count |
| `rrp` / `rrpUsd` | Recommended retail price (raw + parsed USD) |
| `pricePerPiece` | Price per piece |
| `currentValueNewUsd` | Current aftermarket value, new/sealed |
| `currentValueUsedUsd` | Current aftermarket value, used |
| `rating` / `ratingsCount` / `reviewsCount` | Community rating (0-5) and counts |
| `packaging` | Box, polybag, etc. |
| `launchExit` | Launch and exit dates |
| `ownedBy` / `wantedBy` | How many collectors own / want the set |
| `image` / `url` | Set image and Brickset page URL |

With **Scrape Set Detail Pages** enabled, each set is enriched with: designer, age range, UPC/EAN barcodes, model & packaging dimensions, multi-currency RRP (GBP/USD/EUR), unique minifig count, theme group, category, and availability (e.g. LEGO exclusive).

### Input

```json
{
    "searchQueries": ["millennium falcon"],
    "themes": ["Star Wars", "Icons"],
    "years": [2024],
    "maxItems": 100,
    "scrapeDetails": false
}
```

- **searchQueries** — keyword searches (set names, numbers, characters)
- **themes** — exact Brickset theme names (`Star Wars`, `Technic`, `Harry Potter`, `City`, `Icons`, ...)
- **years** — release years; combine with themes to filter both
- **maxItems** — cap on total results
- **scrapeDetails** — visit each set page for extra fields (slower)

Provide any combination — themes only, years only, keywords only, or themes + years together.

### Output example

```json
{
    "setNumber": "30680-1",
    "name": "AAT",
    "theme": "Star Wars",
    "subtheme": "Episode I",
    "year": 2024,
    "pieces": 75,
    "minifigs": null,
    "rrp": "$4.99",
    "rrpUsd": 4.99,
    "pricePerPiece": "6.7c",
    "currentValueNewUsd": 4.26,
    "currentValueUsedUsd": 1.17,
    "rating": 3.5,
    "ratingsCount": 356,
    "reviewsCount": 2,
    "packaging": "Polybag",
    "launchExit": "1 Jan 2024 - 31 Dec 2024 (11m 30d)",
    "ownedBy": 11862,
    "wantedBy": 535,
    "image": "https://images.brickset.com/sets/small/30680-1.jpg",
    "url": "https://brickset.com/sets/30680-1/AAT"
}
```

### Use cases

- **LEGO investing** — compare RRP vs current new/used value to find appreciating sets
- **Price tracking** — monitor aftermarket values of retired sets
- **Collection tools** — build apps on top of structured LEGO set data
- **Market research** — analyze themes, piece counts, and price-per-piece trends by year
- **Reselling** — check current values and demand (owned/wanted counts) before buying or listing

### FAQ

**How is this different from a BrickLink scraper?** BrickLink is a marketplace (live listings and seller prices). Brickset is the canonical set *database* — catalog data, retail prices, community ratings, and aggregated current values per set.

**Do I need a Brickset API key?** No. This actor reads the public website; no account or API key required.

**How many results per run?** As many as you like — pagination is handled automatically (25 sets per page on Brickset).

# Actor input Schema

## `searchQueries` (type: `array`):

Keyword searches against the Brickset set database (e.g. 'millennium falcon', '75192', 'castle').

## `themes` (type: `array`):

LEGO themes to scrape (exact Brickset theme names, e.g. 'Star Wars', 'Technic', 'Harry Potter', 'Icons'). Combine with Years to filter both.

## `years` (type: `array`):

Release years to scrape (e.g. 2024). If Themes are also set, each theme is filtered by each year.

## `maxItems` (type: `integer`):

Maximum number of LEGO sets to return across all queries/themes/years.

## `scrapeDetails` (type: `boolean`):

Visit each set's detail page for extra fields: designer, age range, barcodes (UPC/EAN), model/packaging size, multi-currency RRP, unique minifig count, availability. Slower.

## `proxyConfiguration` (type: `object`):

Optional proxy. Brickset serves data without a proxy in most cases.

## Actor input object example

```json
{
  "searchQueries": [],
  "themes": [
    "Star Wars"
  ],
  "years": [],
  "maxItems": 25,
  "scrapeDetails": false
}
```

# Actor output Schema

## `dataset` (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 = {
    "searchQueries": [],
    "themes": [
        "Star Wars"
    ],
    "years": [],
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("lulzasaur/brickset-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 = {
    "searchQueries": [],
    "themes": ["Star Wars"],
    "years": [],
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("lulzasaur/brickset-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 '{
  "searchQueries": [],
  "themes": [
    "Star Wars"
  ],
  "years": [],
  "maxItems": 25
}' |
apify call lulzasaur/brickset-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lulzasaur/brickset-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/AErguwpbS7sAHrLRU/builds/subrTMCvH3e6YYDhc/openapi.json
