{
  "openapi": "3.0.1",
  "info": {
    "title": "Coches.net Scraper — Car Listings & Dealers",
    "description": "Scrape vehicle listings and the full dealer directory from Coches.net, Spain's largest car marketplace. Extract prices, specs, photos, location, and dealer contacts. Filter by brand, model, fuel, price, year, or province. Incremental mode for zero-duplicate feeds.",
    "version": "0.2",
    "x-build-id": "zk1hNqif8z7fXDUXg"
  },
  "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 exactly as it appears on coches.net (e.g. \"Alfa Romeo\", \"BMW\", \"Mercedes-Benz\"). You can also pass the numeric coches.net make ID directly."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Car model within the selected make. Examples: \"Spider\", \"Serie 3\", \"Clase A\". Requires make to be set. Leave blank to get all models of that brand."
          },
          "fuel": {
            "title": "Fuel type",
            "enum": [
              "gasolina",
              "diesel",
              "electrico",
              "hibrido",
              "glp"
            ],
            "type": "string",
            "description": "Filter by fuel type. Leave unset to include 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 (~30 listings each).<br><br>Capped at 100. For most single-brand queries in a province, 6 pages suffice. Raise for large inventories (e.g. VW in Madrid = 87 pages).",
            "default": 6
          },
          "maxItems": {
            "title": "Max items",
            "type": "integer",
            "description": "Hard cap on total listings returned. The run stops as soon as it hits this number. Set to 9999 for effectively unlimited.",
            "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. Recommended for runs over 500 listings to avoid throttling."
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}