{
  "openapi": "3.0.1",
  "info": {
    "title": "Coches.net Scraper — Used Car Listings & Prices Spain",
    "description": "Scrape used car listings from Coches.net, Spain's largest car marketplace: price vs. market average, price drops, km, fuel, DGT badge, dealers and photos. Filter by brand, model, fuel, price, year, province or postal code. Incremental mode returns only changes. No login. $0.001 per listing.",
    "version": "0.2",
    "x-build-id": "0JhPFSObI7Lbk3M4r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~cochesnet-spain/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-cochesnet-spain",
        "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/rastriq~cochesnet-spain/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-cochesnet-spain",
        "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/rastriq~cochesnet-spain/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-cochesnet-spain",
        "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": {
          "urls": {
            "title": "🔗 URLs",
            "type": "array",
            "description": "<b>Paste one or more coches.net URLs to scrape directly.</b><br><br>Supported URL types:<br>• <b>Listing URLs</b> — e.g. <code>https://www.coches.net/bmw-serie-3-320i-4p-gasolina-2009-en-madrid-70672809-covo.aspx</code> → extracts that single listing's full details.<br>• <b>Search URLs</b> — e.g. <code>https://www.coches.net/segunda-mano/?MakeIds[0]=7</code> → paginates through those search results.<br><br>When URLs are provided, the make/model/fuel filters below are <b>ignored</b> — the URL already encodes the search. <code>maxPages</code> and <code>maxItems</code> limits still apply to search URLs.",
            "items": {
              "type": "string"
            }
          },
          "make": {
            "title": "Make (brand)",
            "type": "string",
            "description": "Car brand. Type the name as it appears on coches.net (e.g. \"Toyota\", \"BMW\", \"Mercedes-Benz\", \"Alfa Romeo\"). If a brand name does not resolve (DS, MG, Polestar, XPeng...), use <b>Make ID</b> instead. Leave blank to search all brands."
          },
          "makeId": {
            "title": "Make ID (numeric)",
            "type": "integer",
            "description": "Numeric MakeId from coches.net (e.g. 47=VW, 7=BMW, 1358=DS, 36=Mitsubishi, 62=Land Rover, 9999=XPeng). When provided, bypasses name-based brand resolution entirely. Use this for brands whose name fails to resolve with the <b>make</b> field (DS, MG, Polestar, XPeng, etc.).<br><br>Takes precedence over <b>make</b> when both are set."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Car model within the selected make (e.g. \"Corolla\", \"Serie 3\", \"Clase A\"). Requires make. If the model is not found, the search runs for the whole make (a warning is logged). Leave blank for all models."
          },
          "fuel": {
            "title": "Fuel type",
            "enum": [
              "gasolina",
              "diesel",
              "electrico",
              "hibrido",
              "glp"
            ],
            "type": "string",
            "description": "Filter by fuel type. Gasolina, diésel, eléctrico and híbrido are filtered by coches.net itself; GLP is filtered on the pages fetched: with LPG (GLP) raise <b>Max pages</b> to 6 to find enough matches. \"Híbrido\" selects coches.net's hybrid category (plug-in hybrids are listed separately and may not be included). Leave unset for all fuel types."
          },
          "minPrice": {
            "title": "Min price (€)",
            "type": "integer",
            "description": "Only return listings priced at or above this amount (in EUR)."
          },
          "maxPrice": {
            "title": "Max price (€)",
            "type": "integer",
            "description": "Only return listings priced at or below this amount (in EUR)."
          },
          "minYear": {
            "title": "Min year",
            "minimum": 1950,
            "maximum": 2027,
            "type": "integer",
            "description": "Only return vehicles registered in this year or later."
          },
          "maxYear": {
            "title": "Max year",
            "minimum": 1950,
            "maximum": 2027,
            "type": "integer",
            "description": "Only return vehicles registered in this year or earlier."
          },
          "postalCode": {
            "title": "Postal code (radius search)",
            "type": "string",
            "description": "<b>Search around a Spanish postal code.</b> Combine with <b>Radius</b>.<br><br>Coches.net filters by distance from a coordinate; we resolve the postal code offline from an embedded table, so no geocoding key and no extra request.<br><br><b>Note:</b> the radius is exact for private sellers, but dealers with national or multi-province stock appear in any radius search regardless of distance — that is how coches.net itself behaves. Combine with a strict geographic need at your own filtering layer."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius around the postal code. Ignored unless <b>Postal code</b> is also set."
          },
          "province": {
            "title": "Province (INE code)",
            "minimum": 1,
            "maximum": 52,
            "type": "integer",
            "description": "Restrict to one province by its INE code (28 = Madrid, 8 = Barcelona, 46 = Valencia…). Useful for sharding a large extraction into queries that stay within the page limit."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Search-result pages to crawl (~35 listings each).<br><br>Recommended: 1-6 (coches.net asks crawlers not to go beyond page 6, ~210 listings per query). The input accepts up to 100. To cover large inventories, split the search by province, brand or price range instead of paginating deeper.",
            "default": 6
          },
          "maxItems": {
            "title": "Max items",
            "type": "integer",
            "description": "Hard cap on total listings returned (you pay per listing). The run stops as soon as it hits this number. Default 50; the form suggests 30 for a quick first run.",
            "default": 50
          },
          "enableCursor": {
            "title": "Incremental mode (delta engine)",
            "type": "boolean",
            "description": "<b>Return only listings that are new or have changed since your last run.</b><br>The Actor keeps a ledger of every listing id already delivered for this search stream, plus a fingerprint over <code>price / km / title / reservation / price drop</code>. A listing is returned when its id is unknown (<code>_delta_status: \"new\"</code>) or when its fingerprint moved (<code>_delta_status: \"updated\"</code>). Everything else is skipped and not charged.<br><br>The ledger assumes nothing about result ordering, which matters because coches.net shuffles its relevance feed between sessions.<br><br><b>First run:</b> full baseline, seeds the ledger.<br><b>Subsequent runs:</b> deltas only.<br><br>Not available in URL mode. Use <code>cursorId</code> to keep parallel searches independent.",
            "default": false
          },
          "cursorId": {
            "title": "Stream id (cursor namespace)",
            "type": "string",
            "description": "<b>Optional.</b> Names the ingestion stream. Runs sharing a stream id share one ledger; different ids are fully independent.<br><br>Leave empty and the Actor derives a stable id from your filters. Set it explicitly (e.g. <code>catalogue-es</code>) when several searches feed one catalogue, or change it to force a clean rebuild."
          },
          "emitSeenIds": {
            "title": "Emit seen ids (delisting detection)",
            "type": "boolean",
            "description": "<b>Write every listing id observed during the sweep to <code>SEEN_IDS</code></b> in the run's key-value store — including those skipped as unchanged.<br><br>With delta ingestion your catalogue never expires rows: a vehicle that sells simply stops appearing. Compare <code>SEEN_IDS</code> across runs and mark anything absent for N consecutive sweeps as sold.<br><br>No extra cost.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy or custom proxy URL. If left empty, Apify residential proxies (country ES) are used automatically: coches.net blocks some datacenter IPs, and a rotating residential proxy lets the actor switch IP and retry instead of failing."
          },
          "stripSellerPII": {
            "title": "🔒 Strip seller personal data (GDPR)",
            "type": "boolean",
            "description": "<b>Remove personal data of private sellers from the output.</b><br>When enabled: <code>phone</code> is set to null for non-professional sellers.<br>Coordinates are already municipal centroids (~1 km) and are not modified.<br><br>Professional seller data is not affected.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}