# Poland KRZ National Debtor Registry Scraper (`muhammadafzal/poland-krz-national-debtor-registry-scraper`) Actor

Search Polish National Debtor Registry (KRZ) and KRS proceedings by KRS or NIP and return structured bankruptcy, restructuring, and debtor records via direct official registry scraping.

- **URL**: https://apify.com/muhammadafzal/poland-krz-national-debtor-registry-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Other
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 krz proceeding records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Poland KRZ National Debtor Registry Scraper

Search Polish National Debtor Registry (KRZ) and National Court Register (KRS) bankruptcy, restructuring, liquidation, and enforcement proceeding records by KRS or NIP, and export structured dataset records.

**No API key is required.** The Actor performs direct scraping of the official Polish Ministry of Justice Open Register (`api-krs.ms.gov.pl`) and Ministry of Finance White List Register (`wl-api.mf.gov.pl`). If you have a licensed MGBI API key, you can optionally supply it to route queries through MGBI.

### Data sources and access

1. **Official Ministry of Justice KRS Register (`api-krs.ms.gov.pl` - Default / Free):**
   - Direct, open public government endpoint.
   - Accesses Dział 6 (bankruptcy proceedings `postepowanieUpadlosciowe`, restructuring proceedings `postepowanieRestrukturyzacyjne`, liquidation `likwidacja`, dissolution `rozwiazanieUniewaznienie`, compulsory management `zarzadKomisarycznyPrzymusowy`).
   - Accesses Dział 4 (official tax, customs, and social insurance ZUS arrears, enforcement proceedings `informacjaOEgzekucji`, discontinued enforcements due to lack of assets, and creditor claims).
2. **Ministry of Finance White List Register (`wl-api.mf.gov.pl` - Default / Free):**
   - Automatically resolves 10-digit Polish NIP tax identifiers to their official KRS number, registered legal name, REGON, and address.
3. **MGBI Public Registers API (Optional):**
   - Supply `apiKey` only if you want to use your licensed MGBI account.

### What each result contains

One dataset item represents one validated proceeding record. It includes:

| Field | Meaning | Example |
| --- | --- | --- |
| `searchReference` | Label supplied for the lookup | `sample-debtor-pbg` |
| `debtorName` | Official registered entity name | `PBG SPÓŁKA AKCYJNA W RESTRUKTURYZACJI W LIKWIDACJI` |
| `krs` | 10-digit KRS number | `0000184508` |
| `nip` | 10-digit NIP tax ID | `7772194746` |
| `proceedingId` | Registry proceeding ID or signature | `XI GU 149/12` |
| `caseSignature` | Court case signature | `XI GU 149/12` |
| `proceedingType` | Proceeding category | `Postępowanie upadłościowe` |
| `proceedingStatus` | Current legal proceeding status | `Zakończone (XI GUP 29/12)` |
| `startedAt` | Opening / declaration date | `2012-06-13` |
| `createdAt` | Entity KRS registration date | `2004-01-02` |
| `endedAt` | Conclusion / completion date | `2016-07-20` |
| `source` | Source registry | `KRS Rejestr Dłużników i Postępowań (api-krs.ms.gov.pl)` |
| `sourceUrl` | Official registry portal | `https://krz.ms.gov.pl/` |
| `retrievedAt` | UTC timestamp of extraction | `2026-10-06T10:00:00.000Z` |

**Privacy guarantee:** PESEL numbers are never written to dataset records, `OUTPUT`, terminal status messages, or logs. Reference labels containing 10-digit-or-longer numbers are rejected to prevent identifier leakage.

### Input

Provide one or more identifier searches (`krs` or `nip`). The default prefill checks PBG S.A. (`0000184508`), a public entity with documented bankruptcy and restructuring proceedings.

```json
{
  "searches": [
    { "identifierType": "krs", "identifier": "0000184508", "reference": "sample-debtor-pbg" }
  ],
  "maxSearches": 1,
  "maxResults": 100
}
```

Or query by Polish NIP tax ID:

```json
{
  "searches": [
    { "identifierType": "nip", "identifier": "7772194746", "reference": "debtor-by-nip" }
  ],
  "maxSearches": 1,
  "maxResults": 100
}
```

Optional settings:

- `apiKey`: Supply your licensed MGBI key only if routing through MGBI. Leave blank for direct public scraping.
- `maxSearches`: Maximum number of identifiers to process (1 to 20).
- `maxResults`: Hard cap on proceeding records written to the dataset across all searches (1 to 1,000). Free Apify plan runs are capped at 5 records.

### Run summary and outcomes

The Actor writes diagnostics to the default key-value store as `OUTPUT`. Outcomes:

- `DATA`: One or more proceedings delivered.
- `EMPTY`: Valid entity found in registry, but has no bankruptcy, restructuring, or debtor proceedings registered (e.g. solvent companies).
- `PARTIAL`: One or more lookups had warnings (e.g. entity not found in registry or sole proprietorship without commercial court entries).
- `REJECTED`: Invalid input syntax or missing required fields.
- `FAILED`: Systemic network failure.

### Billing (Pay per event)

Monetized with Pay-per-event (PPE). Platform usage is covered (`isPPEPlatformUsagePaidByUser = false`).

| Event | FREE | BRONZE | SILVER | GOLD | When charged |
| --- | ---: | ---: | ---: | ---: | --- |
| Actor start (`apify-actor-start`) | $0.005 | $0.005 | $0.005 | $0.005 | Once when a run starts |
| KRZ proceeding record (`apify-default-dataset-item`) | $0.010 | $0.00975 | $0.00950 | $0.00800 | Per validated proceeding saved to dataset |

### Local development

```bash
npm test
npm run validate:input
npm run preflight
apify run
```

# Actor input Schema

## `searches` (type: `array`):

Use this to check specific KRZ/KRS subjects. Add KRS (10 digits), NIP (10 digits), or PESEL (11 digits) and an optional reference label. The Actor processes searches in order up to maxSearches; it does not perform name-based bulk discovery.

## `apiKey` (type: `string`):

Optional: Supply your licensed MGBI Public Registers API key if you want to route lookups through MGBI. If omitted (default), the Actor uses direct official Ministry of Justice and Ministry of Finance registry scraping with no API key required.

## `maxSearches` (type: `integer`):

Maximum number of identifiers looked up. Defaults to 1 to bound lookup time; set up to 20 to process more of the supplied searches.

## `maxResults` (type: `integer`):

Hard cap on proceeding records written to the dataset across all searches. Free Apify plan runs are capped at 5, even when a higher value is requested.

## `refreshTimeoutSeconds` (type: `integer`):

Maximum seconds to wait for each provider/registry request before recording a timeout warning.

## Actor input object example

```json
{
  "searches": [
    {
      "identifierType": "krs",
      "identifier": "0000184508",
      "reference": "sample-debtor-pbg"
    }
  ],
  "maxSearches": 1,
  "maxResults": 100,
  "refreshTimeoutSeconds": 90
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searches": [
        {
            "identifierType": "krs",
            "identifier": "0000184508",
            "reference": "sample-debtor-pbg"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/poland-krz-national-debtor-registry-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "searches": [{
            "identifierType": "krs",
            "identifier": "0000184508",
            "reference": "sample-debtor-pbg",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/poland-krz-national-debtor-registry-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searches": [
    {
      "identifierType": "krs",
      "identifier": "0000184508",
      "reference": "sample-debtor-pbg"
    }
  ]
}' |
apify call muhammadafzal/poland-krz-national-debtor-registry-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/poland-krz-national-debtor-registry-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SmtB0RotifYh8A4HZ/builds/2EqrbK69IfTQ866i8/openapi.json
