{
  "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": "4Z2VpJGUH7c7FPbbJ"
  },
  "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). Rare names can take a few minutes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "setNumbers": {
            "title": "Set numbers",
            "type": "array",
            "description": "Numbers printed on the box, for example 75192 or 10179 (a suffix such as -1 is ignored). Returns the first matching set. Add Themes to finish faster.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "themes": {
            "title": "Themes (read in full, or narrow your search)",
            "type": "array",
            "description": "Theme names or slugs, for example \"star wars\", \"LEGO Technic\", \"city\", or \"all\" (about 165 themes, thousands of sets: set Max items). If you also fill name or number searches, they only look inside these themes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "PriceCharting links",
            "type": "array",
            "description": "Theme pages (pricecharting.com/console/lego-star-wars), single set pages (pricecharting.com/game/lego-star-wars/millennium-falcon-75192) or the theme index pricecharting.com/category/lego-sets. Theme pages are paged automatically.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "productIds": {
            "title": "PriceCharting product IDs",
            "type": "array",
            "description": "Numeric IDs of single LEGO sets, for example 5863579 (Millennium Falcon 75192), shown in the Details table of a set page. IDs of other categories return an error row, not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items (sets)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum LEGO sets across all sources. In monitor mode it counts sets looked at, delivered or skipped. Free plan: 10 sets per run. Paid plans: up to 1,000,000.",
            "default": 10
          },
          "maxResultsPerQuery": {
            "title": "Sets per name search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many sets each name search may return, for example 10. A search stops reading themes once it has this many. Max items still caps the whole run.",
            "default": 10
          },
          "maxScanSeconds": {
            "title": "Max scan time for name and number searches (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Caps the time spent reading theme pages for name and number searches. Each delivered set adds 60 seconds. When hit, the run keeps the sets found so far; narrow with Themes or raise this. Links, IDs and Themes alone are not affected.",
            "default": 180
          },
          "includePriceHistory": {
            "title": "Add monthly price history",
            "type": "boolean",
            "description": "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": "Add recent sold listings",
            "type": "boolean",
            "description": "Recent eBay and TCGPlayer sales per set, tagged with the condition (Pieces Only, Complete, New, Pieces & Manual), with link and best-offer price. Billed as one sold-comps event per listing.",
            "default": false
          },
          "includeBoxAndManualSoldComps": {
            "title": "Also Box Only and Manual Only sold listings (needs sold listings)",
            "type": "boolean",
            "description": "Needs 'Add recent sold listings' on. Adds up to about 30 more listings per set from the Box Only and Manual Only tabs. Billed as one sold-comps event per listing.",
            "default": false
          },
          "includeSetDetails": {
            "title": "Add set details",
            "type": "boolean",
            "description": "Genre, release date (also ISO), set number, every UPC, ASIN, eBay ePID, notes, description and all photos. Billed as one set-details event per set that has details.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only new or changed sets",
            "type": "boolean",
            "description": "Delivers only sets this search did not return before, or whose price in any of the 7 conditions moved. Unchanged sets are skipped and not billed. Memory is kept per search in a key-value store of your account.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Label for the monitor memory, for example star-wars-weekly. Use different labels to run several independent monitors with identical settings. Empty shares memory between runs of the same search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset monitor memory",
            "type": "boolean",
            "description": "Clears the list of seen sets and prices for this search before the run, 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}