{
  "openapi": "3.0.1",
  "info": {
    "title": "John Lewis Electricals Scraper",
    "description": "Scrape John Lewis & Partners - a leading UK department-store retailer's electronics catalog. Browse laptops, desktop PCs, TVs, tablets, headphones, and games consoles with live prices, brand, and product images.",
    "version": "1.0",
    "x-build-id": "HYzHpbudeGxpNuJSg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~john-lewis-electricals-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-john-lewis-electricals-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/crawlerbros~john-lewis-electricals-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-john-lewis-electricals-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/crawlerbros~john-lewis-electricals-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-john-lewis-electricals-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "byCategory",
              "byUrls"
            ],
            "type": "string",
            "description": "byCategory: browse a category listing page. byUrls: fetch specific product URLs directly (with full detail-page data).",
            "default": "byCategory"
          },
          "category": {
            "title": "Category (mode=byCategory)",
            "enum": [
              "laptops-macbooks",
              "desktop-pcs",
              "ipad-tablets",
              "televisions",
              "headphones",
              "games-consoles",
              "built-in-ovens-double",
              "built-in-ovens-single",
              "range-cookers",
              "electric-hobs",
              "induction-hobs",
              "fridges",
              "freezers",
              "washing-machines",
              "tumble-dryers",
              "monitors",
              "printers",
              "mobile-phones",
              "smart-watches",
              "coffee-machines",
              "soundbars",
              "speakers",
              "vacuum-cleaners",
              "microwaves",
              "cameras",
              "dishwashers",
              "air-conditioners",
              "air-purifiers",
              "dehumidifiers",
              "fans",
              "kettles",
              "irons",
              "food-processors-blenders",
              "projectors",
              "smart-heating",
              "smart-lighting",
              "hi-fi-systems",
              "turntables",
              "radios"
            ],
            "type": "string",
            "description": "Electronics/appliance category to browse. Required for mode=byCategory.",
            "default": "laptops-macbooks"
          },
          "productUrls": {
            "title": "Product URLs (mode=byUrls)",
            "type": "array",
            "description": "Full johnlewis.com/.../pNNNNNN product URLs to fetch directly. Required for mode=byUrls.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort order (mode=byCategory)",
            "enum": [
              "relevance",
              "priceLow",
              "priceHigh",
              "new",
              "popularity",
              "discount"
            ],
            "type": "string",
            "description": "Order in which the category listing returns products. Only affects which items are captured first when `maxItems` is below the category total. Not applicable to mode=byUrls.",
            "default": "relevance"
          },
          "fetchProductDetail": {
            "title": "Fetch full product detail (mode=byCategory)",
            "type": "boolean",
            "description": "Also visit each product's detail page for rating, review count, description, availability, colour, weight, model number, MPN, guarantee and extra images. Roughly doubles requests and run time. Always on for mode=byUrls.",
            "default": false
          },
          "brand": {
            "title": "Brand filter",
            "type": "string",
            "description": "Only keep products whose brand contains this text (case-insensitive), e.g. `HP`, `Samsung`, `Apple`."
          },
          "minPrice": {
            "title": "Min price (GBP)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Drop products cheaper than this (GBP). When both minPrice and maxPrice are set (mode=byCategory), applied server-side via John Lewis's own price facet, narrowing the source listing; a one-sided range is a post-filter only. Always enforced as a post-filter too."
          },
          "maxPrice": {
            "title": "Max price (GBP)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Drop products pricier than this (GBP). When both minPrice and maxPrice are set (mode=byCategory), applied server-side via John Lewis's own price facet, narrowing the source listing; a one-sided range is a post-filter only. Always enforced as a post-filter too."
          },
          "minRating": {
            "title": "Minimum rating (0-5)",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep products rated at least this (0-5 stars). Rating is scraped directly from the listing card, so this works in every mode without needing `fetchProductDetail`. Products with no reviews yet are excluded, since their rating cannot be verified against the threshold.",
            "default": 0
          },
          "inStockOnly": {
            "title": "In-stock only",
            "type": "boolean",
            "description": "Only keep products currently available to order. In mode=byCategory this is applied server-side via John Lewis's own \"Show in stock items only\" facet (narrows the source listing, works without `fetchProductDetail`); in mode=byUrls it's enforced from the fetched detail page's live availability.",
            "default": false
          },
          "newInOnly": {
            "title": "New In only (mode=byCategory)",
            "type": "boolean",
            "description": "Only keep products currently flagged \"New In\" by John Lewis. Applied server-side via John Lewis's own \"New In\" facet, so it narrows the source listing (not just a post-filter). Not applicable to mode=byUrls.",
            "default": false
          },
          "onSaleOnly": {
            "title": "On sale only",
            "type": "boolean",
            "description": "Only keep products currently marked down from a previous price. Detected directly from the listing card's \"was/now\" price and \"Save £X\" badge, so this works in every mode without needing `fetchProductDetail`.",
            "default": false
          },
          "onOfferOnly": {
            "title": "On offer only (mode=byCategory)",
            "type": "boolean",
            "description": "Only keep products currently in John Lewis's own \"On Offer\" promotion. Applied server-side via John Lewis's own facet, so it narrows the source listing (not just a post-filter). Broader than `onSaleOnly`: covers every active promotion type (price markdowns, bundled gifts, finance offers), not just was/now price cuts. Not applicable to mode=byUrls.",
            "default": false
          },
          "fetchReviews": {
            "title": "Fetch customer reviews",
            "type": "boolean",
            "description": "Also fetch up to 10 real customer reviews per product (title, review text, star rating, reviewer name/location, date, verified-buyer flag) from johnlewis.com's own ratings-reviews service. Works in every mode (uses the product ID already present on every listing card; does not require `fetchProductDetail`). Adds one extra request per product.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}