{
  "openapi": "3.0.1",
  "info": {
    "title": "Halfords Scraper: UK Car Parts, Tyres, Bikes & Prices",
    "description": "Scrape halfords.com: car parts, tyres by size, bikes and services with GBP price, sale and member price, stock, click and collect, EAN, part number, rating and category. Search or lookup, price monitoring. Export JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "HK8BjbJ10stpyCGhd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~halfords-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-halfords-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~halfords-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-halfords-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~halfords-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-halfords-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": {
          "mode": {
            "title": "Where to read from",
            "enum": [
              "search",
              "lookup"
            ],
            "type": "string",
            "description": "Search scans the Halfords catalog (about 65,000 pages) and keeps what passes your filters. Lookup reads exactly the product pages and product ids you list in Addresses and Product ids.",
            "default": "search"
          },
          "recordTypes": {
            "title": "What to collect",
            "type": "array",
            "description": "Products (one row per part, accessory, bike, tyre size or service) and categories (one row per catalog folder with its product count). Categories need mode Search.",
            "items": {
              "type": "string",
              "enum": [
                "products",
                "categories"
              ],
              "enumTitles": [
                "Products: parts, accessories, tyres, bikes and services",
                "Categories: catalog folders with product counts"
              ]
            },
            "default": [
              "products"
            ]
          },
          "searchQueries": {
            "title": "Search text",
            "type": "array",
            "description": "Optional. Words to look for, for example brake discs, wiper blade or Shimano pedals. Every word of one text must appear (any order, case ignored; numbers match as whole numbers) in the product address, which holds the brand, the product name, the category folders and the product id; a row passes when any of the texts matches. A word that is only in the description, part number or EAN is not found: use mode Lookup with the product id for those.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Optional. Catalog folders to read, as a path such as cycling/bike-parts or motoring/car-parts/brakes, or a full halfords.com category address. Everything below the folder is included. An unknown folder returns a free error row.",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Optional. Keep only these brands, for example Bosch, Michelin or Shimano. The brand field decides; when Halfords leaves it empty (common for car parts) the first words of the product name stand in.",
            "items": {
              "type": "string"
            }
          },
          "vehicleType": {
            "title": "Product kind",
            "enum": [
              "all",
              "part",
              "tire",
              "bicycle",
              "service"
            ],
            "type": "string",
            "description": "Optional. Parts and accessories, tyres (one row per size), bicycles or services such as MOT, servicing and fitting.",
            "default": "all"
          },
          "tyreSize": {
            "title": "Tyre size",
            "type": "string",
            "description": "Optional. Keep only tyres of this size, for example 205/55 R16, 205/55 or R16. Halfords lists tyres by pattern, so every size of each pattern is read from its page (two requests per row). Leave empty for all sizes."
          },
          "minPrice": {
            "title": "Minimum price (GBP)",
            "minimum": 0,
            "type": "number",
            "description": "Optional. Lowest price in pounds. A product with a price range passes when its range overlaps the wanted range."
          },
          "maxPrice": {
            "title": "Maximum price (GBP)",
            "minimum": 0,
            "type": "number",
            "description": "Optional. Highest price in pounds."
          },
          "inStockOnly": {
            "title": "In stock only",
            "type": "boolean",
            "description": "Skips products that Halfords shows as not orderable online.",
            "default": false
          },
          "onSaleOnly": {
            "title": "On sale only",
            "type": "boolean",
            "description": "Keeps only products with a reduced price (a list price above the selling price).",
            "default": false
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Optional. Keeps products with at least this customer rating (0 to 5). Products without reviews are left out when this is set."
          },
          "modifiedSince": {
            "title": "Updated since",
            "type": "string",
            "description": "Optional, mode Search. A date such as 2026-10-01. Keeps pages whose last-modified date in the Halfords sitemap is that day or later."
          },
          "sortBy": {
            "title": "Order",
            "enum": [
              "sitemap",
              "recentlyUpdated"
            ],
            "type": "string",
            "description": "Mode Search. Sitemap order starts returning rows right away. Recently updated reads the whole sitemap first, then returns the newest pages first.",
            "default": "sitemap"
          },
          "startUrls": {
            "title": "Addresses",
            "type": "array",
            "description": "Used in mode Lookup. Product pages of halfords.com, for example https://www.halfords.com/cycling/pedals-pegs/shimano-xt-pd-t8000-mtb-spd-trekking-pedals-344457.html. In mode Search, category addresses are used as category filters.",
            "items": {
              "type": "string"
            }
          },
          "productIds": {
            "title": "Product ids",
            "type": "array",
            "description": "Used in mode Lookup. Halfords product ids, the number at the end of a product address (344457). An id the site does not know returns a free error row.",
            "items": {
              "type": "string"
            }
          },
          "includeDescription": {
            "title": "Include the product description",
            "type": "boolean",
            "description": "Adds the product description as plain text. Turn it off for smaller rows.",
            "default": true
          },
          "includeVariants": {
            "title": "Include the sizes of tyre patterns",
            "type": "boolean",
            "description": "A tyre pattern page (master) lists every size with its id, name and price. Turn this on to add that list to the pattern row.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stops after this many rows (all record types together). Free plans are limited to 10 items per run.",
            "default": 10
          },
          "onlyNew": {
            "title": "Only new items (monitor)",
            "type": "boolean",
            "description": "Skips every item seen in an earlier run with the same monitor name, so scheduled runs return only what is new and you pay only for those.",
            "default": false
          },
          "trackPriceChanges": {
            "title": "Also return price and stock changes",
            "type": "boolean",
            "description": "With only new items on, a product already seen comes back when its price or stock changed, with the previous price, the change and a price-drop, price-increase, out-of-stock or back-in-stock label.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the memory used by only new items. Use one name per saved search. Empty derives a name from your filters.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget what was seen",
            "type": "boolean",
            "description": "Clears the memory of this monitor before the run, so everything counts as new again.",
            "default": false
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "How many pages are read at the same time. The actor also paces every request to at most 5 per second.",
            "default": 4
          },
          "maxScanSeconds": {
            "title": "Maximum scan time (seconds)",
            "minimum": 30,
            "maximum": 3300,
            "type": "integer",
            "description": "Stops reading after this time and keeps the rows found so far. A product page is about 1.3 MB, and the actor reads up to 5 pages per second, so a narrow filter over the whole catalog can take the full time.",
            "default": 900
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Empty means direct requests, which work. Add a proxy only if your own network needs one."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}