{
  "openapi": "3.0.1",
  "info": {
    "title": "Poland Road Transport Operators Scraper - Permits & Licences",
    "description": "Scrape Poland's road-transport operators from GITD's KREPTD open-data extracts: about 77,000 goods and passenger permits, licences and intermediaries with legal form, address, voivodeship, permit or licence number and expiry. Flags operators new, changed or removed since the previous extract.",
    "version": "0.1",
    "x-build-id": "cYnFSJMdxOUwSVHm9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapersdelight~pl-road-transport-operators-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapersdelight-pl-road-transport-operators-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/scrapersdelight~pl-road-transport-operators-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapersdelight-pl-road-transport-operators-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/scrapersdelight~pl-road-transport-operators-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapersdelight-pl-road-transport-operators-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": {
          "registers": {
            "title": "Registers",
            "type": "array",
            "description": "Which GITD registers to read. Rows in the newest extracts: goods permits 28,521 · passenger permits 758 · goods licences 44,229 · passenger licences 2,825 · passenger-transport intermediaries 586.",
            "items": {
              "type": "string",
              "enum": [
                "goods-permits",
                "passenger-permits",
                "goods-licences",
                "passenger-licences",
                "passenger-intermediaries"
              ],
              "enumTitles": [
                "Goods operator permits - zezwolenia, przewóz rzeczy (28,521)",
                "Passenger operator permits - zezwolenia, przewóz osób (758)",
                "Goods licences - licencje towarowe, TU- (44,229)",
                "Passenger licences - licencje osobowe, OU- (2,825)",
                "Passenger-transport intermediaries - pośrednictwo, PO- (586)"
              ]
            },
            "default": [
              "goods-permits"
            ]
          },
          "editionDate": {
            "title": "Extract date",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Leave empty for the newest extract. Or give a date to read the newest extract published on or before it, e.g. 2024-12-31. Permits go back to 2018-12-17, licences to 2019-2020, intermediaries to 2024-07-08."
          },
          "voivodeships": {
            "title": "Voivodeships",
            "type": "array",
            "description": "Only operators registered in these voivodeships. Empty = all of Poland. The intermediaries register has no voivodeship column, so its rows are dropped when this is set.",
            "items": {
              "type": "string",
              "enum": [
                "dolnośląskie",
                "kujawsko-pomorskie",
                "lubelskie",
                "lubuskie",
                "łódzkie",
                "małopolskie",
                "mazowieckie",
                "opolskie",
                "podkarpackie",
                "podlaskie",
                "pomorskie",
                "śląskie",
                "świętokrzyskie",
                "warmińsko-mazurskie",
                "wielkopolskie",
                "zachodniopomorskie"
              ],
              "enumTitles": [
                "Dolnośląskie (Lower Silesia)",
                "Kujawsko-pomorskie (Kuyavia-Pomerania)",
                "Lubelskie (Lublin)",
                "Lubuskie (Lubusz)",
                "Łódzkie (Łódź)",
                "Małopolskie (Lesser Poland)",
                "Mazowieckie (Masovia)",
                "Opolskie (Opole)",
                "Podkarpackie (Subcarpathia)",
                "Podlaskie (Podlachia)",
                "Pomorskie (Pomerania)",
                "Śląskie (Silesia)",
                "Świętokrzyskie (Holy Cross)",
                "Warmińsko-mazurskie (Warmia-Masuria)",
                "Wielkopolskie (Greater Poland)",
                "Zachodniopomorskie (West Pomerania)"
              ]
            },
            "default": []
          },
          "cities": {
            "title": "Cities / localities",
            "type": "array",
            "description": "Keep operators whose locality (Miejscowość) or post town equals one of these, e.g. \"Warszawa\", \"Poznań\", \"lodz\". Case and diacritics are ignored.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postalCodePrefixes": {
            "title": "Postcode prefixes",
            "type": "array",
            "description": "Keep operators whose postcode starts with one of these, e.g. \"00-\" or \"02\" (Warsaw), \"60-1\". Only digits are compared.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "legalForms": {
            "title": "Legal forms",
            "type": "array",
            "description": "Keep these legal forms (Charakter prawny). The intermediaries register has no legal-form column.",
            "items": {
              "type": "string",
              "enum": [
                "sole-trader",
                "sp-z-oo",
                "civil-partnership",
                "general-partnership",
                "limited-partnership",
                "sp-z-oo-sp-k",
                "sp-z-oo-sp-j",
                "joint-stock",
                "limited-joint-stock",
                "cooperative",
                "foundation",
                "association",
                "state-enterprise",
                "public-body",
                "other"
              ],
              "enumTitles": [
                "Sole trader (osoba fizyczna)",
                "Sp. z o.o. (limited company)",
                "Spółka cywilna (civil partnership)",
                "Spółka jawna (general partnership)",
                "Spółka komandytowa (limited partnership)",
                "Sp. z o.o. sp.k.",
                "Sp. z o.o. sp.j.",
                "Spółka akcyjna (S.A.)",
                "Spółka komandytowo-akcyjna (S.K.A.)",
                "Spółdzielnia (cooperative)",
                "Fundacja (foundation)",
                "Stowarzyszenie / organizacja (association)",
                "Przedsiębiorstwo państwowe (state enterprise)",
                "Public body",
                "Other"
              ]
            },
            "default": []
          },
          "nameContains": {
            "title": "Name contains",
            "type": "array",
            "description": "Keep operators whose name contains any of these words, e.g. \"trans\", \"logistics\", \"bus\".",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "nameExcludes": {
            "title": "Name excludes",
            "type": "array",
            "description": "Drop operators whose name contains any of these words, e.g. \"taxi\".",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "authorisationNumbers": {
            "title": "Permit / licence numbers",
            "type": "array",
            "description": "Look up specific numbers, e.g. \"25661\", \"TU-047218\", \"OU-004837\". Leading zeros and spaces are ignored.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "licenceStatus": {
            "title": "Licence status",
            "enum": [
              "any",
              "valid",
              "expired"
            ],
            "type": "string",
            "description": "Computed from the licence's valid-to date against the day of the run. Permits and intermediary licences have no expiry in the extract: \"valid\" keeps them, \"expired\" drops them.",
            "default": "any"
          },
          "licenceExpiresWithinDays": {
            "title": "Licence expires within (days)",
            "minimum": 0,
            "maximum": 36500,
            "type": "integer",
            "description": "Only licences still valid today that expire within this many days, e.g. 90. Permits are dropped when this is set."
          },
          "editionChanges": {
            "title": "Changes since the previous extract",
            "enum": [
              "off",
              "flag",
              "new",
              "changed",
              "removed",
              "all-changes"
            ],
            "type": "string",
            "description": "Compare the extract with GITD's previous one. \"New\" = numbers not in the previous extract; \"changed\" = name, address, legal form or expiry moved (with changedFields + previousValues); \"removed\" = gone since (rows from the older extract). Goods permits Jun -> Dec 2025: 919 new, 834 changed, 1,716 removed.",
            "default": "off"
          },
          "onlyNewSinceLastRun": {
            "title": "Only rows not delivered before",
            "type": "boolean",
            "description": "Skip rows this actor already delivered to you in earlier runs with the same monitor key (kept in a named key-value store). Good for a schedule that should only pick up new extracts.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Name of the delivered-rows memory used by the option above, e.g. \"mazowieckie-hauliers\". Different keys keep separate histories.",
            "default": "default"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "source",
              "name",
              "postalCode",
              "voivodeship",
              "licenceValidUntil"
            ],
            "type": "string",
            "description": "Order of the rows. \"As published\" is fastest: a small run without filters reads only the top of the file.",
            "default": "source"
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many rows. 0 = no limit (all five registers together are about 76,900 rows).",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed: dane.gov.pl answers direct requests. A proxy you set here is used only if a direct request fails.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}