# Poland KRS Financial Statements Scraper (`muhammadafzal/poland-krs-financial-statements-scraper`) Actor

Retrieve Polish KRS financial-document metadata, reporting periods, standardized financial fields, company identifiers, and optional source files directly from the official KRS document repository.

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

## Pricing

from $8.00 / 1,000 financial statement 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 KRS Financial Statements Scraper

**Free plan limit:** Free-plan users can receive up to **5 result records per run**. Paid-plan users retain the Actor's existing limits.

Retrieve structured records for annual financial statements and related corporate documents filed in Poland's National Court Register (Krajowy Rejestr Sądowy — KRS). The Actor scrapes directly from the official Ministry of Justice Financial Documents Repository (`rdf-przegladarka.ms.gov.pl`), enriched with company master data (legal name, NIP, REGON) from the official public KRS API (`api-krs.ms.gov.pl`).

**No external API key or third-party paid subscription is required.**

### Features

- **Direct official repository scraping:** Scrapes public corporate filings directly from `rdf-przegladarka.ms.gov.pl`.
- **Automatic KRS company enrichment:** Fetches official legal name, NIP, and REGON from `api-krs.ms.gov.pl`.
- **Standardized XML financial figures:** Extracts balance sheet and profit & loss figures (total assets, equity, net revenue, net profit/loss, operating profit/loss) directly from filed XML statements.
- **Source document downloading:** Optionally saves source files (XML, PDF, XHTML) directly to your run Key-Value store.
- **Pay-per-event pricing:** Transparent billing with tiered discounts and zero platform usage pass-through fees.

### Input

- `krsNumbers`: Array of 1 to 50 KRS numbers. Values may contain spaces or omit leading zeroes; each is normalized to 10 digits.
- `fromYear` / `toYear`: Inclusive major reporting-year window (e.g. 2023 to 2025).
- `documentTypes`: Document type values to keep (e.g. `financial_statement`, `approval_resolution`, `activity_report`, `audit_report`). Leave empty to include all filed documents.
- `includeStandardizedFields`: Extract normalized balance-sheet and profit-and-loss values when filed XML is present (default: `true`).
- `includeExtractedFields`: Extract all raw flattened XML tags. Enable only when exhaustive XML field mappings are required (default: `false`).
- `downloadFormat`: Optionally save document files to the key-value store (`none`, `original`, `pdf`, `html`, `all`).
- `maxResults`: Total document records across all companies (default: `100`, max: `5,000`).

Example:

```json
{
  "krsNumbers": ["0000028860", "0000005239"],
  "fromYear": 2023,
  "toYear": 2025,
  "documentTypes": ["financial_statement"],
  "includeStandardizedFields": true,
  "includeExtractedFields": false,
  "downloadFormat": "none",
  "maxResults": 100
}
```

### Output

Each dataset item represents one validated financial document record:

- `recordId`: Unique record identifier (e.g. `0000028860-1234567`).
- `krs`, `nip`, `regon`: Official company identifiers.
- `companyName`: Full legal name from KRS.
- `documentType`: Normalized document classification (`financial_statement`, `approval_resolution`, `activity_report`, etc.).
- `periodMajorYear`: Financial reporting year (e.g. `2023`).
- `periodFromDate` / `periodToDate`: Full reporting period dates.
- `filingDate` / `preparationDate`: Official submission and preparation timestamps.
- `isCorrection` / `isIasCompliant`: Correction and IAS/IFRS compliance flags.
- `standardizedFields`: Normalized financial metrics (`totalAssets`, `totalEquity`, `netRevenue`, `netProfitLoss`, `operatingProfitLoss`).
- `savedFiles`: Keys of files stored in the run Key-Value store.
- `source`: `"Official KRS Document Repository (RDF)"`.
- `sourceUrl`: Link to the repository search page.
- `scrapedAt`: ISO 8601 scraping timestamp.

The run summary and diagnostics are saved in `OUTPUT` in the default Key-Value store.

### Pricing

This Actor uses **Pay-Per-Event (PPE)** pricing with volume-based discount tiers:

| Event | Description | FREE Tier | BRONZE (2.5% off) | SILVER (5% off) | GOLD (20% off) |
|---|---|---:|---:|---:|---:|
| `apify-actor-start` | Actor start (one-time synthetic initialization) | $0.005 | $0.005 | $0.005 | $0.005 |
| `financial-statement-record` | One validated financial-document record in default dataset | $0.010 | $0.00975 | $0.0095 | $0.008 |
| `document-file` | One saved document file (PDF, XML, XHTML) in Key-Value store | $0.005 | $0.004875 | $0.00475 | $0.004 |

Platform compute and proxy costs are bundled into event prices; platform-usage pass-through is disabled (`isPPEPlatformUsagePaidByUser = false`).

#### Cost Examples

- **10 company statements (metadata & standardized figures, no files):** $0.005 (start) + 10 × $0.010 = **$0.105**
- **50 company statements with original PDF downloads:** $0.005 (start) + 50 × $0.010 + 50 × $0.005 = **$0.755**

### Local Development & Testing

```bash
npm ci
npm test
npm run preflight
apify run -p
```

# Actor input Schema

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

One to 50 KRS identifiers. Values may contain spaces or omit leading zeroes; the Actor normalizes each to 10 digits.

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

Optional legacy API key. The Actor scrapes the official KRS financial document repository directly without requiring an API key.

## `fromYear` (type: `integer`):

Keep documents whose major reporting year is this year or later.

## `toYear` (type: `integer`):

Keep documents whose major reporting year is this year or earlier.

## `documentTypes` (type: `array`):

Exact RDF document type values to keep. Leave empty to include every financial-document type.

## `includeStandardizedFields` (type: `boolean`):

Include normalized balance-sheet and profit-and-loss values when available from filed XML documents.

## `includeExtractedFields` (type: `boolean`):

Include the full flattened XML field map when source XML is available. This can make records large.

## `downloadFormat` (type: `string`):

Optionally download each document file (e.g. PDF or XML) into the run key-value store. File delivery is billed separately from metadata records.

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

Maximum total document records across all companies. The Actor stops cleanly at this cap.

## Actor input object example

```json
{
  "krsNumbers": [
    "0000028860"
  ],
  "fromYear": 2023,
  "toYear": 2025,
  "documentTypes": [
    "financial_statement"
  ],
  "includeStandardizedFields": true,
  "includeExtractedFields": false,
  "downloadFormat": "none",
  "maxResults": 100
}
```

# Actor output Schema

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

No description

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

No description

## `documents` (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 = {
    "krsNumbers": [
        "0000028860"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/poland-krs-financial-statements-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": ["0000028860"] }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/poland-krs-financial-statements-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": [
    "0000028860"
  ]
}' |
apify call muhammadafzal/poland-krs-financial-statements-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/poland-krs-financial-statements-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/1yh2auLLXBTUpOLSS/builds/aybD7gszGuGgQekjA/openapi.json
