{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilbasen Scraper - Denmark’s Car Marketplace",
    "description": "Scrape bilbasen.dk - Denmark’s largest car marketplace. Full vehicle specifications, seller contacts, and gallery images per listing. Incremental mode tracks new and changed cars across runs.",
    "version": "0.3",
    "x-build-id": "uJv0ko4SF4EqwzWd9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blackfalcondata~bilbasen-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blackfalcondata-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/blackfalcondata~bilbasen-scraper/runs": {
      "post": {
        "operationId": "runs-sync-blackfalcondata-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/blackfalcondata~bilbasen-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-blackfalcondata-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 URLs to scrape. Supports both search pages (/brugt/bil/audi/a4) and single listings (/brugt/bil/vw/golf/variant/123456). Leave empty to use the filter params 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. \"Audi\", \"BMW\", \"Toyota\"). Used to build search URL when no startUrls provided."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Car model to search for (e.g. \"A4\", \"3-serien\", \"Yaris\"). Requires make to be set."
          },
          "yearFrom": {
            "title": "Year From",
            "minimum": 1900,
            "maximum": 2030,
            "type": "integer",
            "description": "Minimum model year (e.g. 2018)"
          },
          "yearTo": {
            "title": "Year To",
            "minimum": 1900,
            "maximum": 2030,
            "type": "integer",
            "description": "Maximum model year (e.g. 2024)"
          },
          "priceFrom": {
            "title": "Price From (DKK)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum price in DKK (e.g. 50000)"
          },
          "priceTo": {
            "title": "Price To (DKK)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum price in DKK (e.g. 300000)"
          },
          "priceType": {
            "title": "Price Type",
            "enum": [
              "Retail",
              "Engros",
              "Leasing"
            ],
            "type": "string",
            "description": "Filter by listing price type. Leave empty to include all types (Retail, engros, leasing). Set to \"Retail\" to show only standard retail listings."
          },
          "mileageFrom": {
            "title": "Mileage From (km)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum odometer reading in km."
          },
          "mileageTo": {
            "title": "Mileage To (km)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum odometer reading in km."
          },
          "fuelType": {
            "title": "Fuel Type",
            "enum": [
              "Benzin",
              "Diesel",
              "El",
              "Hybrid",
              "Plug-in hybrid"
            ],
            "type": "string",
            "description": "Fuel/drivetrain filter. Leave empty to include all."
          },
          "gearType": {
            "title": "Gear Type",
            "enum": [
              "Automatisk",
              "Manuel"
            ],
            "type": "string",
            "description": "Transmission filter."
          },
          "bodyType": {
            "title": "Body Type",
            "type": "string",
            "description": "Body style filter (Sedan, SUV, Hatchback, Stationcar, MPV, Coupé, Cabriolet)."
          },
          "sellerType": {
            "title": "Seller Type",
            "enum": [
              "Dealer",
              "Private"
            ],
            "type": "string",
            "description": "Dealer vs. private seller filter."
          },
          "zipCode": {
            "title": "Zip Code",
            "minimum": 1000,
            "maximum": 9999,
            "type": "integer",
            "description": "Danish postal code for geo-limited search (requires radiusKm)."
          },
          "radiusKm": {
            "title": "📡 Radius (km)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius around zipCode in kilometers."
          },
          "sortBy": {
            "title": "🔀 Sort By",
            "enum": [
              "relevance",
              "newest",
              "oldest",
              "priceAsc",
              "priceDesc",
              "yearDesc",
              "yearAsc",
              "mileageAsc",
              "mileageDesc"
            ],
            "type": "string",
            "description": "Sort order for search results."
          },
          "includeEngrosCvr": {
            "title": "Include Wholesale (engros CVR)",
            "type": "boolean",
            "description": "Include wholesale listings from CVR-registered dealers.",
            "default": false
          },
          "strictModelFilter": {
            "title": "Strict Model Filter",
            "type": "boolean",
            "description": "When searching for a specific model (e.g. Tesla Model S), filter out listings for other models that Bilbasen may include in results. Enabled by default.",
            "default": true
          },
          "maxResults": {
            "title": "💯 Max Results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of results to scrape (0 = unlimited)",
            "default": 25
          },
          "includeDetailPages": {
            "title": "Include Detail Pages",
            "type": "boolean",
            "description": "Fetch full detail for each listing (description, seller info, all specs). Disable for faster list-only scraping.",
            "default": true
          },
          "descriptionMaxLength": {
            "title": "✂️ Description Max Length",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate description text to this many characters. Useful for reducing output size. Leave empty for full description."
          },
          "compact": {
            "title": "📦 Compact Output",
            "type": "boolean",
            "description": "Return only 10 core fields (url, title, make, model, year, price, mileage, fuelType, sellerName, scrapedAt). Ideal for AI agents and MCP workflows.",
            "default": false
          },
          "incremental": {
            "title": "Incremental Mode",
            "type": "boolean",
            "description": "Only output new or changed listings since the last run. Uses content hashing stored in the actor's key-value store. First run outputs everything.",
            "default": false
          },
          "enrichFromDescription": {
            "title": "Enrich From Description (Danish NLP)",
            "type": "boolean",
            "description": "Parse seller description for service history, damage flags, warranty status, and registration number. Adds serviceStatus, damageFlag, damageSeverity, warrantyStatus, warrantyExpiry, registrationNumber, and coarseRegion fields.",
            "default": false
          },
          "imagesMode": {
            "title": "Images Mode",
            "enum": [
              "first3",
              "all"
            ],
            "type": "string",
            "description": "How many image URLs to include: \"first3\" returns only the first 3, \"all\" returns every available image URL. imagesCount always shows the total.",
            "default": "first3"
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy Configuration",
            "type": "object",
            "description": "Proxy configuration. Strongly recommended for reliable delivery."
          },
          "maxPages": {
            "title": "📄 Max Pages",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of search result pages to paginate through",
            "default": 200
          },
          "minDelayMs": {
            "title": "Min Delay (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum deterministic delay between requests (0 = no delay)",
            "default": 0
          },
          "maxDelayMs": {
            "title": "Max Delay (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum deterministic delay between requests (0 = no delay)",
            "default": 0
          },
          "telegramToken": {
            "title": "🤖 Telegram Bot Token",
            "type": "string",
            "description": "Telegram bot token from @BotFather. Required for Telegram notifications."
          },
          "telegramChatId": {
            "title": "💬 Telegram Chat ID",
            "type": "string",
            "description": "Telegram chat or channel ID where alerts are sent (e.g. \"-100123456789\" for a private group, or \"@yourchannel\")."
          },
          "discordWebhookUrl": {
            "title": "🎮 Discord Webhook URL",
            "type": "string",
            "description": "Discord incoming webhook URL. Get one from Server Settings → Integrations → Webhooks."
          },
          "slackWebhookUrl": {
            "title": "💼 Slack Webhook URL",
            "type": "string",
            "description": "Slack incoming webhook URL. Create at api.slack.com/messaging/webhooks."
          },
          "whatsappPhoneNumberId": {
            "title": "📱 WhatsApp Phone Number ID",
            "type": "string",
            "description": "WhatsApp Business phone number ID from Meta Business Manager (NOT the phone number itself — the numeric ID shown next to your business number). Free service-conversation messages within 24 hours of last user-initiated contact."
          },
          "whatsappAccessToken": {
            "title": "🔐 WhatsApp Access Token",
            "type": "string",
            "description": "Meta Cloud API access token with `whatsapp_business_messaging` scope. Get a permanent token from a system user in Meta Business Manager."
          },
          "whatsappTo": {
            "title": "📨 WhatsApp Recipient",
            "type": "string",
            "description": "Recipient phone in E.164 format (e.g. +4512345678). Recipient must have messaged your business number within the last 24 hours — outside that window, free-form text is rejected by Meta."
          },
          "webhookUrl": {
            "title": "🪝 Generic Webhook URL",
            "type": "string",
            "description": "Generic webhook URL that receives a JSON POST with the full listing payload + run metadata. Universal escape hatch for n8n / Make / Zapier / your own backend."
          },
          "webhookHeaders": {
            "title": "🔑 Webhook Headers",
            "type": "object",
            "description": "Optional headers (e.g. {\"Authorization\": \"Bearer xyz\"}) sent with the webhook POST."
          },
          "notificationLimit": {
            "title": "📊 Max Listings Per Notification",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of listings included in each notification message (1–20). Excess listings are still in the dataset; notifications get a summary line.",
            "default": 5
          },
          "notifyOnlyChanges": {
            "title": "🔄 Notify Only New/Changed",
            "type": "boolean",
            "description": "When Incremental Mode is on, only send notifications for new or changed listings. Has no effect outside incremental mode.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}