{
  "openapi": "3.0.1",
  "info": {
    "title": "Marks & Spencer Product Scraper",
    "description": "Scrape Marks & Spencer products — fashion, home & beauty. Search or browse by department, get prices, was-prices, ratings, colour/size variants, images, material & care specs.",
    "version": "1.0",
    "x-build-id": "zFPOR7TS6eG1ga4I9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~marks-and-spencer-product-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-marks-and-spencer-product-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/sian.agency~marks-and-spencer-product-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-marks-and-spencer-product-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/sian.agency~marks-and-spencer-product-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-marks-and-spencer-product-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": {
          "queries": {
            "title": "🔍 Search Queries",
            "type": "array",
            "description": "🔍 **KEYWORD SEARCH:** Free-text Marks & Spencer searches — exactly what you'd type into the marksandspencer.com search bar.\n\n📝 **EXAMPLES:** `cashmere jumper` · `midi dress` · `school shoes` · `bath towels` · `silk pillowcase`\n\n💡 **TIP:** Add one search per line — each runs as its own search and all results land in the same dataset.\n\n🖊️ **BULK EDIT:** Click \"Bulk edit\" to paste many searches at once (one per line).\n\n✅ **IMPORTANT:** Provide searches, a department / category, OR M&S URLs (at least one is needed to have something to scrape).",
            "default": [
              "cashmere jumper"
            ],
            "items": {
              "type": "string"
            }
          },
          "scrapeMode": {
            "title": "⚙️ Scrape Mode",
            "enum": [
              "overview",
              "detail"
            ],
            "type": "string",
            "description": "⚙️ **SCRAPE DEPTH:** Choose how much data to pull per product.\n\n⚡ **Overview (fast):** Search / category cards only — id, brand, title, product type, price & was-price, rating & review count, images, colour & size variants, stock and labels. 48 products per page — the fastest and cheapest path.\n\n🔬 **Detail (description + material + care specs):** Everything in Overview PLUS the full product description, material / composition, care & attribute specs, every colour and size, the complete image gallery, availability and the ratings breakdown scraped from each product page — all merged into one record.\n\n💡 **TIP:** Start with Overview to scope your catalog, then switch to Detail when you need descriptions, materials and care data.",
            "default": "overview"
          },
          "department": {
            "title": "🏬 Department",
            "type": "string",
            "description": "🏬 **DEPARTMENT (optional):** Browse a whole top-level M&S department instead of (or alongside) a keyword search.\n\n📂 **SUPPORTED:** `women` · `men` · `kids` · `lingerie` · `beauty` · `home-and-furniture` · `flowers-and-plants` · `gifts`\n\n💡 **TIP:** Combine with **Category** below to drill into a specific sub-section. Leave blank if you're only using searches or URLs."
          },
          "category": {
            "title": "🗂️ Category",
            "type": "string",
            "description": "🗂️ **CATEGORY (optional):** Category subpath under the chosen **Department** — mirrors the M&S left-hand navigation.\n\n📝 **EXAMPLES:** `dresses` · `dresses/midi-dresses` · `knitwear` · `bedding`\n\n💡 **TIP:** Requires **Department** to be set. Use the tail of the M&S category URL (e.g. for `/l/women/dresses/midi-dresses` enter `dresses/midi-dresses`)."
          },
          "facets": {
            "title": "🎨 Facet Filters",
            "type": "array",
            "description": "🎨 **FACET FILTERS (optional):** M&S `fs5` facet slugs — colour, size, material or style — applied to your department / category browse, exactly like the site's own filters.\n\n📝 **EXAMPLES:** `blue` · `cotton` · `midi-dresses` · `black` · `wool`\n\n🖊️ **BULK EDIT:** Add one facet slug per line to stack multiple filters.\n\n💡 **TIP:** Leave empty to include everything.",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "🔗 M&S URLs",
            "type": "array",
            "description": "🔗 **PASTE M&S URLs (optional):** Paste full Marks & Spencer product-list (PLP) or search URLs to scrape them verbatim — any filters and sorting already in the URL are preserved.\n\n📝 **EXAMPLE:** `https://www.marksandspencer.com/l/women/dresses`\n\n🖊️ **BULK EDIT:** Add one URL per line to sweep several pages in a single run.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "🔃 Sort Order",
            "enum": [
              "relevance",
              "new",
              "best_selling",
              "price_low",
              "price_high",
              "rating"
            ],
            "type": "string",
            "description": "🔃 **RESULT ORDERING:** Order listings using Marks & Spencer's own native sort options — so you get the same ranking real shoppers see.\n\n⭐ **Relevance** surfaces the best-matching products first · 🆕 **Newest** first · 🔥 **Best Selling** · 💲 **Price** low↔high · 🌟 **Top Rated** by customer rating.",
            "default": "relevance"
          },
          "minPrice": {
            "title": "💵 Min Price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "💵 **MINIMUM PRICE:** Only return products at or above this price (GBP). Applied client-side after fetching. Leave blank for no lower bound."
          },
          "maxPrice": {
            "title": "💰 Max Price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "💰 **MAXIMUM PRICE:** Only return products at or below this price (GBP). Applied client-side after fetching. Leave blank for no upper bound."
          },
          "maxResults": {
            "title": "🔢 Max Results",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 **RESULT CAP:** Maximum number of products to return across all searches, departments and URLs combined.\n\n🎁 **TIER-BASED LIMITS:**\n- **FREE users:** Up to 25 products per run\n- **PAID users:** Unlimited — scrape entire catalogs in a single run\n\n💡 **TIP:** Keep this low while you dial in your searches, then raise it once the output looks right.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}