# 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
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 96.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## 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 fee per run (see the **Pricing** tab), 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.

### Data pipeline toolkit

Part of the **Data pipeline toolkit** — small, chainable Actors for cleaning, transforming, and generating data inside a larger pipeline:

- [jq Helper – transform JSON with jq](https://apify.com/rl1987/jq-helper) — Run jq programs over inline JSON or a linked Apify dataset.
- [DuckDB Helper – SQL over CSV, JSON, Parquet, Excel, SQLite](https://apify.com/rl1987/duckdb-wrapper) — Run a DuckDB SQL query over remote/local files, push results to a dataset.
- [Regex Helper](https://apify.com/rl1987/regex-helper) — Apply named regular expressions to strings, extract structured matches.
- [URL Wrangler](https://apify.com/rl1987/url-wrangler) — Join, decompose, and rewrite URLs and query params in batch.
- [ZIP Code Helper](https://apify.com/rl1987/zip-code-helper) — Resolves US ZIP codes into city, state, county, and more.
- [Phone Number Wrangler](https://apify.com/rl1987/phone-number-wrangler) — Validate, format, and parse phone numbers using libphonenumber.
- [UUID Generator](https://apify.com/rl1987/uuid-generator) — Generate bulk UUIDs (v1, v3, v4, v5, v7) on demand.
- [Secure Password & Passphrase Generator](https://apify.com/rl1987/password-generator) — Generate secure passwords and diceware passphrases per NIST guidance.
- [Thumbnail Maker](https://apify.com/rl1987/thumbnail-maker) — Generates thumbnails from image URLs using ImageMagick.
- [Katana Web Crawler (ProjectDiscovery)](https://apify.com/rl1987/pd-katana) — Crawl websites with Katana, stream results as JSONL.
- [ProjectDiscovery Notify](https://apify.com/rl1987/pd-notify) — Stream records to Slack, Discord, Telegram, Email, and more.

### Did you find this useful?

Rate this actor on Apify! Your feedback helps other users find it and helps us keep improving it.

# 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(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": [
    "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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rl1987/postal-address-normaliser"
        }
    }
}
```

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/6fWEPi5gZYOC1D9Dd/builds/pyCBS2woUzFmv9wIC/openapi.json
