{
  "openapi": "3.0.1",
  "info": {
    "title": "PKT.pl Scraper | Polish Business Directory Leads",
    "description": "Scrape Polish companies from PKT.pl by keyword and city or from any search or company URL. Get name, category, address, GPS, phone, e-mail, website, rating and opening hours, plus NIP, REGON, social links and services. Monitor new companies.",
    "version": "1.0",
    "x-build-id": "e1pnMHPr8HvqiNoeb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trev0n~pkt-pl-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trev0n-pkt-pl-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/trev0n~pkt-pl-scraper/runs": {
      "post": {
        "operationId": "runs-sync-trev0n-pkt-pl-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/trev0n~pkt-pl-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-trev0n-pkt-pl-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": {
          "keywords": {
            "title": "🔎 Keywords or categories",
            "type": "array",
            "description": "What to search for on PKT.pl, in Polish, e.g. \"hydraulik\", \"dentysta\", \"biuro rachunkowe\" or a category name such as \"usługi hydrauliczne\". Each keyword is searched in every location below.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "📍 Locations",
            "type": "array",
            "description": "Polish cities or voivodeships, e.g. \"Warszawa\", \"Kraków\", \"Bielsko-Biała\" or \"mazowieckie\". Polish letters are optional (\"krakow\" works too). Leave empty to search all of Poland.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 Start URLs (optional, replaces the search above)",
            "type": "array",
            "description": "Paste PKT.pl search result pages (e.g. https://www.pkt.pl/szukaj/hydraulik/warszawa, also page 2+ links) or company pages (https://www.pkt.pl/firma/...). When set, the keywords and locations above are ignored.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "fetchDetails": {
            "title": "📄 Fetch company details",
            "type": "boolean",
            "description": "Open each company page to add NIP, REGON, founding year, social media links, slogan, the full list of services, the photo gallery and the latest reviews. Search results already include phone, e-mail, website, address and opening hours, so leave this off for plain contact lists.",
            "default": false
          },
          "maxResults": {
            "title": "🔢 Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of companies for the whole run (0 = no limit).",
            "default": 100
          },
          "maxPagesPerSearch": {
            "title": "📑 Max pages per search",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each keyword/location search after this many result pages (25 companies per page). 0 = all pages.",
            "default": 0
          },
          "compact": {
            "title": "🧹 Skip empty fields",
            "type": "boolean",
            "description": "Leave out fields without a value.",
            "default": false
          },
          "incremental": {
            "title": "🔔 Only new companies (monitoring)",
            "type": "boolean",
            "description": "Remember what this search returned last time and output only NEW companies (plus companies whose phone, e-mail, website, address or review count changed). Schedule it weekly for a cheap new-companies feed. The first run returns everything and saves the baseline. With company details on, every company page is still opened and billed on each run.",
            "default": false
          },
          "stateKey": {
            "title": "🗝️ Monitoring name",
            "type": "string",
            "description": "Optional. Name of the saved baseline. Leave empty to derive it from the search. Use a fixed name to keep the baseline when you tweak the search."
          },
          "emitUnchanged": {
            "title": "♻️ Also output unchanged companies",
            "type": "boolean",
            "description": "Monitoring only. Output companies seen before too, tagged UNCHANGED.",
            "default": false
          },
          "emitExpired": {
            "title": "⌛ Also output companies that disappeared",
            "type": "boolean",
            "description": "Monitoring only. Output companies that were in the last run but are gone now, tagged EXPIRED.",
            "default": false
          },
          "maxConcurrency": {
            "title": "⚡ Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages to load in parallel.",
            "default": 5
          },
          "maxRequestRetries": {
            "title": "🔁 Max retries per page",
            "minimum": 0,
            "maximum": 15,
            "type": "integer",
            "description": "How many times to retry a page that failed or was refused.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy",
            "type": "object",
            "description": "The default Apify Proxy works for this site. If PKT.pl refuses an IP address, the scraper switches to another one automatically.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}