{
  "openapi": "3.0.1",
  "info": {
    "title": "KRS Poland Companies Scraper: Register Data, PKD, Status",
    "description": "Polish companies from the official KRS register API of the Ministry of Justice: name, KRS, NIP and REGON numbers, legal form, status, address, PKD activity codes, share capital, branches and registration dates. Daily new registrations, changes by date or look-ups by KRS number. No personal data.",
    "version": "1.1",
    "x-build-id": "aBsN0wIE1nw7BZWzp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rowcraft~krs-poland-companies/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rowcraft-krs-poland-companies",
        "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/rowcraft~krs-poland-companies/runs": {
      "post": {
        "operationId": "runs-sync-rowcraft-krs-poland-companies",
        "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/rowcraft~krs-poland-companies/run-sync": {
      "post": {
        "operationId": "run-sync-rowcraft-krs-poland-companies",
        "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": {
          "mode": {
            "title": "What to get",
            "enum": [
              "new",
              "changes",
              "lookup"
            ],
            "type": "string",
            "description": "New registrations: entities first registered in KRS on the chosen dates. All changes: every entity with a registry entry on those dates (new, changed, suspended, in liquidation, deleted). Look up: the KRS numbers you list below.",
            "default": "new"
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "First day, as YYYY-MM-DD or relative: \"yesterday\", \"7 days\". Leave both dates empty to use the latest day with registry entries; for new registrations, the latest working day (weekends and public holidays bring only automatic changes). Polish time."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Last day, as YYYY-MM-DD or relative. Empty = today when a From date is set."
          },
          "krsNumbers": {
            "title": "KRS numbers",
            "type": "array",
            "description": "For \"Look up\": KRS numbers with or without the leading zeros (0000028860 or 28860), or links that contain the number.",
            "items": {
              "type": "string"
            }
          },
          "register": {
            "title": "Register",
            "enum": [
              "auto",
              "P",
              "S"
            ],
            "type": "string",
            "description": "KRS has two registers: entrepreneurs (companies, partnerships, cooperatives) and associations/foundations. Auto checks both.",
            "default": "auto"
          },
          "voivodeships": {
            "title": "Voivodeships",
            "type": "array",
            "description": "Keep only entities seated in these voivodeships (provinces).",
            "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 Silesian)",
                "Kujawsko-pomorskie (Kuyavian-Pomeranian)",
                "Lubelskie (Lublin)",
                "Lubuskie (Lubusz)",
                "Łódzkie (Łódź)",
                "Małopolskie (Lesser Poland)",
                "Mazowieckie (Masovian, Warsaw)",
                "Opolskie (Opole)",
                "Podkarpackie (Subcarpathian)",
                "Podlaskie",
                "Pomorskie (Pomeranian, Gdańsk)",
                "Śląskie (Silesian, Katowice)",
                "Świętokrzyskie (Holy Cross)",
                "Warmińsko-mazurskie (Warmian-Masurian)",
                "Wielkopolskie (Greater Poland, Poznań)",
                "Zachodniopomorskie (West Pomeranian, Szczecin)"
              ]
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Keep only entities seated in these cities, e.g. \"Warszawa\", \"Kraków\", \"Wrocław\". Polish spelling.",
            "items": {
              "type": "string"
            }
          },
          "pkdCodes": {
            "title": "Activity codes (PKD)",
            "type": "array",
            "description": "Keep only entities with these PKD activity codes or prefixes, e.g. \"62\" (IT), \"62.01\", \"41.20.Z\", \"68\" (real estate).",
            "items": {
              "type": "string"
            }
          },
          "pkdMainOnly": {
            "title": "Match the main activity only",
            "type": "boolean",
            "description": "Off: an entity matches when any of its registered activities has the code. On: only the main (predominant) activity counts.",
            "default": false
          },
          "legalForms": {
            "title": "Legal forms",
            "type": "array",
            "description": "Keep only these legal forms.",
            "items": {
              "type": "string",
              "enum": [
                "SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ",
                "SPÓŁKA AKCYJNA",
                "PROSTA SPÓŁKA AKCYJNA",
                "SPÓŁKA JAWNA",
                "SPÓŁKA KOMANDYTOWA",
                "SPÓŁKA KOMANDYTOWO-AKCYJNA",
                "SPÓŁKA PARTNERSKA",
                "SPÓŁDZIELNIA",
                "FUNDACJA",
                "STOWARZYSZENIE",
                "ODDZIAŁ ZAGRANICZNEGO PRZEDSIĘBIORCY"
              ],
              "enumTitles": [
                "Limited liability company (sp. z o.o.)",
                "Joint-stock company (S.A.)",
                "Simple joint-stock company (P.S.A.)",
                "General partnership (sp.j.)",
                "Limited partnership (sp.k.)",
                "Limited joint-stock partnership (S.K.A.)",
                "Professional partnership (sp.p.)",
                "Cooperative",
                "Foundation",
                "Association",
                "Branch of a foreign company"
              ]
            }
          },
          "statuses": {
            "title": "Status",
            "type": "array",
            "description": "Keep only entities in these states. Useful with \"All registry changes\" to catch liquidations, suspensions and deletions.",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "suspended",
                "in liquidation",
                "dissolved",
                "bankruptcy",
                "restructuring",
                "deleted"
              ],
              "enumTitles": [
                "Active",
                "Suspended",
                "In liquidation",
                "Dissolved (awaiting deletion)",
                "Bankruptcy",
                "Restructuring",
                "Deleted from the register"
              ]
            }
          },
          "maxItems": {
            "title": "Maximum companies",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many companies. 0 = no limit (every match in the chosen dates).",
            "default": 100
          },
          "includeActivities": {
            "title": "Include all activity codes",
            "type": "boolean",
            "description": "Adds the full list of registered PKD codes and descriptions (the main activity is always included).",
            "default": true
          },
          "includeBranches": {
            "title": "Include branches",
            "type": "boolean",
            "description": "Adds the list of registered branches (name and city).",
            "default": true
          },
          "onlyNew": {
            "title": "Only new rows since the last run",
            "type": "boolean",
            "description": "Remember the rows already delivered to you (in a key-value store in your Apify account) and deliver only rows that appeared since the last run with the same state key. The first run delivers everything that matches; later runs cost only the new rows. Ideal for schedules.",
            "default": false
          },
          "stateName": {
            "title": "State name",
            "type": "string",
            "description": "Name of the memory used by \"Only new rows\". Use a different name for each schedule or search (for example `stockholm-python`) so they do not share one memory.",
            "default": "default"
          },
          "notifyUrl": {
            "title": "Notify this URL when the run ends",
            "type": "string",
            "description": "A webhook address that receives one JSON POST with the number of new rows and links to the dataset: a Slack or Discord incoming webhook, a Make, n8n or Zapier catch hook, or your own endpoint. The message is also in the `text` (Slack) and `content` (Discord) fields."
          },
          "notifyWhenEmpty": {
            "title": "Notify also when there are no new rows",
            "type": "boolean",
            "description": "By default the notification is sent only when at least one row was delivered.",
            "default": false
          },
          "requestIntervalMs": {
            "title": "Delay between API requests (ms)",
            "minimum": 250,
            "maximum": 10000,
            "type": "integer",
            "description": "Default 1000 ms (one request per second); each company is one request. Minimum 250.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}