# LEGO Sets Scraper - PriceCharting (`punkrecordsdata/lego-scraper`) Actor

Scrape real LEGO set prices by completeness condition (Pieces Only, Pieces & Box, Pieces & Manual, Complete, New & Sealed, Box Only, Manual Only), price history, set details and sold comps from PriceCharting.com.

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

## Pricing

from $5.00 / 1,000 price records

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?

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

<p align="center">
  <img src="https://api.apify.com/v2/key-value-stores/AAm3a1h3Z9nYfrvh9/records/banner" alt="PunkRecordsData" width="100%" />
</p>

## 🧱 LEGO Sets Scraper - Real Condition Prices

> 🚀 **Get real LEGO set prices by completeness condition, not a generic single number.** Scrape Pieces Only, Pieces & Box, Pieces & Manual, Complete, New & Sealed, Box Only and Manual Only prices from PriceCharting.com.

The **LEGO Sets Scraper** extracts market values for LEGO sets from [PriceCharting.com](https://www.pricecharting.com/category/lego-sets). LEGO sets are priced by how complete they are, not by a numeric grade, this actor reads all 7 real price points PriceCharting tracks per set, plus optional price history, set details and sold comps.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| LEGO collectors & investors | Track a collection's value by completeness over time |
| Resellers & flippers | Spot the pieces-only-to-new spread worth completing a set for |
| Retro toy stores | Automate inventory valuation for used and sealed sets |
| Data analysts | Build price trend models across themes and years |

### 📋 What the LEGO Sets Scraper does

> 💡 **Why it matters:** a loose Millennium Falcon UCS set and a factory-sealed one can differ by 2-3x in price, and "Pieces & Box" or "Pieces & Manual" (missing just one component) sit at real, distinct price points in between. Most scrapers targeting this site expose a single flattened price; this one reads every real condition the site tracks.

Point it at a theme listing page (e.g. `/console/lego-star-wars`) or a single set URL, and it extracts the current price at every real completeness condition, plus three optional enrichments: full price history, set details, and sold comps, each tagged with the real condition.

### 📊 Output

Each record contains:

| Field | Description |
|---|---|
| `title` | Set name (e.g., "Millennium Falcon #75192") |
| `url` | Full PriceCharting product URL |
| `piecesOnly` | All pieces, no box or manual ($) |
| `piecesAndBox` | Pieces + box, no manual ($) |
| `piecesAndManual` | Pieces + manual, no box ($) |
| `complete` | Pieces + box + manual ($) |
| `new` | New & sealed in box ($) |
| `boxOnly` | Box only ($) |
| `manualOnly` | Manual only ($) |
| `scrapedAt` | ISO timestamp of scrape |
| `setDetails` | (optional) Genre, release date, model/set number, notes |
| `priceHistory` | (optional) Monthly price arrays per condition |
| `soldComps` | (optional) Recent sold listings, tagged with the condition they sold at |

**Example output** (real set, real prices, 2026-09-15):

```json
{
  "title": "Millennium Falcon #75192",
  "url": "https://www.pricecharting.com/game/lego-star-wars/millennium-falcon-75192",
  "piecesOnly": 267.93,
  "piecesAndBox": 357.93,
  "piecesAndManual": 323.00,
  "complete": 550.00,
  "new": 700.00,
  "boxOnly": 90.00,
  "manualOnly": 55.46,
  "scrapedAt": "2026-09-15T05:38:37.000Z"
}
```

### ✨ Why choose this Actor

- **7 real price points, not one flattened number**, including "Pieces & Box" and "Pieces & Manual," conditions most scrapers of this site never separate out
- **Real sold-comps tagging**, recent sales tagged by the actual condition they sold at (Pieces Only, Complete, New, Pieces & Manual), not lumped together
- **Full theme coverage**, works on any of PriceCharting's ~150 LEGO theme listings (Star Wars, City, Technic, Harry Potter, Ninjago, and more) via `/category/lego-sets`
- **Pay only for what you use**, 4 independent billable events, each optional except the base price record

### 🚀 How to use

1. **Create a free Apify account** at [console.apify.com/sign-up](https://console.apify.com/sign-up), you get $5 credit monthly.
2. **Open the LEGO Sets Scraper** in Apify Console.
3. **Add start URLs**, paste a theme listing or a single set URL:
   - `https://www.pricecharting.com/console/lego-star-wars`
   - `https://www.pricecharting.com/game/lego-star-wars/millennium-falcon-75192`
4. **Set max items**, how many sets to scrape (free tier caps at 10).
5. **Toggle the extras you need**, Price history, Sold comps, Set details, each is billed only when enabled.
6. **Click Start**, results appear in the Output tab within minutes.
7. **Download** as JSON, CSV, Excel, or XML.

### 💼 Business use cases

#### Completion ROI analysis

Compare Pieces Only against Complete and New prices to decide whether hunting down a missing box or manual is worth it.

#### Collection valuation by condition

Track a mixed collection's real market value instead of a single flattened per-set estimate.

#### Resale sourcing

Resellers can compare Pieces Only listings against Complete/New resale value to find sets worth restoring.

#### Theme-wide market research

Scrape an entire theme listing to compare condition premiums across every set in Star Wars, Technic, Harry Potter, etc.

### 🔌 Automating LEGO Sets Scraper

- **Make.com / Zapier**, Schedule weekly scrapes and push results to Google Sheets
- **Slack**, Get notified when a set's New price crosses a threshold
- **Airbyte**, Feed condition-level pricing into your data warehouse
- **GitHub Actions**, Automate scrapes on a cron schedule

### 🌟 Beyond business use cases

- **Personal collection tracking**, know exactly what your built and sealed sets are worth
- **Academic research**, study how completeness premiums vary across LEGO themes and release years
- **Non-profit fundraising**, value donated LEGO collections for charity auctions

### 🤖 Ask an AI assistant about this scraper

Ask questions about how to use this scraper, what data it extracts, or how to integrate it with your workflow. The AI assistant has full context about the actor's capabilities.

### ❓ Frequently Asked Questions

#### Why 7 price points instead of one?

PriceCharting tracks LEGO sets by completeness, not by a single resale value. A set missing its box or manual sells for a real, different price than a complete one, and this actor exposes each of those 7 conditions.

#### What is "Pieces & Box" vs "Pieces & Manual"?

Two distinct, common resale states: a set with all its pieces and original box but no instructions, or all pieces and the manual but no box. Both are real market segments on PriceCharting, tracked separately from "Complete" (all three) and "Pieces Only" (none of the extras).

#### How does pricing work?

The base `price-record` event bills per set scraped. Enable Price history, Sold comps, and/or Set details for additional data at extra per-event cost. Free users get 10 sets per run.

#### Is scraping PriceCharting legal?

This actor scrapes publicly available pricing data. Respect PriceCharting's terms of service and use the data responsibly.

#### Can I scrape individual set pages?

Yes, paste any `https://www.pricecharting.com/game/lego-.../...` set URL directly into the start URLs.

#### What happens if I hit the free tier limit?

The actor caps output at 10 items for free users. Upgrade to a paid plan for up to 1,000,000 items.

#### Does it work with PriceCharting's search?

Not currently, search is protected by Cloudflare. Use direct theme/set URLs instead.

#### Can I schedule recurring scrapes?

Yes, use Apify's Scheduler to run the actor daily, weekly, or on any cron schedule.

#### What are "sold comps"?

Recent eBay/TCGPlayer sold listings PriceCharting tracks per condition. This actor tags each comp with the real condition it sold at (Pieces Only, Complete, New, Pieces & Manual).

### 🔌 Integrate with any app

The actor outputs JSON datasets that work with virtually any tool: Google Sheets, Airtable, Notion, databases (PostgreSQL, MongoDB), data pipelines (Airbyte, Fivetran), and more. Use the Apify API to pull data programmatically.

### 🔗 Recommended Actors

- [Prediction Markets Scraper](https://apify.com/punkrecordsdata/prediction-markets-scraper), Kalshi & Polymarket odds
- [MercadoLibre Scraper](https://apify.com/punkrecordsdata/mercadolibre-scraper), Latin American marketplace listings
- [SofaScore Scraper](https://apify.com/punkrecordsdata/sofascore-match-stats-scraper), Live sports match statistics

> 💡 **Pro Tip:** browse the complete [PunkRecordsData collection](https://apify.com/punkrecordsdata).

**🆘 Need Help?** contact.punkrecordsdata@gmail.com

> **⚠️ Disclaimer:** independent tool, not affiliated with PriceCharting or LEGO; only publicly available data.

# Actor input Schema

## `startUrls` (type: `array`):

LEGO theme listing pages (e.g. pricecharting.com/console/lego-star-wars) or individual set pages from pricecharting.com.

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

Free users: limited to 10 items (preview). Paid users: optional, max 1,000,000.

## `includePriceHistory` (type: `boolean`):

Full historical monthly price series for every completeness condition.

## `includeSoldComps` (type: `boolean`):

Recent eBay/TCGPlayer sold listings, tagged with the real condition they sold at (Pieces Only, Complete, New, Pieces & Manual).

## `includeSetDetails` (type: `boolean`):

Genre, release date, model/set number, and notes.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.pricecharting.com/console/lego-star-wars"
    }
  ],
  "maxItems": 10,
  "includePriceHistory": false,
  "includeSoldComps": false,
  "includeSetDetails": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Key fields: set, URL, price by condition

## `fullData` (type: `string`):

Complete dataset including set details, price history and sold comps

# 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 = {
    "startUrls": [
        {
            "url": "https://www.pricecharting.com/console/lego-star-wars"
        }
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("punkrecordsdata/lego-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 = {
    "startUrls": [{ "url": "https://www.pricecharting.com/console/lego-star-wars" }],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("punkrecordsdata/lego-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 '{
  "startUrls": [
    {
      "url": "https://www.pricecharting.com/console/lego-star-wars"
    }
  ],
  "maxItems": 10
}' |
apify call punkrecordsdata/lego-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,punkrecordsdata/lego-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/h2G5QaZujxuv9tltc/builds/6qoV2DQTN3ZsZh6e0/openapi.json
