# Poland KRS Company Registry Scraper (`devilscrapes/krs-poland-company-registry-scraper`) Actor

Look up Polish companies in the official KRS (Krajowy Rejestr Sądowy) registry by KRS number — identity, registered address, legal representatives, PKD business-activity codes, share capital and current status — as clean, flattened JSON/CSV/Excel rows for KYC, AML and B2B lead-gen workflows.

- **URL**: https://apify.com/devilscrapes/krs-poland-company-registry-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Poland KRS Company Registry Scraper

**💰 $10.20 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Look up Polish companies in the official KRS (Krajowy Rejestr Sądowy) registry by KRS number — identity, registered address, legal representatives, PKD business-activity codes, share capital and current status — as clean, flattened JSON/CSV/Excel rows for KYC, AML and B2B lead-gen workflows.

</div>

***

### 🎯 What this scrapes

The Polish Ministry of Justice publishes KRS company records through a free, keyless JSON API (api-krs.ms.gov.pl), but each response is a ~50 KB envelope nesting identity, address, representatives, PKD codes and share capital three or four levels deep — exactly the kind of raw government JSON that KYC/AML analysts and B2B lead-gen teams currently have to hand-parse themselves. No visible rival on the Apify Store currently holds a KRS-register listing. This Actor takes a batch of KRS numbers, flattens each one into a single typed row, and lets you pick exactly which sections you need so you never pay transfer for data you didn't ask for.

### 🔥 What we handle for you

- 🧊 **Flattens a ~50 KB nested JSON envelope** into one clean row — identity, address, representatives, PKD codes, capital and status, picked via a Sections filter so you only pay transfer for what you need.
- 🔢 **KRS numbers stay strings, always** — leading zeros never get stripped by a spreadsheet export or an overeager number cast.
- 🔁 **Retries transient 429/5xx responses** with exponential backoff, honouring Retry-After when the Ministry's API sends one.
- 🩹 **Per-item and per-section fault isolation** — one bad KRS number or one missing sub-key logs a warning and moves on; it never crashes the run.
- 🧱 **Honest not-found handling** — an unknown KRS number still finishes SUCCEEDED with found: false and a warning, never a crashed run.
- 💰 **Pay-Per-Event pricing** — a delivered answer (found or not) still costs you $0.01; invalid input costs nothing.

### 💡 Use cases

- Run a KYC/AML check on a Polish counterparty by KRS number before onboarding.
- Build a Polish B2B prospect list from a batch of KRS registration numbers.
- Verify legal representatives and share capital for a due-diligence file.
- Screen a supplier or partner list for companies in liquidation or deleted from the register.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `krsNumbers` | `array` | **yes** | \['0000006865'] | Polish KRS (Krajowy Rejestr Sądowy) registration numbers to look up, e.g. <code>0000006865</code> or <code>6865</code>… |
| `registryType` | `string` | no | 'P' | Which KRS sub-register to query. |
| `sections` | `array` | no | \['identity', 'address', 'representatives', 'pkd', 'capital', 'status'] | Which flattened sections to project per row — the fewer you request, the leaner (and cheaper to transfer) each row is. |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': False} | api-krs.ms.gov.pl is a public keyless government JSON API with no anti-bot observed — leave this off unless your… |

#### Example input

```json
{
  "krsNumbers": [
    "0000006865",
    "6865",
    "9999999999"
  ],
  "registryType": "P",
  "sections": [
    "identity",
    "address",
    "representatives",
    "pkd",
    "capital",
    "status"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `krs_number` | `string` | Normalized 10-digit input, echoed back as a string (leading zeros preserved). |
| `registry_type` | `string` | Echoed input: 'P' (entrepreneurs) or 'S' (associations). |
| `found` | `boolean` | False if the API returned no record for this KRS number — not a failure. |
| `warning` | `string` | Populated when found is false, or a requested section failed to parse. |
| `name` | `string` | Registered entity name (identity section). |
| `legal_form` | `string` | e.g. SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ (identity section). |
| `nip` | `string` | Tax ID (identity section). |
| `regon` | `string` | Statistical ID (identity section). |
| `registration_date` | `string` | ISO YYYY-MM-DD (identity section). |
| `address_street` | `string` | Registered street address (address section). |
| `address_city` | `string` | Registered city (address section). |
| `address_postal_code` | `string` | Registered postal code (address section). |
| `address_country` | `string` | Registered country (address section). |
| `representatives` | `array` | Legal representatives (representatives section) — empty list when not requested or none on file. |
| `pkd_codes` | `array` | PKD business-activity codes (pkd section) — empty list when not requested or none on file. |
| `share_capital_amount` | `string` | Share capital amount (capital section). |
| `share_capital_currency` | `string` | Share capital currency, e.g. PLN (capital section). |
| `status` | `string` | e.g. active/liquidation/deleted (status section). |
| `source_url` | `string` | The exact OdpisAktualny URL queried for this row. |
| `scraped_at` | `string` | ISO 8601 UTC timestamp when this row was recorded. |

#### Example output

```json
{
  "krs_number": "0000006865",
  "registry_type": "P",
  "found": true,
  "warning": null,
  "name": "EXAMPLE SP\u00d3\u0141KA Z OGRANICZON\u0104 ODPOWIEDZIALNO\u015aCI\u0104",
  "legal_form": "SP\u00d3\u0141KA Z OGRANICZON\u0104 ODPOWIEDZIALNO\u015aCI\u0104",
  "nip": "5252445876",
  "regon": "015691077",
  "registration_date": "2001-07-25",
  "address_street": "ul. Przyk\u0142adowa 1",
  "address_city": "Warszawa",
  "address_postal_code": "00-001",
  "address_country": "Polska",
  "representatives": [
    {
      "name": "Jan Kowalski",
      "role": "Prezes Zarz\u0105du"
    }
  ],
  "pkd_codes": [
    {
      "code": "62.01.Z",
      "description": "Dzia\u0142alno\u015b\u0107 zwi\u0105zana z oprogramowaniem",
      "is_primary": true
    }
  ],
  "share_capital_amount": "50000.00",
  "share_capital_currency": "PLN",
  "status": "active",
  "source_url": "https://api-krs.ms.gov.pl/api/krs/OdpisAktualny/0000006865?rejestr=P&format=json",
  "scraped_at": "2026-09-06T12:00:00+00:00"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.20 | One-off warm-up charge per run |
| `result-scraped` | $0.01 | Per row pushed — found or not-found rows both bill; a negative existence check is still a delivered answer |

Example: 1 000 results at the rates above ≈ **$10.20**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- No keyless name/NIP/REGON search — v1 takes a list of KRS numbers only; the Ministry's public API has no such search endpoint.
- Only OdpisAktualny (current-state extract) is queried — historical change history (OdpisPelny) is out of scope for v1.
- rejestr=S (associations) may have minor structural differences from rejestr=P; any section that fails to parse degrades to a warning rather than crashing the row.

### ❓ FAQ

**Do I need an API key?**

No. api-krs.ms.gov.pl is a public Polish Ministry of Justice API and needs no credentials — leave the proxy setting off too.

**What happens if a KRS number doesn't exist?**

The row comes back with found: false and a warning describing what was queried — the run still finishes SUCCEEDED, you're never billed for a failed run just because one number was wrong.

**Can I search by company name or NIP instead of a KRS number?**

Not in v1 — the Ministry doesn't publish a keyless name/NIP/REGON search endpoint, so this Actor takes a list of KRS numbers. Look up the KRS number first on the official ekrs.ms.gov.pl portal if you only have a name or NIP.

**Why do some fields come back null?**

Each row only includes the sections you request in Sections to include; anything you didn't request comes back null or an empty list, which keeps rows lean and your transfer cost low.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `krsNumbers` (type: `array`):

Polish KRS (Krajowy Rejestr Sądowy) registration numbers to look up, e.g. <code>0000006865</code> or <code>6865</code> (auto zero-padded to 10 digits, leading zeros preserved). 1-200 per run.

## `registryType` (type: `string`):

Which KRS sub-register to query.

## `sections` (type: `array`):

Which flattened sections to project per row — the fewer you request, the leaner (and cheaper to transfer) each row is.

## `proxyConfiguration` (type: `object`):

api-krs.ms.gov.pl is a public keyless government JSON API with no anti-bot observed — leave this off unless your account requires egress through Apify Proxy.

## Actor input object example

```json
{
  "krsNumbers": [
    "0000006865",
    "0000123456",
    "9999999999"
  ],
  "registryType": "P",
  "sections": [
    "identity",
    "address",
    "representatives",
    "pkd",
    "capital",
    "status"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "krsNumbers": [
        "0000006865",
        "0000123456",
        "9999999999"
    ],
    "registryType": "P",
    "sections": [
        "identity",
        "address",
        "representatives",
        "pkd",
        "capital",
        "status"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/krs-poland-company-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 = {
    "krsNumbers": [
        "0000006865",
        "0000123456",
        "9999999999",
    ],
    "registryType": "P",
    "sections": [
        "identity",
        "address",
        "representatives",
        "pkd",
        "capital",
        "status",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/krs-poland-company-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 '{
  "krsNumbers": [
    "0000006865",
    "0000123456",
    "9999999999"
  ],
  "registryType": "P",
  "sections": [
    "identity",
    "address",
    "representatives",
    "pkd",
    "capital",
    "status"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call devilscrapes/krs-poland-company-registry-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/krs-poland-company-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/Uzr0bchm1Pxg7etA0/builds/cmUf67RhhBIxdIdYQ/openapi.json
