{
  "openapi": "3.0.1",
  "info": {
    "title": "Krak.dk Business Directory Scraper",
    "description": "Scrape Krak.dk, Denmark's leading business and phone directory. Search by keyword, browse by category and kommune (municipality), or fetch business detail pages directly. Get name, address, phone, email, website, CVR number, opening hours area, rating, and more - no login required.",
    "version": "1.0",
    "x-build-id": "57Wegzki1B8vJELWm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~krak-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-krak-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/crawlerbros~krak-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-krak-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/crawlerbros~krak-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-krak-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byCategory",
              "byUrl"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text keyword combining a category/trade and (optionally) a place, exactly like Krak's own search bar, e.g. \"restaurant København\", \"VVS Vanløse\", \"pizza Odense\", or just a business name.",
            "default": "restaurant København"
          },
          "category": {
            "title": "Category (mode=byCategory)",
            "enum": [
              "Restaurant",
              "Café",
              "Pizzeria",
              "Bar",
              "Hotel",
              "Frisør",
              "Skønhedsklinik",
              "Massageklinik",
              "Fysioterapeut",
              "Kiropraktor",
              "Tandlæge",
              "Læge",
              "Apotek",
              "Dyrlæge",
              "Psykolog",
              "Fodterapeut",
              "Fitnesscenter",
              "VVS",
              "Elektriker",
              "Tømrer",
              "Murer",
              "Malere",
              "Snedker",
              "Elinstallatør",
              "Glarmester",
              "Tagdækker",
              "Anlægsgartner",
              "Gartner",
              "Skadedyrsbekæmpelse",
              "Rengøring",
              "Flyttefirma",
              "Autoværksted",
              "Bilvask",
              "Biludlejning",
              "Autoophug",
              "Taxi",
              "Vognmænd",
              "Chauffør",
              "Entreprenør",
              "Byggemarked",
              "Møbelforretning",
              "Tøjbutik",
              "Skobutik",
              "Guldsmed",
              "Optiker",
              "Blomsterbutik",
              "Dyrehandel",
              "Boghandel",
              "Bager",
              "Slagter",
              "Supermarked",
              "Dagligvarebutik",
              "Advokat",
              "Revisor",
              "Ejendomsmægler",
              "Forsikring",
              "Bank",
              "Rejsebureau",
              "Bedemænd",
              "Vuggestue",
              "Sprogskole",
              "Låsesmed",
              "Skorstensfejer"
            ],
            "type": "string",
            "description": "A curated Krak.dk category/branche. Combine with `kommune` to scope to one municipality, or leave `kommune` empty for a nationwide browse (auto-sharded across all 98 kommuner up to `maxItems`).",
            "default": "Restaurant"
          },
          "customCategory": {
            "title": "Custom category override (mode=byCategory)",
            "type": "string",
            "description": "Type any category/branche text not in the curated dropdown (e.g. \"Vinhandel\"). Overrides `category` when set."
          },
          "kommune": {
            "title": "Kommune / municipality (mode=byCategory)",
            "enum": [
              "",
              "Albertslund",
              "Allerød",
              "Ballerup",
              "Bornholm",
              "Brøndby",
              "Dragør",
              "Egedal",
              "Fredensborg",
              "Frederiksberg",
              "Frederikssund",
              "Furesø",
              "Gentofte",
              "Gladsaxe",
              "Glostrup",
              "Gribskov",
              "Halsnæs",
              "Helsingør",
              "Herlev",
              "Hillerød",
              "Hvidovre",
              "Høje-Taastrup",
              "Hørsholm",
              "Ishøj",
              "København",
              "Lyngby-Taarbæk",
              "Rudersdal",
              "Rødovre",
              "Tårnby",
              "Vallensbæk",
              "Faxe",
              "Greve",
              "Guldborgsund",
              "Holbæk",
              "Kalundborg",
              "Køge",
              "Lejre",
              "Lolland",
              "Næstved",
              "Odsherred",
              "Ringsted",
              "Roskilde",
              "Slagelse",
              "Solrød",
              "Sorø",
              "Stevns",
              "Vordingborg",
              "Assens",
              "Billund",
              "Esbjerg",
              "Fanø",
              "Fredericia",
              "Faaborg-Midtfyn",
              "Haderslev",
              "Kerteminde",
              "Kolding",
              "Langeland",
              "Middelfart",
              "Nordfyns",
              "Nyborg",
              "Odense",
              "Svendborg",
              "Sønderborg",
              "Tønder",
              "Varde",
              "Vejen",
              "Vejle",
              "Ærø",
              "Aabenraa",
              "Favrskov",
              "Hedensted",
              "Herning",
              "Holstebro",
              "Horsens",
              "Ikast-Brande",
              "Lemvig",
              "Norddjurs",
              "Odder",
              "Randers",
              "Ringkøbing-Skjern",
              "Samsø",
              "Silkeborg",
              "Skanderborg",
              "Skive",
              "Struer",
              "Syddjurs",
              "Viborg",
              "Aarhus",
              "Brønderslev",
              "Frederikshavn",
              "Hjørring",
              "Jammerbugt",
              "Læsø",
              "Mariagerfjord",
              "Morsø",
              "Rebild",
              "Thisted",
              "Vesthimmerland",
              "Aalborg"
            ],
            "type": "string",
            "description": "Restrict the category browse to one of Denmark's 98 kommuner. Leave empty for a nationwide browse (auto-sharded across all kommuner up to `maxItems`).",
            "default": ""
          },
          "location": {
            "title": "Location filter (all modes)",
            "type": "string",
            "description": "Free-text place name (city, kommune, postal code). For mode=search/byCategory it's combined into the Krak.dk query text; for all modes it's also applied as a client-side safety-net filter on the resulting city/postal code/address."
          },
          "urls": {
            "title": "Business detail URLs (mode=byUrl)",
            "type": "array",
            "description": "Full krak.dk detail-page URLs, e.g. `https://www.krak.dk/caf%C3%A9+zirup+k%C3%B8benhavn+k/67493772/firma`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword filter",
            "type": "string",
            "description": "Only keep results whose name, description, or categories contain this text (case- and diacritics-insensitive)."
          },
          "minRating": {
            "title": "Minimum rating (0-5)",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Drop businesses with a review rating below this value. Only meaningful when `fetchDetails` is on (rating is a detail-page field) — records without a rating always pass through."
          },
          "fetchDetails": {
            "title": "Fetch full detail page per business",
            "type": "boolean",
            "description": "Visit each business's detail page to also collect email, website, CVR number, founding date, employee count, GPS coordinates, rating/review count, and description. Adds one extra Playwright page load per business (several seconds each). Best-effort: Krak.dk's anti-bot protection can rate-block a burst of detail-page requests from the same IP mid-run — the actor detects this automatically and falls back to listing-only data for the rest of the run rather than failing (see README Limitations). Defaults to off so the base run is always fast and fully reliable; turn on when you need the richer fields and can tolerate a partial fallback under heavy load.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Hard cap on emitted records. Note: a single Krak.dk query returns at most ~25 results (no working pagination was found upstream); mode=byCategory without a `kommune`/`location` auto-shards across all 98 kommuner to reach higher values. Each business detail fetch (when `fetchDetails` is on) takes several seconds due to Krak.dk's anti-bot challenge — keep this modest (10-30) for fast runs; larger values still work, just take longer.",
            "default": 25
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy settings. Leave empty to use no proxy — Krak.dk is reachable directly via the actor's browser-impersonating HTTP client. The actor automatically escalates to the free AUTO datacenter proxy group if it hits a persistent 403/429."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}