# BrickEconomy LEGO Set Value Scraper (`lulzasaur/brickeconomy-scraper`) Actor

Scrape BrickEconomy for LEGO set secondary-market valuations: current/market value, retail price, growth %, annual growth, new/sealed & used prices, availability (retired/available), theme, pieces, minifigs and release year. Search by keyword.

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

## Pricing

from $10.00 / 1,000 dataset items

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?

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

## 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 BrickEconomy (e.g. 'millennium falcon', 'hogwarts castle', '75192'). Each query scrapes its search-results page.

## `maxResults` (type: `integer`):

Maximum number of LEGO sets to return across all queries.

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

Visit each set's detail page for extra fields: released date, price-per-piece, minifig value, market price and full Set Details. Slower.

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

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

## Actor input object example

```json
{
  "searchQueries": [
    "millennium falcon"
  ],
  "maxResults": 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": [
        "millennium falcon"
    ],
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("lulzasaur/brickeconomy-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": ["millennium falcon"],
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("lulzasaur/brickeconomy-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": [
    "millennium falcon"
  ],
  "maxResults": 25
}' |
apify call lulzasaur/brickeconomy-scraper --silent --output-dataset

```

## MCP server setup

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