{
  "openapi": "3.0.1",
  "info": {
    "title": "LEGO Sets Scraper - PriceCharting",
    "description": "Scrape LEGO set prices from PriceCharting at 7 real conditions: Pieces Only, Pieces & Box, Pieces & Manual, Complete, New & Sealed, Box Only, Manual Only. Optional price history, set details and sold comps. Export CSV, Excel, JSON. No login or API key.",
    "version": "0.1",
    "x-build-id": "w4bbK83jnxvjLi6OP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~lego-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-lego-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/recordsdata~lego-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-lego-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/recordsdata~lego-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-lego-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchQueries": {
            "title": "Search by set name",
            "type": "array",
            "description": "Set names or keywords, for example \"millennium falcon\" or \"hogwarts castle\". Every word must appear in the set name or its theme; theme words narrow the search (\"star wars x-wing\" only reads LEGO Star Wars). PriceCharting's own search page is behind a bot challenge, so the actor reads the theme listings instead: searches that name no theme read the themes one after another, most popular first, and stop after Results per search, so a very rare name can take a few minutes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "setNumbers": {
            "title": "Set numbers",
            "type": "array",
            "description": "LEGO set numbers as printed on the box, for example 75192 or 10179 (a suffix such as -1 is ignored). Returns the first matching set. Add Themes to look only there and finish faster.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "productIds": {
            "title": "PriceCharting product IDs",
            "type": "array",
            "description": "Numeric PriceCharting IDs of single LEGO sets, as shown in the productId column or the Details table of a set page (for example 5863579 for Millennium Falcon 75192). IDs of other categories are reported as an error row, not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "themes": {
            "title": "Themes",
            "type": "array",
            "description": "LEGO themes to read in full, by name or slug: \"star wars\", \"LEGO Technic\", \"lego-harry-potter\", \"city\", or \"all\" for every theme (about 165, thousands of sets: set Max Items). When you also fill Search by set name or Set numbers, they only look inside these themes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "PriceCharting LEGO theme pages (for example pricecharting.com/console/lego-star-wars), single LEGO set pages (pricecharting.com/game/lego-star-wars/millennium-falcon-75192) or the theme index pricecharting.com/category/lego-sets. Theme pages are scraped set by set with automatic pagination.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResultsPerQuery": {
            "title": "Results per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many sets each search by name may return (a search stops reading themes once it has this many). Max Items still caps the whole run.",
            "default": 10
          },
          "maxScanSeconds": {
            "title": "Max scan seconds",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Searches by name and set numbers find sets by reading PriceCharting theme pages one after another. This caps the time spent waiting for those pages. Every delivered set adds 60 seconds, so a productive search is never cut short. When the cap is hit the run stops, keeps the sets already found and says how many themes it read; narrow the search with Themes or raise this number. Product IDs, URLs and Themes alone are not affected.",
            "default": 180
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of LEGO sets to return across all sources. In monitor mode it is the number of sets looked at, whether delivered or skipped. Free Apify users are limited to 10 sets per run; paid users can set up to 1,000,000.",
            "default": 10
          },
          "includePriceHistory": {
            "title": "Price history",
            "type": "boolean",
            "description": "Adds the full monthly price history for every completeness condition of each set. Billed as one price-history event per condition series returned.",
            "default": false
          },
          "includeSoldComps": {
            "title": "Sold comps",
            "type": "boolean",
            "description": "Adds recent eBay and TCGPlayer sold listings for each set, tagged with the condition they sold at (Pieces Only, Complete, New, Pieces & Manual), with the listing link and, for best-offer sales, the listed price. Billed as one sold-comps event per listing returned.",
            "default": false
          },
          "includeBoxAndManualSoldComps": {
            "title": "Sold comps for Box Only and Manual Only",
            "type": "boolean",
            "description": "Only works together with Sold comps. Also returns the sold listings of the Box Only and Manual Only tabs (up to about 30 more listings per set). Off keeps the original four conditions. Billed as one sold-comps event per listing returned.",
            "default": false
          },
          "includeSetDetails": {
            "title": "Set details",
            "type": "boolean",
            "description": "Adds genre, release date (also as an ISO date), model or set number, every UPC, ASIN, eBay ePID, notes, description and all photos for each set. Billed as one set-details event per set that has details.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only new or changed sets",
            "type": "boolean",
            "description": "Deliver only sets this same search did not return before, or whose price in any of the 7 conditions moved since. Unchanged sets are skipped and not billed. The memory is kept per search (sources and filters) in a key-value store of your own account.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional label for the monitor memory. Use a different label to run several independent monitors with identical settings. Leave empty to share the memory between runs of the same search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset monitor memory",
            "type": "boolean",
            "description": "Clear the stored list of already-seen sets and prices for this search (and Monitor name) before the run starts, so everything counts as new again.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}