# Dutch Address Lookup & Geocoding: Postcode, BAG, PDOK (`lyfe_tools/nl-address-postcode-lookup-pdok`) Actor

Dutch address lookup in bulk on the official BAG register (PDOK): fix typos, add postcode, coordinates (WGS84 and RD) and BAG IDs. Reverse mode turns coordinates into addresses.

- **URL**: https://apify.com/lyfe_tools/nl-address-postcode-lookup-pdok.md
- **Developed by:** [LYFE Offshore](https://apify.com/lyfe_tools) (community)
- **Categories:** Real estate, Developer tools, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 address matcheds

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

## Dutch Address Lookup & Geocoding: Postcode, BAG, PDOK

Dutch address lookup and geocoding: check and complete Dutch addresses (adres, postcode, huisnummer)
against the official BAG register via PDOK, and reverse geocoding from coordinates to the nearest address.

Give it messy Dutch addresses. It returns the **registered address** from the BAG (the national
address register), with the postcode, municipality, province, coordinates in WGS84 *and* Rijksdriehoek
(RD), and the BAG IDs. It fixes street-name typos, tells you when an address is ambiguous instead of
guessing, and works in reverse (coordinate → nearest address).

### One run, real output

Eight rough inputs, run for real against PDOK on 4 October 2026. All are public buildings (Royal
Palace, Binnenhof, Rijksmuseum), no private persons.

| Input | Status | Result | Why |
|---|---|---|---|
| `Dam 1 Amsterdam` | **exact** | Dam 1, 1012 JS Amsterdam (52.37329, 4.89372; RD 121394, 487383) | street, number and city agree |
| `1071XX 1` | **exact** | Museumstraat 1, 1071 XX Amsterdam | postcode + house number is unique |
| `Binenhof 1a den haag` | fuzzy, score 0.80 | Binnenhof 1A, 2513 AA 's-Gravenhage | street typo corrected, "den haag" read as 's-Gravenhage; `correctedFrom: "Binenhof"` |
| `Museumstrat 1 amsterdam` | fuzzy, score 0.82 | Museumstraat 1, 1071 XX Amsterdam | typo corrected |
| `{postcode: "2513 AA", houseNumber: "1", addition: "A"}` | **exact** | Binnenhof 1A, 2513 AA 's-Gravenhage | structured input works too |
| `Binnenhof 1 Den Haag` | **exact** | Binnenhof 1, 2513 AA 's-Gravenhage | |
| `Dam 1` | ambiguous | 13 addresses match; the five closest are listed | there is a Dam 1 in more than one town; add a postcode or city |
| `Dam 1 Rotterdam` | not found | no match in Rotterdam; the Dam 1 addresses elsewhere are listed | |

Summary: `8 rows: 4 exact, 2 fuzzy, 1 ambiguous, 1 not found; 6 billed`.

Reverse mode, same day: `{"lat": 52.37329, "lon": 4.89372}` returned **Dam 1, 1012 JS Amsterdam** at 0.33 m
(`exact`); `"52.3731,4.8926"` returned Dam 2, 1012 NP Amsterdam at 41 m (`fuzzy`: the nearest address within
your maximum distance, not necessarily the one you meant). A swapped or foreign coordinate comes back
`not_found` with the reason.

### Statuses

| Status | Meaning | Billed |
|---|---|---|
| `exact` | street, house number (and addition), city/postcode agree with one BAG address | yes |
| `fuzzy` | one BAG address after correcting a typo in the street name (`correctedFrom` shows what was changed), or a reverse hit beyond 10 m | yes |
| `ambiguous` | more than one address fits, or the number only exists with additions (1A, 1B). Up to 5 `alternatives` | no |
| `not_found` | no number, no match, wrong city, nothing in range. The `notes` say why | no |
| `error` | PDOK did not answer for that row | no |

If every row fails (PDOK down), the run fails with a clear message instead of finishing empty.

### Input example

The run above (`INPUT.json`):

```json
{ "mode": "forward",
  "addresses": ["Dam 1 Amsterdam", "Binenhof 1a den haag", "1071XX 1", "Museumstrat 1 amsterdam",
    { "postcode": "2513 AA", "houseNumber": "1", "addition": "A" }, "Binnenhof 1 Den Haag", "Dam 1", "Dam 1 Rotterdam"] }
```

- `mode`: `forward` (default) or `reverse` (then use `coordinates`: `{lat, lon}` or `"lat,lon"`).
- Free text, or objects with `street`, `houseNumber`, `addition`, `postcode`, `city` (Dutch names `straat`, `huisnummer`, `toevoeging`, `woonplaats` work too), or a dataset ID plus `addressField`.
- `outputMode`: `all` or `found-only`; `includeAlternatives`; `maxDistanceMeters` (reverse, default 50); `concurrency` (default 5).

### Output example

One row, from a local run against PDOK on 5 October 2026 with input `"Dam 1 Amsterdam"`:

```json
{ "input": "Dam 1 Amsterdam", "status": "exact", "score": 1, "billable": true,
  "address": "Dam 1, 1012JS Amsterdam", "street": "Dam", "houseNumber": 1, "houseLetter": null,
  "houseNumberAddition": null, "postcode": "1012 JS", "city": "Amsterdam", "municipality": "Amsterdam",
  "province": "Noord-Holland", "lat": 52.37329259, "lon": 4.8937175, "rdX": 121394, "rdY": 487383,
  "nummeraanduidingId": "0363200003761447", "adresseerbaarObjectId": "0363010003761571",
  "addressType": "hoofdadres", "notes": [] }
```

### Output fields

| Field | Meaning |
|---|---|
| `input` | the row as you gave it |
| `status`, `score`, `billable` | match status (see above), a 0-1 closeness heuristic, and whether the row was charged |
| `address` | the registered address as one line |
| `street`, `houseNumber`, `houseLetter`, `houseNumberAddition` | the parts; BAG keeps the letter (1A) apart from the addition |
| `postcode`, `city`, `municipality`, `province` | postcode as `1234 AB`, place (woonplaats), gemeente and provincie |
| `lat`, `lon` | WGS84 coordinates |
| `rdX`, `rdY` | Rijksdriehoek (RD) coordinates in metres |
| `nummeraanduidingId`, `adresseerbaarObjectId` | BAG IDs of the address and of the object it belongs to |
| `addressType` | `hoofdadres` or `nevenadres` |
| `correctedFrom` | the street name as typed, when it was corrected |
| `notes` | why a row is ambiguous, not found or fuzzy |
| `alternatives` | up to 5 close addresses (ambiguous and not-found rows; can be turned off) |
| `distanceMeters` | reverse mode: distance from your point |

A run summary is stored in the key-value store under `SUMMARY`.

### Price

Price per 1,000 by your Apify plan (Apify applies the right column automatically):

| | Free | Starter | Scale | Business and up |
|---|---|---|---|---|
| Address matched, per 1,000 | $0.50 | $0.50 | $0.43 | $0.35 |

No start fee. The figures below use the Free-plan price; on a paid plan the same run costs less.

**$0.0005 per matched address** (event `address-matched`: `exact` or `fuzzy`, or a reverse hit).
Ambiguous, not-found and failed rows are free. Platform usage is included.

- 1,000 matched rows ≈ $0.50.
- The run above: 8 rows, 6 matched ≈ $0.003.
- A list of 10,000 addresses of which 9,000 match ≈ $4.50; the other 1,000 cost nothing.

`ACTOR_MAX_TOTAL_CHARGE_USD` (the run's maximum charge) caps the number of rows processed.

### What it does not do

- **It matches addresses, not places.** "Rijksmuseum Amsterdam" has no house number and comes back
  `not_found`; give it `Museumstraat 1 Amsterdam`.
- **Only the street name is fuzzy.** A wrong house number, a wrong city or a typo in the city name is not
  guessed. The city is compared as given (with a few aliases such as Den Haag, 's-Hertogenbosch); a
  misspelled city comes back `not_found`, not corrected.
- **Typo correction uses PDOK's spell-checker** and then requires the street to look like what you typed
  (similarity ≥ 0.75). Short or very common street names can be ambiguous.
- **Netherlands only.** It uses the BAG; addresses in Caribbean Netherlands (Bonaire, Sint Eustatius, Saba)
  were not tested and are not claimed.
- A `score` is a heuristic for how close the input was, not a probability.
- Coordinates are the object's centroid from the BAG, not an entrance.

### Use it from code or an AI agent

```bash
curl -X POST "https://api.apify.com/v2/acts/lyfe_tools~nl-address-postcode-lookup-pdok/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"addresses": ["Dam 1 Amsterdam", "1071XX 1"]}'
```

AI agents (Claude, Cursor and other MCP clients) can call it through the Apify MCP server at
https://mcp.apify.com: the agent sends `addresses` (or `mode: "reverse"` with `coordinates`), and reads
`status`, `address`, `postcode`, `city`, `lat`, `lon` and `notes`.

### FAQ

**Can I find the address for a Dutch postcode and house number?**
Yes. `"1071XX 1"` or `{"postcode": "1071 XX", "houseNumber": "1"}` returns the street, city and BAG IDs.

**Does it work for Belgian or German addresses?**
No. It only searches the Dutch BAG. `"Meir 1 Antwerpen"` came back `not_found` (free), listing Dutch addresses
as alternatives.

**Can I turn coordinates into an address (reverse geocoding)?**
Yes, with `mode: "reverse"` and `coordinates`. A point outside the Dutch bounding box (or with lat and lon
swapped) comes back `not_found` with that reason; a point with no address within `maxDistanceMeters` likewise.

**Does it work without a house number?**
No. A street or a place name without a number cannot be matched to one BAG address.

**Does it give RD (Rijksdriehoek) coordinates?**
Yes, `rdX` and `rdY` next to WGS84 `lat` and `lon`.

**Do I need a PDOK API key?**
No. The PDOK Locatieserver is open and free; you only need an Apify account.

### Source and terms

Data: **BAG (Basisregistratie Adressen en Gebouwen)**, published as open data by Kadaster through the
**PDOK Locatieserver** (`https://api.pdok.nl/bzk/locatieserver/search/v3_1`). PDOK describes the service as
open and free, with a "best effort" service level and a Fair Use policy, and answers too many requests with
HTTP 429. This Actor identifies itself (`tools@lyfeoffshore.com`), uses 5 parallel requests by default,
retries with backoff on 429/5xx and stops with an error instead of hammering. The BAG is released under
[CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/)
([data.overheid.nl](https://data.overheid.nl/dataset/basisregistratie-adressen-en-gebouwen--bag-)), so
commercial use is allowed and no attribution is required; crediting "BAG, Kadaster / PDOK" is still
courteous. Dutch addresses of private individuals are personal data under
the GDPR: you are responsible for what you do with the output.

Issues and questions: tools@lyfeoffshore.com.

# Actor input Schema

## `mode` (type: `string`):

forward: look up addresses. reverse: find the nearest registered address for WGS84 coordinates.

## `addresses` (type: `array`):

Free text such as "Binenhof 1a den haag" or "1071XX 1", or objects with street, houseNumber, addition, postcode and city. Rows without a house number cannot be matched. Used when mode is forward.

## `coordinates` (type: `array`):

WGS84 points as {"lat": 52.3731, "lon": 4.8926} or "52.3731,4.8926". Used when mode is reverse.

## `inputDatasetId` (type: `string`):

Read the rows from an existing dataset instead of (or as well as) the list above.

## `addressField` (type: `string`):

When reading a dataset: the field that holds the address text. Leave empty if the rows already have street, houseNumber, postcode fields.

## `includeAlternatives` (type: `boolean`):

For ambiguous and not-found rows, list the closest registered addresses.

## `outputMode` (type: `string`):

Return every input row with its match status, or only the rows that matched an address (exact or fuzzy). Only matched rows are charged either way.

## `maxDistanceMeters` (type: `integer`):

Reverse mode: how far from the point an address may lie to count as a match.

## `concurrency` (type: `integer`):

PDOK applies fair-use rate limiting. 5 is polite; the Actor backs off on HTTP 429.

## Actor input object example

```json
{
  "mode": "forward",
  "addresses": [
    "Dam 1 Amsterdam",
    "Binenhof 1a den haag",
    "1071XX 1",
    "Museumstrat 1 amsterdam",
    {
      "postcode": "2513 AA",
      "houseNumber": "1",
      "addition": "A"
    },
    "Binnenhof 1 Den Haag",
    "Dam 1"
  ],
  "coordinates": [
    {
      "lat": 52.37329,
      "lon": 4.89372
    },
    "52.0799,4.3133"
  ],
  "includeAlternatives": true,
  "outputMode": "all",
  "maxDistanceMeters": 50,
  "concurrency": 5
}
```

# Actor output Schema

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

One row per input: status (exact, fuzzy, ambiguous, not_found), corrected address, postcode, coordinates and BAG IDs.

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

Counts per status and how many rows were billed.

# 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 = {
    "addresses": [
        "Dam 1 Amsterdam",
        "Binenhof 1a den haag",
        "1071XX 1",
        "Museumstrat 1 amsterdam",
        {
            "postcode": "2513 AA",
            "houseNumber": "1",
            "addition": "A"
        },
        "Binnenhof 1 Den Haag",
        "Dam 1"
    ],
    "coordinates": [
        {
            "lat": 52.37329,
            "lon": 4.89372
        },
        "52.0799,4.3133"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lyfe_tools/nl-address-postcode-lookup-pdok").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 = {
    "addresses": [
        "Dam 1 Amsterdam",
        "Binenhof 1a den haag",
        "1071XX 1",
        "Museumstrat 1 amsterdam",
        {
            "postcode": "2513 AA",
            "houseNumber": "1",
            "addition": "A",
        },
        "Binnenhof 1 Den Haag",
        "Dam 1",
    ],
    "coordinates": [
        {
            "lat": 52.37329,
            "lon": 4.89372,
        },
        "52.0799,4.3133",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("lyfe_tools/nl-address-postcode-lookup-pdok").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 '{
  "addresses": [
    "Dam 1 Amsterdam",
    "Binenhof 1a den haag",
    "1071XX 1",
    "Museumstrat 1 amsterdam",
    {
      "postcode": "2513 AA",
      "houseNumber": "1",
      "addition": "A"
    },
    "Binnenhof 1 Den Haag",
    "Dam 1"
  ],
  "coordinates": [
    {
      "lat": 52.37329,
      "lon": 4.89372
    },
    "52.0799,4.3133"
  ]
}' |
apify call lyfe_tools/nl-address-postcode-lookup-pdok --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lyfe_tools/nl-address-postcode-lookup-pdok"
        }
    }
}
```

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/WlX7NG3NJBpQ7dLUV/builds/SJlQBf4pMPAHxjI2I/openapi.json
