{
  "openapi": "3.0.1",
  "info": {
    "title": "BrickEconomy Scraper",
    "description": "Scrape BrickEconomy LEGO sets and minifigs: current value new and used, growth, annual growth, 1 and 5 year forecasts, retirement dates and predictions, eBay and BrickLink prices, UPC/EAN, regional retail prices and full price history. For LEGO investors and resellers.",
    "version": "1.0",
    "x-build-id": "rCuznJXtSVhhQJhPW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/normdata~brickeconomy-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-normdata-brickeconomy-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/normdata~brickeconomy-scraper/runs": {
      "post": {
        "operationId": "runs-sync-normdata-brickeconomy-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/normdata~brickeconomy-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-normdata-brickeconomy-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": {
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many sets or minifigs in total. Leave empty for no limit. The Apify Free plan is always capped at 10."
          },
          "itemType": {
            "title": "Sets or minifigs",
            "enum": [
              "sets",
              "minifigs"
            ],
            "type": "string",
            "description": "Scrape LEGO sets or LEGO minifigures.",
            "default": "sets"
          },
          "searchTerms": {
            "title": "Search terms or numbers",
            "type": "array",
            "description": "Set numbers (\"75192\" or \"75192-1\"), minifig numbers (\"sw0001\") or words (\"Millennium Falcon\", \"Hogwarts\"). Words search BrickEconomy like its search box. One per line.",
            "items": {
              "type": "string"
            }
          },
          "themes": {
            "title": "Themes",
            "type": "array",
            "description": "A theme like \"Star Wars\", or a subtheme as \"Star Wars / Ultimate Collector Series\". On their own they list every set of the theme; with search terms or a collection they filter those instead. One per line.",
            "items": {
              "type": "string"
            }
          },
          "years": {
            "title": "Years",
            "type": "array",
            "description": "Release years like \"2020\". On their own (or with themes) they list the sets of those years; with search terms or a collection they filter those instead.",
            "items": {
              "type": "string"
            }
          },
          "collection": {
            "title": "Collection",
            "enum": [
              "none",
              "retiring-soon",
              "new",
              "retired",
              "available-soon"
            ],
            "type": "string",
            "description": "One of BrickEconomy's lists. Themes and years above then filter it.",
            "default": "none"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "default",
              "value",
              "valueLow",
              "growth",
              "annualGrowth",
              "lastYearGrowth",
              "forecast2Years",
              "forecast5Years",
              "usedValue",
              "retailPrice",
              "retailPriceLow",
              "pieces",
              "newest",
              "oldest",
              "recentlyRetired"
            ],
            "type": "string",
            "description": "Order of theme, year and search lists (the order results are saved in, so it decides which come first with a maximum). Minifig lists sort only by value, annual growth, newest and oldest.",
            "default": "default"
          },
          "availability": {
            "title": "Availability",
            "type": "array",
            "description": "Keep only results with ANY of these. \"Retiring soon\" works for sets (for minifigs use the Retiring soon collection).",
            "items": {
              "type": "string",
              "enum": [
                "retired",
                "available",
                "retiringSoon"
              ],
              "enumTitles": [
                "Retired",
                "Still available",
                "Retiring soon"
              ]
            }
          },
          "minValue": {
            "title": "Min value (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Keep only results worth at least this much new/sealed (sets) or new (minifigs). For sets still in stores this is the market price."
          },
          "maxValue": {
            "title": "Max value (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Keep only results worth at most this much."
          },
          "minGrowth": {
            "title": "Min growth since release (%)",
            "type": "number",
            "description": "Keep only results whose value grew at least this much over the retail price, e.g. 100 for doubled. Sets still in stores have no growth yet, so they are left out."
          },
          "minAnnualGrowth": {
            "title": "Min annual growth (%)",
            "type": "number",
            "description": "Keep only results growing at least this much a year (CAGR), e.g. 10."
          },
          "minPieces": {
            "title": "Min pieces",
            "minimum": 0,
            "type": "integer",
            "description": "Sets only: keep sets with at least this many pieces."
          },
          "maxPieces": {
            "title": "Max pieces",
            "minimum": 0,
            "type": "integer",
            "description": "Sets only: keep sets with at most this many pieces."
          },
          "urls": {
            "title": "BrickEconomy links (fields above are then ignored)",
            "type": "array",
            "description": "Set pages (/set/75192-1/...), minifig pages (/minifig/sw0001/...), theme or subtheme lists (/sets/theme/star-wars, /minifigs/theme/ninjago), year lists (/sets/year/2020), lists like /sets/retiring-soon, or a search (/search?query=falcon).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "priceHistory": {
            "title": "Price history (paid add-on)",
            "type": "boolean",
            "description": "Adds the full value history (often years of data points), the forecast curve, and the price range of every month of sales (low, typical range, high). Minifigs also get monthly listing prices and the number sold each month. No extra pages are opened, so runs stay fast.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional, off by default. BrickEconomy works without one. Turn it on only if runs fail to connect. Proxy traffic is billed to your Apify account."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}