# Postal Address Normaliser (`rl1987/postal-address-normaliser`) Actor

Parses and normalises arbitrary postal address strings using libpostal.

- **URL**: https://apify.com/rl1987/postal-address-normaliser.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / run

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Postal Address Normaliser

### What does Postal Address Normaliser do?

Postal Address Normaliser is an Apify Actor that parses and normalises arbitrary postal address strings from anywhere in the world. Using the open-source [libpostal](https://github.com/openvenues/libpostal) library and its Python bindings ([pypostal](https://github.com/openvenues/pypostal)), it breaks down raw address strings into structured components and provides normalised expansion variants.

Postal Address Normaliser can extract:

- House numbers
- Road names
- Cities
- States/provinces
- Postcodes
- Countries
- Other address components

### Why normalise postal addresses?

Postal addresses are a critical data point for businesses, logistics companies, e-commerce platforms, and data analytics organisations. Raw address data is often inconsistent, incomplete, or formatted differently across sources. Normalising addresses enables you to:

- Consolidate customer databases with duplicate or variant address formats
- Improve delivery accuracy and reduce failed shipments
- Enhance geocoding and mapping workflows
- Build reliable address databases for analytics and reporting
- Standardise addresses across multiple data sources and systems
- Validate and clean address data before processing

### How to use Postal Address Normaliser

1. Click **Try for free** to start a test run.
2. Prepare a list of raw address strings you want normalised.
3. Paste them into the `addresses` input field.
4. Click **Start**.
5. Once the run finishes, view or download the structured, normalised address data from the **Output** tab.

### Input

```json
{
  "addresses": [
    "Muster Str. 45, 10999 Berlin, Germany",
    "1600 Pennsylvania Ave NW, Washington, DC 20500"
  ],
  "expand": true,
  "languages": []
}
```

- `addresses` (required) — array of raw address strings.
- `expand` — also emit libpostal's `expand_address()` normalised variants (default `true`).
- `languages` — optional ISO 639-1 language hints for the expander.

The Actor works on addresses from any country and doesn't require any website-specific configuration.

### Output example

One dataset item per address:

```json
{
  "original": "1600 Pennsylvania Ave NW, Washington, DC 20500",
  "parsed": {
    "house_number": "1600",
    "road": "pennsylvania ave nw",
    "city": "washington",
    "state": "dc",
    "postcode": "20500"
  },
  "expansions": [
    "1600 pennsylvania avenue northwest washington district of columbia 20500"
  ]
}
```

`parsed` groups libpostal's component labels (house\_number, road, city,
state, postcode, country, etc.) into a flat dict.

### How much will it cost?

This Actor uses pay-per-event pricing: a flat **$0.01 per run**, regardless of
how many addresses you submit. Apify's [free plan](https://apify.com/pricing)
credits cover plenty of test runs before you pay anything.

### Tips for using Postal Address Normaliser

- The Actor handles addresses from any country, so you can normalise international address datasets
- Normalised expansion variants help match addresses that may be written differently
- Structured output makes it easy to integrate normalised addresses into databases and workflows
- The Actor works on raw, unstructured address strings without requiring pre-formatting

### Is it legal to normalise addresses?

Note that personal data is protected by GDPR in the European Union and by other regulations around the world.
You should not process personal data unless you have a legitimate reason to do so.
If you're unsure whether your use case is legitimate, consult your legal team.

# Actor input Schema

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

List of raw postal address strings to parse and normalise.

## `expand` (type: `boolean`):

Also include libpostal's expand\_address() normalised string variants for each address.

## `languages` (type: `array`):

Optional ISO 639-1 language codes to hint libpostal's expander (e.g. "en", "de").

## Actor input object example

```json
{
  "addresses": [
    "Muster Str. 45, 10999 Berlin, Germany",
    "1600 Pennsylvania Ave NW, Washington, DC 20500"
  ],
  "expand": true,
  "languages": []
}
```

# Actor output Schema

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

Dataset of parsed address components and normalised expansion variants.

# 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": [
        "Muster Str. 45, 10999 Berlin, Germany",
        "1600 Pennsylvania Ave NW, Washington, DC 20500"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/postal-address-normaliser").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": [
        "Muster Str. 45, 10999 Berlin, Germany",
        "1600 Pennsylvania Ave NW, Washington, DC 20500",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rl1987/postal-address-normaliser").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "Muster Str. 45, 10999 Berlin, Germany",
    "1600 Pennsylvania Ave NW, Washington, DC 20500"
  ]
}' |
apify call rl1987/postal-address-normaliser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=rl1987/postal-address-normaliser",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6fWEPi5gZYOC1D9Dd/builds/4mf97Wj0Pb1eg0nzl/openapi.json
