{
  "openapi": "3.0.1",
  "info": {
    "title": "PistonHeads Scraper: Full Spec Car Data",
    "description": "Scrape PistonHeads UK used car listings with the deepest spec sheet on the Store: acceleration, top speed, torque, CO2 and fuel consumption on every car. Export to Google Sheets, Excel, or your own pipeline via the API. Skip scrapers with broken filters. From $0.00066 per listing.",
    "version": "0.0",
    "x-build-id": "O8zgbCi0UlUn8hJCR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~pistonheads-uk-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-pistonheads-uk-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/getascraper~pistonheads-uk-scraper/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-pistonheads-uk-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/getascraper~pistonheads-uk-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-pistonheads-uk-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": "Start URLs (optional)",
            "type": "array",
            "description": "Paste PistonHeads listing URLs (e.g. https://www.pistonheads.com/buy/porsche) to scrape directly instead of, or in addition to, the make/model filters below.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "makes": {
            "title": "Makes",
            "type": "array",
            "description": "Car manufacturers to search for, e.g. \"Porsche\", \"BMW\". Leave empty with no Start URLs to scrape PistonHeads' current homepage picks across all makes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "models": {
            "title": "Models",
            "type": "array",
            "description": "Model names to keep, e.g. \"911\", \"Cayman\". Matched against each listing's model and headline.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text match against the advert headline and description (case-insensitive).",
            "default": ""
          },
          "priceMin": {
            "title": "Min price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum asking price."
          },
          "priceMax": {
            "title": "Max price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum asking price."
          },
          "yearMin": {
            "title": "Min registration year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Earliest registration year."
          },
          "yearMax": {
            "title": "Max registration year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Latest registration year."
          },
          "mileageMin": {
            "title": "Min mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum odometer reading in miles."
          },
          "mileageMax": {
            "title": "Max mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum odometer reading in miles."
          },
          "enginePowerMinBhp": {
            "title": "Min engine power (BHP)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum engine power."
          },
          "enginePowerMaxBhp": {
            "title": "Max engine power (BHP)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum engine power."
          },
          "maxPreviousOwners": {
            "title": "Max previous owners",
            "minimum": 0,
            "type": "integer",
            "description": "Only available on adverts where PistonHeads publishes an owner count. Requires \"Fetch full listing details\" below."
          },
          "fuelTypes": {
            "title": "Fuel types",
            "type": "array",
            "description": "Keep only listings with one of these fuel types.",
            "items": {
              "type": "string",
              "enum": [
                "Petrol",
                "Diesel",
                "Electric",
                "Hybrid",
                "LPG"
              ]
            },
            "default": []
          },
          "transmissions": {
            "title": "Transmissions",
            "type": "array",
            "description": "Keep only listings with one of these transmission types.",
            "items": {
              "type": "string",
              "enum": [
                "Manual",
                "Auto"
              ]
            },
            "default": []
          },
          "bodyTypes": {
            "title": "Body types",
            "type": "array",
            "description": "Keep only listings with one of these body types.",
            "items": {
              "type": "string",
              "enum": [
                "Convertible",
                "Coupe",
                "Estate",
                "SUV",
                "Hatchback",
                "Saloon",
                "MPV",
                "Pick Up"
              ]
            },
            "default": []
          },
          "colours": {
            "title": "Colours",
            "type": "array",
            "description": "e.g. \"Black\", \"Blue\". Matched case-insensitively against the listing's exterior colour.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "",
              "Trade",
              "Private"
            ],
            "type": "string",
            "description": "Keep only Trade or only Private sellers.",
            "default": ""
          },
          "postcode": {
            "title": "Postcode",
            "type": "string",
            "description": "UK postcode to search around. Passed to PistonHeads' own location search where supported.",
            "default": ""
          },
          "distanceMiles": {
            "title": "Distance from postcode (miles)",
            "minimum": 1,
            "type": "integer",
            "description": "Search radius around the postcode above."
          },
          "includeSoldCars": {
            "title": "Include sold listings",
            "type": "boolean",
            "description": "By default only live adverts are kept.",
            "default": false
          },
          "includeFullDetails": {
            "title": "Fetch full listing details",
            "type": "boolean",
            "description": "Fetch each advert's own page for the full technical spec (acceleration, top speed, torque, CO2 emissions, fuel consumption, doors, seats, drivetrain, previous owners, full description, full feature list, all gallery images). Roughly doubles the number of requests. Off by default for faster, cheaper runs using just the search-result fields.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after collecting this many matching listings.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "PistonHeads is a UK site; a UK-based proxy avoids region redirects. Datacenter proxy is sufficient.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}