{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilbasen Scraper — Denmark Cars, EV Battery & Dealers",
    "description": "Bilbasen.dk scraper for Denmark's car market. One row per car with numeric specs, battery kWh, WLTP range, consumption, the fitted-equipment list, full-resolution photos, and the dealer block with CVR and phone. Price banding gets past the site's 3,000-ad page wall to the whole market.",
    "version": "0.0",
    "x-build-id": "FF2SHTFpy7VJ7E2Ry"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~bilbasen-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-bilbasen-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~bilbasen-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-bilbasen-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~bilbasen-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-bilbasen-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",
            "type": "array",
            "description": "Bilbasen search or listing URLs to scrape. Supports search pages (https://www.bilbasen.dk/brugt/bil/bmw) and single listings (https://www.bilbasen.dk/brugt/bil/bmw/530e/20-touring-m-sport-aut/6959802). Leave empty to use the filter fields below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "make": {
            "title": "Make",
            "type": "string",
            "description": "Car make to search for (e.g. BMW, Audi, Toyota, Volkswagen). Used to build the search URL when no startUrls are provided."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Car model to search for (e.g. 3-serien, A4, Yaris). Requires make to be set."
          },
          "priceFrom": {
            "title": "Price From (DKK)",
            "type": "integer",
            "description": "Minimum price in DKK."
          },
          "priceTo": {
            "title": "Price To (DKK)",
            "type": "integer",
            "description": "Maximum price in DKK."
          },
          "yearFrom": {
            "title": "Year From",
            "type": "integer",
            "description": "Minimum model year."
          },
          "yearTo": {
            "title": "Year To",
            "type": "integer",
            "description": "Maximum model year."
          },
          "fuelType": {
            "title": "Fuel Type",
            "enum": [
              "Benzin",
              "Diesel",
              "El",
              "Hybrid",
              "Hybrid diesel",
              "Plug-in hybrid",
              "Plug-in hybrid diesel"
            ],
            "type": "string",
            "description": "Fuel type filter. Leave unset for every fuel."
          },
          "maxItems": {
            "title": "Max Results",
            "type": "integer",
            "description": "Maximum number of listings to scrape (0 = unlimited). Apify charges per result, so set this conservatively on your first run.",
            "default": 100
          },
          "includeDetails": {
            "title": "Include Detail Pages",
            "type": "boolean",
            "description": "Fetch the full detail page for each listing (seller info, phone, full description, all specs). Disable for faster list-only scraping.",
            "default": true
          },
          "maxPages": {
            "title": "Max Pages",
            "type": "integer",
            "description": "Maximum number of search-result pages to scrape (30 listings per page). 0 = unlimited.",
            "default": 0
          },
          "proxy": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy configuration. A residential proxy is recommended for reliable access."
          },
          "dealersOnly": {
            "title": "Dealers only",
            "type": "boolean",
            "description": "Return only cars listed by a trade seller, skipping private sellers.",
            "default": false
          },
          "scrapePhone": {
            "title": "Get dealer phone numbers",
            "type": "boolean",
            "description": "Fetch each dealer's phone number from their own page. The ad page hides it behind a button, so this costs one extra request per dealer — not per car.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many ad pages to fetch at once.",
            "default": 5
          },
          "failOnIncomplete": {
            "title": "Fail the run when ads are missing",
            "type": "boolean",
            "description": "End the run as FAILED when it delivers fewer ads than bilbasen reported for the search, instead of returning a short dataset that looks complete.",
            "default": true
          },
          "completenessTolerancePercent": {
            "title": "Completeness tolerance (percent)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How far below the site's own count the run may land before it fails, as a percentage. The larger of this and the absolute tolerance applies.",
            "default": 1
          },
          "completenessToleranceAbsolute": {
            "title": "Completeness tolerance (ads)",
            "minimum": 0,
            "type": "integer",
            "description": "How many ads the run may miss before it fails. Covers the churn of ads published and withdrawn while the run is in flight.",
            "default": 25
          },
          "enrichEmails": {
            "title": "Find dealer emails",
            "type": "boolean",
            "description": "Look up each dealer's email address on their own website. Charged only per address actually found, and a dealer is looked up once per run however many cars they list. Measured on 76 Danish dealers: 59 published a usable address.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}