{
  "openapi": "3.0.1",
  "info": {
    "title": "Poland KRS Company Monitor – New Companies & Changes (API)",
    "description": "Monitor the Polish National Court Register (KRS) via the official Open API: daily new company registrations, all entities changed in the register, or a KRS-number watch list. NIP, REGON, address, PKD, capital, board, shareholders, liquidation/bankruptcy flags.",
    "version": "0.1",
    "x-build-id": "YTC6odIdGrXjNtagD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~poland-krs-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-poland-krs-monitor",
        "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/gazidev~poland-krs-monitor/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-poland-krs-monitor",
        "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/gazidev~poland-krs-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-poland-krs-monitor",
        "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": "Mode",
            "enum": [
              "newCompanies",
              "allChanges",
              "lookup"
            ],
            "type": "string",
            "description": "**New companies**: entities first registered in the KRS in the date range (fresh B2B leads). **All changes**: every entity with a new register entry on those days (board, address, capital, liquidation, ...). **Lookup**: current extract for your KRS numbers; turn on *Only new or changed* to use it as a watch list.",
            "default": "newCompanies"
          },
          "daysBack": {
            "title": "Last N days",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "New companies / all changes: bulletin days from today minus N to today. Ignored when *Date from* is set. The register publishes no entries on weekends and public holidays.",
            "default": 3
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "YYYY-MM-DD (after 2021-12-08). Overrides *Last N days*. Max range 31 days."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive. Default today."
          },
          "krsNumbers": {
            "title": "KRS numbers",
            "type": "array",
            "description": "Lookup mode: KRS numbers, with or without leading zeros, e.g. `0000019193` (PKP S.A.). No name search - the official API is keyed by KRS number.",
            "items": {
              "type": "string"
            }
          },
          "registers": {
            "title": "Registers",
            "type": "array",
            "description": "Which KRS register(s) to read. `P` = companies (sp. z o.o., S.A., partnerships, cooperatives...). `S` = associations and foundations. Each extra register costs one more API call per KRS number not found in the first one.",
            "items": {
              "type": "string",
              "enum": [
                "P",
                "S"
              ],
              "enumTitles": [
                "P - Register of entrepreneurs (companies)",
                "S - Associations, foundations, other organisations"
              ]
            },
            "default": [
              "P"
            ]
          },
          "legalForms": {
            "title": "Legal forms",
            "type": "array",
            "description": "Keep only these legal forms. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "SPZOO",
                "SA",
                "PSA",
                "SPK",
                "SPJ",
                "SKA",
                "SPP",
                "COOP",
                "FOUNDATION",
                "ASSOCIATION",
                "BRANCH",
                "OTHER"
              ],
              "enumTitles": [
                "sp. z o.o. (LLC)",
                "S.A. (joint-stock)",
                "P.S.A. (simple joint-stock)",
                "sp.k. (limited partnership)",
                "sp.j. (general partnership)",
                "S.K.A. (partnership limited by shares)",
                "sp.p. (professional partnership)",
                "Spółdzielnia (cooperative)",
                "Fundacja (foundation)",
                "Stowarzyszenie (association)",
                "Foreign branch (oddział)",
                "Other"
              ]
            }
          },
          "voivodeships": {
            "title": "Voivodeships (regions)",
            "type": "array",
            "description": "Keep only entities seated in these voivodeships. Empty = all Poland.",
            "items": {
              "type": "string",
              "enum": [
                "DOLNOSLASKIE",
                "KUJAWSKO-POMORSKIE",
                "LUBELSKIE",
                "LUBUSKIE",
                "LODZKIE",
                "MALOPOLSKIE",
                "MAZOWIECKIE",
                "OPOLSKIE",
                "PODKARPACKIE",
                "PODLASKIE",
                "POMORSKIE",
                "SLASKIE",
                "SWIETOKRZYSKIE",
                "WARMINSKO-MAZURSKIE",
                "WIELKOPOLSKIE",
                "ZACHODNIOPOMORSKIE"
              ],
              "enumTitles": [
                "Dolnośląskie (Wrocław)",
                "Kujawsko-pomorskie (Bydgoszcz/Toruń)",
                "Lubelskie (Lublin)",
                "Lubuskie",
                "Łódzkie (Łódź)",
                "Małopolskie (Kraków)",
                "Mazowieckie (Warsaw)",
                "Opolskie",
                "Podkarpackie (Rzeszów)",
                "Podlaskie (Białystok)",
                "Pomorskie (Gdańsk)",
                "Śląskie (Katowice)",
                "Świętokrzyskie",
                "Warmińsko-mazurskie",
                "Wielkopolskie (Poznań)",
                "Zachodniopomorskie (Szczecin)"
              ]
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Keep only entities seated in these towns, e.g. `Warszawa`, `Kraków`, `Wrocław` (accents optional).",
            "items": {
              "type": "string"
            }
          },
          "pkdCodes": {
            "title": "PKD activity codes",
            "type": "array",
            "description": "Polish activity codes (PKD, NACE-based), prefix match: `62` (IT), `62.01`, `68.20.Z`, `41` (construction). Matches the main activity unless the option below is on.",
            "items": {
              "type": "string"
            }
          },
          "pkdMatchAnyActivity": {
            "title": "Match PKD against all activities",
            "type": "boolean",
            "description": "Also match secondary activities (companies often list 10+ codes).",
            "default": false
          },
          "minShareCapital": {
            "title": "Minimum share capital (PLN)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip entities with lower registered share capital (sp. z o.o. minimum is 5,000 PLN)."
          },
          "excludeLiquidationAndBankruptcy": {
            "title": "Exclude liquidation / bankruptcy / dissolved",
            "type": "boolean",
            "description": "Skip entities with liquidation, bankruptcy or dissolution entries (KRS section 6).",
            "default": false
          },
          "includeBoardAndOwners": {
            "title": "Include board, prokurents and shareholders",
            "type": "boolean",
            "description": "Add `board`, `supervisoryBoard`, `prokurents` and `shareholders` arrays. Note: the official API anonymises names of natural persons (e.g. `J*** K*****`); corporate shareholders are shown in full with their KRS/REGON.",
            "default": true
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed since the last run",
            "type": "boolean",
            "description": "Monitoring: remembers results in a named key-value store. Lookup mode outputs only KRS numbers with a new register entry since the last run (with `changedFields`); bulletin modes skip entities already returned. Use with a schedule.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Separate memory per monitor when you run several schedules (e.g. `clients`, `warsaw-it`).",
            "default": "default"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many companies. 0 = no limit (one business day has ~300 new and ~3,000 changed entities).",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}