{
  "openapi": "3.0.1",
  "info": {
    "title": "PistonHeads.com [$1💰] | Full 208k catalogue | Real pagination",
    "description": "💰$1 per 1,000 cars. Scrape the FULL PistonHeads catalogue — rival scrapers loop on page one because the site ignores its own page parameter. Get price, mileage, spec, seller and photos per car. Filter by make, model, price, year, mileage or postcode radius. Optional descriptions + galleries.",
    "version": "0.0",
    "x-build-id": "HdiwZDNMWeNgkDQYp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~pistonheads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-pistonheads-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/memo23~pistonheads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-pistonheads-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/memo23~pistonheads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-pistonheads-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": {
          "startUrls": {
            "title": "PistonHeads URLs",
            "type": "array",
            "description": "Optional. Paste PistonHeads URLs to scrape. A direct advert URL (https://www.pistonheads.com/buy/listing/20912256) is scraped on its own. A search URL has its recognised filters read off the query string. Leave this empty to search the whole catalogue using the filters below.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of car adverts to return. PistonHeads lists roughly 208,000 used cars, so set this deliberately — without filters the Actor will keep paginating until it hits this number.",
            "default": 1000
          },
          "makes": {
            "title": "Makes",
            "type": "array",
            "description": "Car makes by name, e.g. Porsche, Audi. Names are resolved against PistonHeads' own make list, so you don't need internal IDs. A make that doesn't match is reported in the log and the run stops rather than silently scraping everything.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "models": {
            "title": "Models",
            "type": "array",
            "description": "Car models by name, e.g. 911, Cayman. Requires at least one make, because PistonHeads scopes model IDs to their make.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text search across advert headlines, e.g. \"manual\" or \"GT3 Touring\"."
          },
          "priceMin": {
            "title": "Min price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest asking price to include."
          },
          "priceMax": {
            "title": "Max price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Highest asking price to include."
          },
          "yearMin": {
            "title": "Min year",
            "minimum": 1900,
            "type": "integer",
            "description": "Earliest registration year to include."
          },
          "yearMax": {
            "title": "Max year",
            "minimum": 1900,
            "type": "integer",
            "description": "Latest registration year to include."
          },
          "mileageMin": {
            "title": "Min mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest recorded mileage to include."
          },
          "mileageMax": {
            "title": "Max mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Highest recorded mileage to include — useful for finding low-mileage examples."
          },
          "fuelTypes": {
            "title": "Fuel types",
            "type": "array",
            "description": "Keep only cars using these fuel types. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "Petrol",
                "Diesel",
                "Electric",
                "Hybrid",
                "LPG",
                "Other"
              ],
              "enumTitles": [
                "Petrol",
                "Diesel",
                "Electric",
                "Hybrid",
                "LPG",
                "Other"
              ]
            },
            "default": []
          },
          "transmissions": {
            "title": "Transmission",
            "type": "array",
            "description": "Keep only cars with these gearboxes. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "Automatic",
                "Manual",
                "Other"
              ],
              "enumTitles": [
                "Automatic",
                "Manual",
                "Other"
              ]
            },
            "default": []
          },
          "bodyTypes": {
            "title": "Body types",
            "type": "array",
            "description": "Keep only these body styles. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "Convertible",
                "Coupe",
                "Estate",
                "SUV",
                "Hatchback",
                "Saloon",
                "MPV",
                "Pick Up",
                "Other"
              ],
              "enumTitles": [
                "Convertible",
                "Coupe",
                "Estate",
                "SUV",
                "Hatchback",
                "Saloon",
                "MPV",
                "Pick Up",
                "Other"
              ]
            },
            "default": []
          },
          "colours": {
            "title": "Colours",
            "type": "array",
            "description": "Keep only cars in these colours. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "Black",
                "Blue",
                "Green",
                "Grey",
                "Red",
                "Silver",
                "White",
                "Yellow",
                "Beige",
                "Brown",
                "Bronze",
                "Cream",
                "Gold",
                "Maroon",
                "Multi colour",
                "Orange",
                "Pink",
                "Purple",
                "Turquoise"
              ],
              "enumTitles": [
                "Black",
                "Blue",
                "Green",
                "Grey",
                "Red",
                "Silver",
                "White",
                "Yellow",
                "Beige",
                "Brown",
                "Bronze",
                "Cream",
                "Gold",
                "Maroon",
                "Multi colour",
                "Orange",
                "Pink",
                "Purple",
                "Turquoise"
              ]
            },
            "default": []
          },
          "driveTrains": {
            "title": "Drivetrain",
            "type": "array",
            "description": "Keep only cars with these drivetrains. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "Front-wheel drive",
                "Rear-wheel drive",
                "4-wheel drive",
                "Other"
              ],
              "enumTitles": [
                "Front-wheel drive",
                "Rear-wheel drive",
                "4-wheel drive",
                "Other"
              ]
            },
            "default": []
          },
          "doors": {
            "title": "Doors",
            "type": "array",
            "description": "Keep only cars with these door counts. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6"
              ],
              "enumTitles": [
                "2 doors",
                "3 doors",
                "4 doors",
                "5 doors",
                "6 doors"
              ]
            },
            "default": []
          },
          "seats": {
            "title": "Seats",
            "type": "array",
            "description": "Keep only cars with these seat counts. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9"
              ],
              "enumTitles": [
                "1 seat",
                "2 seats",
                "3 seats",
                "4 seats",
                "5 seats",
                "6 seats",
                "7 seats",
                "8 seats",
                "9 seats"
              ]
            },
            "default": []
          },
          "engineSizeMinCc": {
            "title": "Min engine size (cc)",
            "minimum": 0,
            "type": "integer",
            "description": "Smallest engine capacity in cc, e.g. 2000 for 2.0 litres."
          },
          "engineSizeMaxCc": {
            "title": "Max engine size (cc)",
            "minimum": 0,
            "type": "integer",
            "description": "Largest engine capacity in cc."
          },
          "enginePowerMinBhp": {
            "title": "Min power (bhp)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum engine power in bhp."
          },
          "enginePowerMaxBhp": {
            "title": "Max power (bhp)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum engine power in bhp."
          },
          "maxPreviousOwners": {
            "title": "Max previous owners",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only cars with at most this many previous keepers."
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "",
              "Trade",
              "Private"
            ],
            "type": "string",
            "description": "Restrict to dealers or private sellers. Empty = both.",
            "default": ""
          },
          "postcode": {
            "title": "Postcode",
            "type": "string",
            "description": "UK postcode to search around, e.g. SW1A 1AA. Combine with Search radius. Adds each seller's distance from this postcode to the output."
          },
          "distanceMiles": {
            "title": "Search radius (miles)",
            "minimum": 1,
            "type": "integer",
            "description": "How far from the postcode to search. Ignored unless a postcode is set."
          },
          "listedWithinHours": {
            "title": "Listed within last N hours",
            "minimum": 1,
            "type": "integer",
            "description": "Only adverts published in the last N hours — set 24 for cars listed today. This is the cheapest way to run the Actor as a daily new-listings monitor instead of re-scraping the whole catalogue."
          },
          "includeSoldCars": {
            "title": "Include sold cars",
            "type": "boolean",
            "description": "Also return adverts already marked as sold. Off by default.",
            "default": false
          },
          "includeDescription": {
            "title": "Include full advert text (description + features)",
            "type": "boolean",
            "description": "Fetches each advert's own page for the ADVERT's write-up — the text the seller wrote about the CAR, not about themselves. REQUIRED for the description, features, variant and galleryImages columns; leave it off and those four are null on every row. Seller name, type, location and phone are always included and do NOT need this. Costs one extra request per car and roughly doubles run time.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many description fetches to run in parallel. Only matters when Include seller description is on.",
            "default": 10
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. The built-in residential proxy is used by default and works well; override only if you have a reason to."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}