{
  "openapi": "3.0.1",
  "info": {
    "title": "PistonHeads UK Car Classifieds Scraper",
    "description": "Scrape UK performance and enthusiast car listings from PistonHeads.com. Returns price, year, mileage, fuel, transmission, body type, engine, seller and photos. Filter by make, model, price, year, mileage, fuel, postcode or paste a search URL. No login.",
    "version": "1.0",
    "x-build-id": "jDh14OHIjcLYpfLTq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bovi~pistonheads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bovi-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/bovi~pistonheads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-bovi-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/bovi~pistonheads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-bovi-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": {
          "searchUrl": {
            "title": "PistonHeads search URL",
            "type": "string",
            "description": "Optional. Paste a PistonHeads.com search URL, e.g. https://www.pistonheads.com/buy/porsche/911 or https://www.pistonheads.com/buy/search?keywords=gt3. The make, model and query parameters (keywords, postcode, distance, priceMin, priceMax, yearMin, yearMax, mileageMin, mileageMax, transmission, sortOption, sellerType) are applied and override the filter fields below."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of car listings to collect.",
            "default": 50
          },
          "makeUrlName": {
            "title": "Make",
            "type": "string",
            "description": "Manufacturer as written in PistonHeads URLs, e.g. porsche, aston-martin, bmw, alfa-romeo."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Model name or part of it (needs a make), e.g. 911, Cayenne, M3. Matches every variant that contains the text."
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text keywords searched in the listings, e.g. gt3 or manual v8."
          },
          "priceMin": {
            "title": "Min price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest asking price in pounds."
          },
          "priceMax": {
            "title": "Max price (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Highest asking price in pounds."
          },
          "yearMin": {
            "title": "Min year",
            "minimum": 1900,
            "type": "integer",
            "description": "Earliest registration year."
          },
          "yearMax": {
            "title": "Max year",
            "minimum": 1900,
            "type": "integer",
            "description": "Latest registration year."
          },
          "mileageMin": {
            "title": "Min mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest mileage."
          },
          "mileageMax": {
            "title": "Max mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Highest mileage."
          },
          "fuelTypes": {
            "title": "Fuel type",
            "type": "array",
            "description": "Only these fuel types. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "PTL",
                "DSL",
                "ELE",
                "HYB",
                "LPG",
                "OTH"
              ],
              "enumTitles": [
                "Petrol",
                "Diesel",
                "Electric",
                "Hybrid",
                "LPG",
                "Other"
              ]
            }
          },
          "transmissions": {
            "title": "Transmission",
            "type": "array",
            "description": "Only these gearbox types. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "MAN",
                "ATO",
                "OTH"
              ],
              "enumTitles": [
                "Manual",
                "Automatic",
                "Other"
              ]
            }
          },
          "bodyTypes": {
            "title": "Body type",
            "type": "array",
            "description": "Only these body styles. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "CON",
                "COU",
                "EST",
                "SUV",
                "HTC",
                "SAL",
                "MPV",
                "PKU",
                "OTH"
              ],
              "enumTitles": [
                "Convertible",
                "Coupe",
                "Estate",
                "SUV",
                "Hatchback",
                "Saloon",
                "MPV",
                "Pick Up",
                "Other"
              ]
            }
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "",
              "Private",
              "Trade"
            ],
            "type": "string",
            "description": "Trade dealers, private sellers, or any.",
            "default": ""
          },
          "postcode": {
            "title": "UK postcode",
            "type": "string",
            "description": "Full UK postcode for a distance search, e.g. NN12 8TN. Used together with the distance below."
          },
          "distance": {
            "title": "Distance from postcode (miles)",
            "enum": [
              "2147483647",
              "5",
              "10",
              "20",
              "30",
              "40",
              "60",
              "80",
              "100",
              "150",
              "200"
            ],
            "type": "string",
            "description": "Search radius around the postcode. Ignored when no postcode is given.",
            "default": "2147483647"
          },
          "includeSold": {
            "title": "Include sold cars",
            "type": "boolean",
            "description": "Also return listings that are already sold.",
            "default": false
          },
          "sortOption": {
            "title": "Sort by",
            "enum": [
              "PHBrand",
              "Date",
              "PriceLowToHigh",
              "PriceHighToLow",
              "Location",
              "Mileage",
              "YearNewToOld",
              "YearOldToNew"
            ],
            "type": "string",
            "description": "Order of the results.",
            "default": "PHBrand"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. PistonHeads is reachable without a proxy; enable Apify Proxy if you run into blocks. Without it the Actor connects directly.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}