# Bulk Address & Phone Normalizer (`cleaner_86/address-phone-cleaner`) Actor

Bulk-normalize messy phone numbers (E.164, national, type, region, time zone) and postal addresses (USPS-style for US, postal codes for 13 countries). Fast, no scraping, no proxies.

- **URL**: https://apify.com/cleaner_86/address-phone-cleaner.md
- **Developed by:** [Arman](https://apify.com/cleaner_86) (community)
- **Categories:** Developer tools, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.40 / 1,000 cleaned records

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

## Bulk Address & Phone Normalizer

Paste thousands of messy phone numbers and addresses and get clean, standardized records back. It scrapes nothing and uses no proxies, so it's fast and cheap.

### What it does

- **Phones:** gives E.164, international, national and `tel:` formats, plus validity, line type (mobile / fixed line / toll-free / VoIP…), country, extension, location and time zones. Uses Google's libphonenumber rules.
- **US addresses:** parsed into USPS Publication 28-style components and formatted, e.g. `123 north main street apt 4b, springfield, illinois 62704` becomes `123 N MAIN ST APT 4B, SPRINGFIELD, IL 62704`.
- **International addresses:** detects the country and formats the postal code for CA, GB, NL, BR, JP, PL, IN, AU, DE, FR, ES, IT and MX.

Good for CRM dedupe, lead imports, checkout forms and data pipelines.

### Input

| Field | Description |
|---|---|
| `phones` | List of raw phone numbers |
| `defaultRegion` | ISO-2 country used when a number has no `+` code (default `US`) |
| `withCarrier` | Add the mobile carrier name, from public prefix data |
| `addresses` | List of raw addresses (one-line or multi-line) |
| `countryHint` | Optional country applied to all addresses |

```json
{
  "phones": ["(415) 555-2671", "0049 30 901820", "06 12 34 56 78"],
  "defaultRegion": "US",
  "addresses": ["123 north main street apt 4b, springfield, illinois 62704", "10 Downing St, London SW1A2AA, United Kingdom"]
}
```

### Output

You get one dataset item per input record, with `kind` set to `phone` or `address`.

- Phone items include `valid`, `e164`, `national`, `international`, `type`, `region`, `timezones` and `error`.
- Address items include `formatted`, `components`, `country`, `confidence`, `warnings` and `error`.
- A bad record doesn't fail the run. It gets an `error` value instead.

### Limitations

- It normalizes addresses but does **not** confirm mail can be delivered. That would need licensed postal data.
- Non-US addresses are cleaned and get a formatted postal code, but they are not split into full components.

# Actor input Schema

## `phones` (type: `array`):

Raw phone numbers, any format.

## `defaultRegion` (type: `string`):

ISO-3166 alpha-2 used when a number has no +country code.

## `withCarrier` (type: `boolean`):

Add the mobile carrier name from public number-prefix data (may be outdated for ported numbers).

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

Raw one-line or multi-line addresses.

## `countryHint` (type: `string`):

Optional ISO code/name applied to all addresses; otherwise auto-detected.

## Actor input object example

```json
{
  "phones": [
    "(415) 555-2671",
    "0049 30 901820",
    "06 12 34 56 78",
    "555-1234"
  ],
  "defaultRegion": "US",
  "withCarrier": false,
  "addresses": [
    "123 north main street apt 4b, springfield, illinois 62704",
    "10 Downing St, London SW1A2AA, United Kingdom",
    "350 rue Saint-Paul Ouest, Montréal, QC h2y2a2, Canada"
  ]
}
```

# Actor output Schema

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

All normalized records, overview table.

## `phones` (type: `string`):

No description

## `addresses` (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 = {
    "phones": [
        "(415) 555-2671",
        "0049 30 901820",
        "06 12 34 56 78",
        "555-1234"
    ],
    "addresses": [
        "123 north main street apt 4b, springfield, illinois 62704",
        "10 Downing St, London SW1A2AA, United Kingdom",
        "350 rue Saint-Paul Ouest, Montréal, QC h2y2a2, Canada"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cleaner_86/address-phone-cleaner").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 = {
    "phones": [
        "(415) 555-2671",
        "0049 30 901820",
        "06 12 34 56 78",
        "555-1234",
    ],
    "addresses": [
        "123 north main street apt 4b, springfield, illinois 62704",
        "10 Downing St, London SW1A2AA, United Kingdom",
        "350 rue Saint-Paul Ouest, Montréal, QC h2y2a2, Canada",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("cleaner_86/address-phone-cleaner").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 '{
  "phones": [
    "(415) 555-2671",
    "0049 30 901820",
    "06 12 34 56 78",
    "555-1234"
  ],
  "addresses": [
    "123 north main street apt 4b, springfield, illinois 62704",
    "10 Downing St, London SW1A2AA, United Kingdom",
    "350 rue Saint-Paul Ouest, Montréal, QC h2y2a2, Canada"
  ]
}' |
apify call cleaner_86/address-phone-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cleaner_86/address-phone-cleaner"
        }
    }
}
```

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/7h4Bl94qs25OiBZ2k/builds/hR1K0S2HElDuG1elC/openapi.json
