# NFZ Fastest Appointment Finder Poland (Terminy Leczenia) (`donzely/nfz-fastest-appointment`) Actor

Find the shortest NFZ waiting time for a specialist, MRI/CT scan or surgery near any Polish city. Official NFZ API data ranked by estimated wait and distance, with phone, patients waiting, accessibility, fastest vs nearest summary and daily change tracking.

- **URL**: https://apify.com/donzely/nfz-fastest-appointment.md
- **Developed by:** [Grzegorz Pryjma](https://apify.com/donzely) (community)
- **Categories:** Automation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 place with waiting times

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?

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

## NFZ Fastest Appointment Finder Poland (Terminy Leczenia)

**Find the shortest NFZ (public healthcare) waiting time near you.** Type what you need, for example `ortopeda`, `rezonans magnetyczny`, `zaćma` or `endoproteza biodra`, and a location. The Actor checks every NFZ-contracted clinic and hospital in range using the **official NFZ "Terminy Leczenia" API**. It ranks the places by estimated wait, then by distance. The waiting time in Poland often differs by months between two clinics 30 km apart. This Actor shows you where it is shortest.

🇵🇱 *Najszybszy termin na NFZ: wpisz specjalistę, badanie lub zabieg i miasto, a dostaniesz listę poradni i szpitali w okolicy posortowaną według przewidywanego czasu oczekiwania i odległości, z telefonem do rejestracji.*

### Why use it

- **Typos and everyday words work.** `ortopeta`, `okulista`, `MRI`, `tarczyca`, `proteza kolana` are mapped to the official NFZ service names. Exact NFZ names such as `PORADNIA DERMATOLOGICZNA` work too.
- **Distance from you.** Give a city, `Warszawa Mokotów`, a postcode or `lat,lon`. Every place gets a distance in km, and the search covers all voivodeships within the radius.
- **Fastest vs nearest.** The `SUMMARY` record shows the fastest place, the nearest place, how many days you save by travelling, the median wait in the area and the best option within 25, 50 and 100 km.
- **Monitoring.** Schedule it daily with **Only changes since last run** to get new places and wait-time changes (`waitChangeDays`) per facility.
- **Accessibility info.** Ramp, toilet, parking, elevator, wheelchairs and public transport where the facility reported them.
- **Official data, plain HTTP.** No browser and no login, so runs take seconds and cost little.

### Who is it for

- Patients and families who want a faster specialist visit, scan or surgery
- Health apps, patient portals and telemedicine services that want to show NFZ waiting times
- Journalists and analysts comparing waiting times between regions
- Private clinics and insurers studying where public waiting lists are longest

### Input

| Field | Description |
|---|---|
| `benefit` | Specialist, test or procedure: `ortopeda`, `okulista`, `dermatolog`, `rezonans magnetyczny`, `tomografia`, `zaćma`, `endoproteza biodra`, or an exact NFZ name |
| `location` | City, city and district, postcode, street address or `lat,lon` |
| `maxDistanceKm` | Search radius in km (default 50) |
| `caseType` | `stable` (default) or `urgent` (przypadek pilny, needs an urgent referral) |
| `forChildren` | Keep only places that treat children and prefer paediatric services |
| `voivodeships` | Search whole voivodeships, e.g. `małopolskie`, `śląskie` |
| `maxWaitDays` | Keep only places with an estimated wait up to N days |
| `onlyWithKnownWait` | Skip places that did not report a waiting time |
| `onlyChangesSinceLastRun` | Output only new places and changed waits since the previous run with the same search |
| `maxItems` | Maximum places to output (default 50) |

An empty input `{}` runs an example search: orthopaedic clinics within 50 km of Warsaw.

### Output example

```json
{
  "rank": 1,
  "facility": "PORADNIA CHIRURGII URAZOWO-ORTOPEDYCZNEJ",
  "provider": "SAMODZIELNY PUBLICZNY ZAKŁAD OPIEKI ZDROWOTNEJ W BŁONIU",
  "address": "...",
  "locality": "BŁONIE",
  "voivodeship": "mazowieckie",
  "phone": "221823130",
  "distanceKm": 27.1,
  "estimatedWait": "11 dni",
  "estimatedWaitDays": 11,
  "estimatedFirstDate": "2026-11-21",
  "dataAsOf": "2026-11-10",
  "patientsWaiting": 54,
  "averageWaitDays": 70,
  "statisticsMonth": "2026-10",
  "previousEstimatedWaitDays": null,
  "waitChangeDays": null,
  "benefit": "ŚWIADCZENIA Z ZAKRESU ORTOPEDII I TRAUMATOLOGII NARZĄDU RUCHU",
  "caseType": "stable",
  "forChildren": false,
  "accessibility": { "toilet": true, "ramp": true, "parking": true, "elevator": false, "wheelchairs": true },
  "nfzQueueId": "...",
  "source": "NFZ Terminy Leczenia, https://api.nfz.gov.pl/"
}
```

The key-value store record `SUMMARY` contains `fastest`, `nearest`, `daysSavedFastestVsNearest`, `medianWaitDays`, `bestWithin25Km`, `bestWithin50Km`, `bestWithin100Km` and other matching NFZ services you may want to search next.

### Pricing

Pay per result: you pay only for places saved to the dataset. No start fee. A typical search (30 to 50 places) costs a fraction of a dollar. Set `maxItems` to cap the cost.

### Data source and limits

- Data comes from the **NFZ Terminy Leczenia API** (https://api.nfz.gov.pl/), version 1.4. Under the API terms the source is credited in every row, the data is not modified, and requests stay well below the limit of 10 per second.
- Since API 1.4 the NFZ publishes a **forecast waiting time** (for example `1 mies. 2 tydz.`), not an exact free date. `estimatedWaitDays` converts it to days and `estimatedFirstDate` adds it to the date the data was valid for (`dataAsOf`). Always confirm the date by calling the registration phone.
- Some places do not report a waiting time; they are listed last with `waitNotReported: true`.
- Distances are measured from the town or district centre (`locationPrecision`), not the exact building.
- Place names and postcodes use GeoNames data (CC BY 4.0); free-form addresses are geocoded with OpenStreetMap Nominatim.
- This is not medical advice. Urgent symptoms need emergency care (112).

### FAQ

**Which services can I search?** Every service with an NFZ waiting list: specialist clinics, hospital wards, diagnostic tests (MRI, CT), surgeries such as cataract or hip replacement, rehabilitation, sanatorium and more.

**What if my word is not recognised?** The run log and status message suggest names to try, and `SUMMARY.otherMatchingServices` lists close NFZ services.

**Can I run it every day?** Yes. Schedule it and turn on `onlyChangesSinceLastRun`. Connect the dataset to email, Slack, Google Sheets, Make, Zapier or n8n.

**Does it book appointments?** No. It finds where the wait is shortest and gives the registration phone number.

# Actor input Schema

## `benefit` (type: `string`):

What you need, in Polish or English, typos are OK: "ortopeda", "okulista", "rezonans magnetyczny", "tomografia", "zaćma", "endoproteza biodra", "dermatolog", or an exact NFZ name such as "PORADNIA DERMATOLOGICZNA".

## `location` (type: `string`):

City ("Kraków"), city and district ("Warszawa Mokotów"), postcode ("31-000"), street address or "lat,lon".

## `maxDistanceKm` (type: `integer`):

Search radius around your location. Larger radius = more places, longer run.

## `caseType` (type: `string`):

"stable" (przypadek stabilny, default) or "urgent" (przypadek pilny, needs an urgent referral).

## `forChildren` (type: `boolean`):

Prefer paediatric services and keep only places that treat children.

## `voivodeships` (type: `array`):

Search whole voivodeships instead of (or in addition to) a radius, e.g. "małopolskie", "śląskie".

## `maxWaitDays` (type: `integer`):

Keep only places with an estimated wait up to this many days.

## `onlyWithKnownWait` (type: `boolean`):

Skip places that did not report a waiting time to NFZ.

## `onlyChangesSinceLastRun` (type: `boolean`):

For daily monitoring: output only new places and places whose estimated wait changed since the previous run with the same search.

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

Maximum number of places to output (you pay per place).

## Actor input object example

```json
{
  "benefit": "ortopeda",
  "location": "Warszawa",
  "maxDistanceKm": 50,
  "caseType": "stable",
  "forChildren": false,
  "onlyWithKnownWait": false,
  "onlyChangesSinceLastRun": false,
  "maxItems": 30
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (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 = {
    "benefit": "ortopeda",
    "location": "Warszawa",
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("donzely/nfz-fastest-appointment").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 = {
    "benefit": "ortopeda",
    "location": "Warszawa",
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("donzely/nfz-fastest-appointment").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 '{
  "benefit": "ortopeda",
  "location": "Warszawa",
  "maxItems": 30
}' |
apify call donzely/nfz-fastest-appointment --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,donzely/nfz-fastest-appointment"
        }
    }
}
```

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/HfxcIVR4NqE3WE85v/builds/9uxV6dBph6gS0IPgy/openapi.json
