# Polish Legal Acts API – Dziennik Ustaw & ELI (`enterprising_hamster/polish-legal-acts-eli`) Actor

Polish legal acts (akty prawne) from the official Sejm ELI API — Dziennik Ustaw and Monitor Polski. Metadata, legal references and optional plain text. Export CSV, JSON or Excel.

- **URL**: https://apify.com/enterprising_hamster/polish-legal-acts-eli.md
- **Developed by:** [Kamil Kaczmarek](https://apify.com/enterprising_hamster) (community)
- **Categories:** Developer tools, Automation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.40 / 1,000 act with texts

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 Legal Acts API – Dziennik Ustaw & ELI

**Poland legal acts API**: search **akty prawne** from the official [Sejm ELI API](https://api.sejm.gov.pl/eli) — **Dziennik Ustaw** and **Monitor Polski**. Export ELI identifiers, titles, dates, keywords, legal references, and optional plain text (**pełny tekst aktu**) from HTML or PDF for legal-tech tools, compliance monitoring, and RAG. Filter by year, dates, title, keywords, act type, or in-force status; monitor new and changed acts with persistent revision tracking. Polski opis: **akty prawne** z oficjalnego API **ELI** Sejmu (DU i MP) — metadane, powiązania i opcjonalnie tekst; eksport CSV, JSON lub Excel.

### What data can you get

- ELI identifier, publication, year, position, Polish title, act type, and source status.
- Announcement, promulgation, change, and legal status dates, plus entry into force when available.
- Official keywords, issuing bodies, and references grouped by reference type.
- Links to the ELI record, ISAP page, and available HTML and PDF documents.
- Optional plain text with its source, retained character count, truncation flag, and extraction error.

`includeDetails=true` is the default. It fetches the fields that the search response may omit, including keywords, references, and `inForce`. With details disabled, missing values remain `null`, empty arrays, or an empty references object. The Actor preserves source status strings such as `IN_FORCE`.

### How to use

1. Set `publisher` to `DU` for Dziennik Ustaw or `MP` for Monitor Polski.
2. Provide at least `year` or `dateFrom`. Dates use `YYYY-MM-DD`.
3. Add filters and set `maxItems`. Enable `includeText` for document text.
4. Run the Actor and export the dataset as JSON, CSV, or Excel through Apify.

Start with this input:

```json
{
  "publisher": "DU",
  "year": 2026,
  "maxItems": 5,
  "includeDetails": true,
  "includeText": false
}
```

The [examples](examples) include a [five-item smoke run](examples/smoke.json), [weekly DU monitoring](examples/monitor-last-week.json), [MP keyword search](examples/mp-keyword.json), and [tax acts with text](examples/du-tax-with-text.json). The weekly example covers 2026-10-12 through 2026-10-18. Update those fixed dates before using it for another week.

### Input

Dziennik Ustaw 2026 tax-related acts with extracted text (capped):

```json
{
  "publisher": "DU",
  "year": 2026,
  "titleContains": "podatk",
  "includeDetails": true,
  "includeText": true,
  "maxTextChars": 100000,
  "maxItems": 5
}
```

Monitor Polski 2026 by official keyword (metadata + details):

```json
{
  "publisher": "MP",
  "year": 2026,
  "keywords": ["ceny"],
  "includeDetails": true,
  "maxItems": 20
}
```

Omit unused optional strings rather than sending empty strings. `dateFrom` must be on or before `dateTo`. If you supply both a year and dates, both filters apply.

| Field | Default | Meaning |
| --- | --- | --- |
| `publisher` | `"DU"` | `DU` or `MP`. |
| `year` | Omitted | Publication year, 1-9999. Required unless `dateFrom` is supplied. The Console form prefills 2026. |
| `dateFrom` | Omitted | Inclusive lower bound for the selected date field. |
| `dateTo` | Omitted | Inclusive upper bound for the selected date field. |
| `dateField` | `"promulgation"` | `promulgation`, `announcement`, or `effect`. Maps to ELI `pubDate*`, `date*`, or `dateEffect*`. |
| `titleContains` | Omitted | Words in the Polish title. Try the stem `podatk`; inflection affects matches. |
| `keywords` | `[]` | Official Polish subject keywords, sent as comma-separated `keyword`. |
| `actTypes` | `[]` | Exact types such as `Ustawa`, `Rozporządzenie`, or `Obwieszczenie`. Multiple values match any selected type. |
| `inForceOnly` | `false` | Filter through the API's in-force flag. |
| `includeDetails` | `true` | Fetch individual act details. Adds one request per act. |
| `includeText` | `false` | Extract plain text, preferring HTML and falling back to PDF. |
| `maxTextChars` | `0` | No user cutoff at zero. Positive values cap retained characters. Automatic safety limits always apply. |
| `sortOrder` | `"newest"` | `newest` sorts by descending publication position; `oldest` sorts ascending. Cross-year date order is not guaranteed. |
| `maxItems` | `100` | Maximum delivered dataset rows, 1-100000. Skipped revisions do not count. |
| `onlyNew` | `false` | Skip ELI plus `changeDate` revisions already delivered for this state key. |
| `stateKey` | `"default"` | Monitoring history key, 1-100 letters, digits, underscores, or hyphens. |
| `maxRequestsPerSecond` | `3` | Advanced setting, 0.2-10 requests per second across all endpoints and retries. |

One act type is sent to the API as `type`. Multiple act types are filtered locally within one paginated search stream. Selective filters can therefore require additional search pages. `maxItems` limits delivered items, not requests or scanned candidates.

#### Monitor new and changed acts

Set `onlyNew=true` and keep the same `stateKey` across runs. The named key-value store `polish-legal-acts-seen` retains the latest 50,000 delivered revisions, identified by ELI plus `changeDate`. A changed act can appear again without a charge for skipped revisions. Different state keys maintain independent histories.

Use overlapping date ranges or a broad year filter to revisit older acts that may have changed. The date filters select announcement, promulgation, or effective dates. They do not filter on `changeDate`. Run schedules sharing a state key sequentially. A crash after a dataset write but before state persistence can cause a repeat, and evicted revisions can appear again.

### Output

Each dataset item represents one act. This shortened example uses the recorded `DU/2026/1338` fixture and omits some metadata fields:

```json
{
  "eli": "DU/2026/1338",
  "publisher": "DU",
  "year": 2026,
  "position": 1338,
  "displayAddress": "Dz.U. 2026 poz. 1338",
  "title": "Rozporządzenie Prezesa Rady Ministrów z dnia 14 października 2026 r. w sprawie przedterminowych wyborów wójta gminy Sadlinki w województwie pomorskim",
  "type": "Rozporządzenie",
  "inForce": "IN_FORCE",
  "promulgationDate": "2026-10-15",
  "keywords": ["gminy", "kodeks wyborczy", "administracja samorządowa", "samorząd terytorialny", "wybory"],
  "references": {
    "Podstawa prawna": ["DU/2011/112"],
    "Podstawa prawna z art.": ["DU/2011/112"]
  },
  "hasHtml": false,
  "hasPdf": true,
  "urlEli": "https://api.sejm.gov.pl/eli/acts/DU/2026/1338",
  "urlIsap": "https://isap.sejm.gov.pl/isap.nsf/DocDetails.xsp?id=WDU20260001338",
  "urlPdf": "https://api.sejm.gov.pl/eli/acts/DU/2026/1338/text.pdf"
}
```

With `includeText=true`, delivered items also have `text`, `textSource`, `textLength`, `textTruncated`, and `textError`. `textSource` is `html` or `pdf`, and `textError` is `null` on delivered items. `textLength` counts the characters retained after truncation. If extraction fails for all available formats, the Actor logs the error and skips the act without a charge or a delivered-revision entry in `onlyNew` history. A later run can retry that revision. Skipped extraction failures do not count toward `maxItems`. Every item includes `scrapedAt` in UTC. Source dates and timestamps retain their source format.

The full field list and table view are in [dataset_schema.json](.actor/dataset_schema.json). Run statistics are saved to the default key-value store under `RUN_STATS`, including requests, retries, failed attempts, pushed items per event, skipped seen revisions, and duration.

### Pricing (pay per event)

| Event | USD per delivered act | When charged |
| --- | --- | --- |
| `act` | $0.002 | Metadata with `includeText=false`. |
| `act-with-text` | $0.008 | Nonempty text was extracted, including truncated text. |

An act receives one of these charges. For example, 100 metadata acts cost $0.20 in event fees; 100 acts with extracted text cost $0.80. Search requests and skipped seen revisions do not trigger these events. The SDK enforces the run's maximum total charge and stops delivery when the remaining budget cannot cover another item. On local runs, the equivalent budget variable is `ACTOR_MAX_TOTAL_CHARGE_USD`.

[pay_per_event.json](.actor/pay_per_event.json) records the two events for manual configuration in the Apify Console. The platform does not read that file automatically. Configure those prices when publishing.

### Use cases

- Legal-tech tools that index Polish legislation and cross-references.
- Compliance monitoring for new and changed DU or MP acts within a watched scope.
- AI agents and RAG pipelines that need plain text with traceable ELI and PDF links.
- Research on publication patterns, act types, official keywords, and legal references.

### FAQ

**Is there an API for Polish legal acts / ELI / akty prawne?** Yes. The Sejm publishes a public **ELI** API for **Dziennik Ustaw** and **Monitor Polski**. This Actor turns live **akty prawne** into a filterable table (year, dates, title, keywords, act type, optional text) callable from the Apify API, with CSV/JSON/Excel export.

**How do I export Dziennik Ustaw or Monitor Polski to CSV or Excel?** Set `publisher` to `DU` or `MP`, provide `year` or `dateFrom`, set `maxItems`, optionally `includeText`, run the Actor, then download the dataset as CSV or Excel from the run page or via the Apify API.

**Does it include the full text of each act?** Only when you set `includeText: true`. The Actor prefers HTML and falls back to PDF; it does not perform OCR. Metadata-only runs stay cheaper (`act` event).

**What is the difference vs scraping ISAP HTML?** This Actor uses the official Sejm ELI HTTP API (not HTML scraping of isap.sejm.gov.pl). You get structured ELI metadata, references, and optional extracted text with source links.

#### How fast / how many requests?

Real local `apify run` measurements on 2026-10-18, without login, produced the following results for 100 acts:

| Mode | Settings | Source requests | Elapsed time |
| --- | --- | --- | --- |
| Search metadata only | `includeDetails=false`, `includeText=false` | 1 | 1.6 s |
| Metadata with details | `includeDetails=true`, `includeText=false` | 101 | 35 s |
| Details with text | `includeDetails=true`, `includeText=true` | 201 | 171 s |

The text run produced a 9.1 MB dataset. Its largest item was 0.97 MB. All texts came from PDF. These measurements describe those runs, not a runtime guarantee. Source response time, PDF size and complexity, retries, filters, and hardware affect duration.

Each search page requests up to 500 source acts. Details add one request per prepared act. Text adds one request for an available HTML document or PDF, with an additional request if HTML fails and PDF fallback is needed. Seen revisions can be skipped before enrichment. Multiple-type filtering or skips can require more search pages to fill `maxItems`.

#### Why does a recent act use PDF instead of HTML?

The source checks on 2026-10-18 found no HTML text for the 2025-2026 acts examined. DU 2024 includes HTML documents. The Actor checks each act's availability flags, prefers HTML when available, and falls back to PDF. Empty HTTP 200 HTML responses and recognized error or maintenance pages also trigger PDF fallback. Error detection checks the page title and the start of visible text, so a later mention of a service error in legal text does not trigger fallback.

#### Can large texts exceed the dataset limit?

Apify limits each dataset item to 9 MB of serialized JSON. The 9.1 MB measurement above is the whole dataset across 100 separate items. `maxTextChars=0` disables the user cutoff, but the Actor always truncates text above 8,000,000 characters. It also applies an 8,900,000-byte JSON budget, including metadata and escaping. Unicode characters can therefore trigger truncation before the character ceiling. Every truncation sets `textTruncated=true`.

Use a smaller `maxTextChars`, for example 100000, if your downstream system needs shorter documents. PDF downloads are limited to 50 MiB. If no HTML text is available, scanned PDFs without extractable text cause the act to be skipped with a logged error. The Actor does not perform OCR. PDF extraction can need more memory than metadata runs. The Actor allows up to 1024 MiB.

#### What is the data source? Are legal acts copyrighted?

Data comes from the official public [Sejm ELI API](https://api.sejm.gov.pl/eli), with links to [ISAP](https://isap.sejm.gov.pl/). No source API key is required. Polish legal acts are excluded from copyright protection under Article 4 of the Polish Copyright Act. The Actor collects published legal documents and metadata. It does not seek private personal data or build personal profiles; published documents may themselves name people.

#### What rate limits and failure handling apply?

The default cap is 3 requests per second, configurable up to 10, with at most two requests in flight. Requests time out after 60 seconds. The client retries transient transport failures, HTTP 429, 500, 502, 503, and 504, and invalid JSON responses. It uses backoff with jitter and honors numeric `Retry-After` values, capped at 60 seconds, for up to five retries.

These are Actor settings, not an official source quota. Keep the rate low when the source is under load. A details 404 retains search metadata. When all available text formats fail, the Actor logs the error and skips the act without a charge or a new delivered-revision entry. A search or details outage after retries fails the run while retaining items already saved.

#### How fresh and complete are the results?

The Actor reads the API during each run. Availability, publication timing, status, document coverage, and corrections depend on Sejm. `changeDate` is the source's revision timestamp. `scrapedAt` records retrieval time. A date filter only revisits acts within that date range. Source pagination is not a snapshot, so changes during a run can affect coverage. Use overlapping monitoring windows.

### Integrations

Use the Apify API to start runs with the same JSON input and retrieve dataset items. Configure Apify schedules for recurring monitoring, and webhooks for completion notifications to your own systems. Connect the Actor through an Apify MCP integration or call its run and dataset APIs from AI agents. RAG pipelines can index `text` and retain `eli`, source URLs, and dates as citations. No custom webhook, MCP server, or scheduler is bundled in this repository.

### Development

Use Python 3.13, Apify SDK 4.1, httpx, and pypdf. Runtime dependencies are in `requirements.txt`; test dependencies are in `requirements-dev.txt`. In this workspace the shared environment already contains them. No installation is needed.

Activate the shared environment and run locally with Apify CLI, without login:

```bash
source /workspace/samofinans/actors/.venv/bin/activate
apify run --input-file examples/smoke.json
```

A normal Actor run contacts the public Sejm API. The tests use recorded fixtures and block network access. Local datasets and key-value stores live under `./storage`.

#### Simulate pay-per-event prices locally

Use all three environment variables below. `APIFY_ACTOR_PRICING_INFO` must contain the JSON itself. `APIFY_CHARGED_ACTOR_EVENT_COUNTS` must contain explicit zero counts for both events. In SDK 4.1 an empty `{}` is ignored, which leaves events priced at USD 1.00 as "Unknown event" in local test mode.

Delete `./storage` before each simulation. This also resets local monitoring state. Default-store purge does not clear the named `charging-log` dataset, so purge alone leaves stale billing records.

```bash
source /workspace/samofinans/actors/.venv/bin/activate
rm -rf ./storage
export ACTOR_TEST_PAY_PER_EVENT=true
export APIFY_ACTOR_PRICING_INFO="$(cat examples/pricing_info.local.json)"
export APIFY_CHARGED_ACTOR_EVENT_COUNTS='{"act":0,"act-with-text":0}'
export ACTOR_MAX_TOTAL_CHARGE_USD=0.01
apify run --input-file examples/smoke.json
```

That example allows five metadata items at USD 0.002 each. Inspect the default dataset, the named `charging-log` dataset, and `RUN_STATS`. The local pricing JSON includes a zero-priced `apify-default-dataset-item` entry because the SDK tracks this automatic event too. The Actor never charges synthetic `apify-*` events manually. The two billable events remain `act` and `act-with-text`.

Clear simulation settings before an ordinary local run:

```bash
unset ACTOR_TEST_PAY_PER_EVENT APIFY_ACTOR_PRICING_INFO APIFY_CHARGED_ACTOR_EVENT_COUNTS ACTOR_MAX_TOTAL_CHARGE_USD
```

#### Run offline checks

```bash
/workspace/samofinans/actors/.venv/bin/python -m pytest -q
/workspace/samofinans/actors/.venv/bin/python -m compileall src
apify validate-schema
```

The offline suite covers input validation, query construction, pagination, HTML and PDF extraction, empty HTML fallback, size limits, retries, billing, charge limits, and seen revisions. Fixtures in `tests/fixtures` were recorded on 2026-10-18.

### Disclaimer

This is an unofficial Actor. It is not affiliated with or endorsed by Sejm or the publishers. Output reflects the source responses and extraction limits. Check the linked official documents when you need the authoritative text.

### 🇵🇱 Po polsku

Actor pobiera akty prawne z Dziennika Ustaw i Monitora Polskiego przez oficjalne API ELI Sejmu. Zwraca metadane, słowa kluczowe, powiązania prawne i adresy dokumentów. Opcjonalnie wyodrębnia tekst z HTML lub PDF. Nie wykonuje OCR.

W polu `publisher` wybierz `DU` albo `MP`. Podaj co najmniej `year` lub `dateFrom`. Zakres dat dotyczy daty wskazanej w `dateField`. Szukając przepisów podatkowych, użyj `titleContains="podatk"`, ponieważ odmiana polskich słów wpływa na wyniki. `includeDetails=true` dodaje szczegóły, a `includeText=true` włącza tekst.

Wynik zawiera jeden akt w każdym rekordzie, z identyfikatorem `eli`, tytułem, datami i adresami źródłowymi. `textLength` oznacza długość zachowanego tekstu. `maxTextChars=0` wyłącza limit użytkownika, ale nadal obowiązuje limit 8 mln znaków i limit rozmiaru JSON poniżej 9 MB. Pole `textTruncated` informuje o skróceniu tekstu.

| Zdarzenie | Cena za zapisany akt | Zakres |
| --- | --- | --- |
| `act` | 0,002 USD | Metadane przy `includeText=false`. |
| `act-with-text` | 0,008 USD | Akt z wyodrębnionym tekstem, również skróconym. |

Ustaw `onlyNew=true` i zachowaj ten sam `stateKey`, aby monitorować nowe i zmienione akty. Historia obejmuje do 50 tys. rewizji ELI plus `changeDate`. Pominięte rewizje nie są płatne. Gdy przy `includeText=true` nie uda się uzyskać tekstu z żadnego dostępnego formatu, akt jest pomijany bez opłaty i bez dodania rewizji do historii. Kolejne uruchomienie może ponowić próbę. Stosuj nakładające się zakresy dat i uruchomienia sekwencyjne dla jednego klucza. Przykładowy zakres tygodniowy ma stałe daty, które trzeba aktualizować.

# Changelog

This Actor's version history is a separate document: https://apify.com/enterprising_hamster/polish-legal-acts-eli/changelog.md

# Actor input Schema

## `publisher` (type: `string`):

DU searches Dziennik Ustaw. MP searches Monitor Polski.

## `year` (type: `integer`):

Optional publication year. Provide this or dateFrom. Omit it to search across years within a date range.

## `dateFrom` (type: `string`):

Inclusive lower date bound in YYYY-MM-DD format. Required when year is omitted. dateField selects the date being filtered.

## `dateTo` (type: `string`):

Optional inclusive upper date bound in YYYY-MM-DD format. Must be on or after dateFrom. Omit unused date fields.

## `dateField` (type: `string`):

Promulgation uses pubDateFrom/pubDateTo, announcement uses dateFrom/dateTo, and effect uses dateEffectFrom/dateEffectTo in the ELI API.

## `titleContains` (type: `string`):

Optional title search. Polish inflection matters. Use the stem podatk for tax acts; podatek may return no matches. Omit this field for all titles.

## `keywords` (type: `array`):

Official Polish ELI subject keywords, sent as a comma-separated keyword parameter. Empty means no keyword filter.

## `actTypes` (type: `array`):

Exact Polish types, for example Ustawa, Rozporządzenie, or Obwieszczenie. One type is filtered by the API. Multiple types are matched locally with OR and can require more search pages.

## `inForceOnly` (type: `boolean`):

Ask the ELI API to return only acts marked in force. Output inForce requires details when the search response omits it.

## `includeDetails` (type: `boolean`):

Fetch each act's details for keywords, references, issuing bodies, and inForce. Adds one request per act. Disable for search metadata only.

## `includeText` (type: `boolean`):

Extract available HTML or PDF text. Successful text costs USD 0.008 per act. Missing or failed text costs the metadata rate of USD 0.002. No OCR is provided.

## `maxTextChars` (type: `integer`):

Zero means no user cutoff. An automatic ceiling of 8,000,000 characters and a JSON byte budget below the 9 MB dataset-item limit still apply. Positive values impose a smaller cutoff. textLength counts retained characters; textTruncated reports any truncation.

## `sortOrder` (type: `string`):

Newest means descending API publication position; oldest means ascending. Across years this does not guarantee chronological date order. Use year for one year's positions.

## `maxItems` (type: `integer`):

Hard cap on delivered dataset items. Seen revisions and filtered act types do not count toward this limit.

## `onlyNew` (type: `boolean`):

Skip previously delivered ELI plus changeDate revisions stored in a named key-value store. Retains the latest 50,000 revisions. Use serial runs for each stateKey and an overlapping publication date range to revisit changed acts.

## `stateKey` (type: `string`):

Independent revision set within the named polish-legal-acts-seen store. Use 1-100 letters, digits, underscores, or hyphens. Changing this key starts a new monitoring history.

## `maxRequestsPerSecond` (type: `number`):

Shared rate cap for search, details, text, and retries. Default 3 requests per second, maximum 10, with at most 2 requests in flight. Lower it during source outages.

## Actor input object example

```json
{
  "publisher": "DU",
  "year": 2026,
  "dateField": "promulgation",
  "keywords": [],
  "actTypes": [],
  "inForceOnly": false,
  "includeDetails": true,
  "includeText": false,
  "maxTextChars": 0,
  "sortOrder": "newest",
  "maxItems": 100,
  "onlyNew": false,
  "maxRequestsPerSecond": 3
}
```

# Actor output Schema

## `results` (type: `string`):

Legal act records stored in the default dataset.

# 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 = {
    "publisher": "DU",
    "year": 2026,
    "dateField": "promulgation",
    "keywords": [],
    "actTypes": [],
    "inForceOnly": false,
    "includeDetails": true,
    "includeText": false,
    "maxTextChars": 0,
    "sortOrder": "newest",
    "maxItems": 100,
    "onlyNew": false,
    "maxRequestsPerSecond": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("enterprising_hamster/polish-legal-acts-eli").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 = {
    "publisher": "DU",
    "year": 2026,
    "dateField": "promulgation",
    "keywords": [],
    "actTypes": [],
    "inForceOnly": False,
    "includeDetails": True,
    "includeText": False,
    "maxTextChars": 0,
    "sortOrder": "newest",
    "maxItems": 100,
    "onlyNew": False,
    "maxRequestsPerSecond": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("enterprising_hamster/polish-legal-acts-eli").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 '{
  "publisher": "DU",
  "year": 2026,
  "dateField": "promulgation",
  "keywords": [],
  "actTypes": [],
  "inForceOnly": false,
  "includeDetails": true,
  "includeText": false,
  "maxTextChars": 0,
  "sortOrder": "newest",
  "maxItems": 100,
  "onlyNew": false,
  "maxRequestsPerSecond": 3
}' |
apify call enterprising_hamster/polish-legal-acts-eli --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,enterprising_hamster/polish-legal-acts-eli"
        }
    }
}
```

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/6eBLjJ5AI8SkibMTf/builds/kYrElB05HjBVPfWtW/openapi.json
