# Postal Code Checker: Global ZIP & Postcode Lookup (`scrapemint/postal-code-checker`) Actor

Validate and enrich postal codes for 121 countries. Paste codes like "US 90210" or "DE 10115" and get place name, region, district and GPS coordinates per code, from a bundled open dataset of 1.8 million codes. For checkout validation, logistics and CRM cleaning. No API key needed.

- **URL**: https://apify.com/scrapemint/postal-code-checker.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 postal code matcheds

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/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 Code Checker: Global ZIP & Postcode Lookup

Validate and enrich postal codes for **121 countries** in one run. Paste codes like `US 90210`, `DE 10115` or `GB SW1A 1AA` and get one clean row per code: place name, region, district and GPS coordinates — matched against a bundled open dataset of **1.8 million postal codes**, with no network calls, no signup and no API key.

Built for **e-commerce checkout validation, logistics and shipping teams, CRM and mailing list cleaning**. Works for any country's codes in the same run: US ZIP codes, UK postcodes, EU codes, Japanese, Kenyan, Indian and more.

### What you get for each code

- **countryCode** and **countryName**
- **placeName**, **region**, **district**: where the code points
- **latitude** and **longitude**: for mapping, routing and distance math
- **places** and **placeCount**: every locality sharing the code (up to 20)
- **matchedBy**: how the match was made (exact, or a documented fallback)

### Example output

```json
{
  "input": "US 90210",
  "found": true,
  "countryCode": "US",
  "countryName": "United States",
  "postalCode": "90210",
  "matchedBy": "exact",
  "placeName": "Beverly Hills",
  "region": "California",
  "latitude": 34.0901,
  "longitude": -118.4065,
  "placeCount": 1
}
```

### How to write code lines

- **With a country (recommended)**: `US 90210`, `JP 100-0001`, `KE 00100`. Exact and fast.
- **Bare code**: `90210` returns a row for **every country** that uses it (90210 exists in the US, Kenya, Mexico, Thailand and more). Set **default country** to pin bare codes to one country.
- **Full UK and Canadian codes work**: `GB SW1A 1AA` matches the outward part (`SW1A`), `CA K1A 0B1` matches the FSA (`K1A`) — the row's `matchedBy` field tells you.

### Pricing

**$0.002 per matched code.** Codes that match nothing are **free**, and the first 2 rows of every run are free. Cleaning a 10,000-address CRM list costs about $20, versus per-seat subscriptions of address-validation SaaS.

### How to run it via API

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapemint~postal-code-checker/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"codes": ["US 90210", "DE 10115", "GB SW1A 1AA"]}'
```

### Frequently asked questions

**Where does the data come from?** The [GeoNames](https://www.geonames.org) postal code dataset (1.8M codes, 121 countries), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). The dataset is bundled inside the actor, so runs make zero network calls and always return in seconds.

**What granularity should I expect?** Most countries are covered at full postal code level. Known exceptions: UK codes resolve to the outward part (`SW1A`), Canadian codes to the FSA (`K1A`), and Brazil to municipality-level CEPs only (street-level CEPs like `01310-100` in big cities return not found, free).

**Does it verify that a street address exists?** No — it validates and enriches the postal code itself. Pair it with our US Address Checker for full US address verification.

**A code I know exists returned not found.** Newly introduced codes appear in the dataset with some lag, and a few countries have partial coverage. Those rows are free and marked `found: false`.

### More tools from Scrapemint

- [Email List Checker](https://apify.com/scrapemint/email-list-checker): DNS-level validation for email lists.
- [Phone Number Checker](https://apify.com/scrapemint/phone-number-checker): validate and type phone numbers for any country.
- [US Address Checker & GPS Finder](https://apify.com/scrapemint/us-address-checker): full US street address verification.
- [EU VAT Number Checker](https://apify.com/scrapemint/vat-number-checker): validate EU VAT numbers with company names.

# Actor input Schema

## `codes` (type: `array`):

One per line, ideally with the 2-letter country first: "US 90210", "DE 10115", "GB SW1A 1AA". A bare code without a country matches every country that uses it (or the default country below).

## `defaultCountry` (type: `string`):

Optional 2-letter country code (ISO 3166-1) applied to bare codes without a country prefix. Leave empty to match bare codes against all countries.

## `maxRows` (type: `integer`):

Stop after this many rows in total.

## Actor input object example

```json
{
  "codes": [
    "US 90210",
    "GB SW1A 1AA",
    "DE 10115",
    "JP 100-0001",
    "KE 00100"
  ],
  "defaultCountry": "",
  "maxRows": 1000
}
```

# 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 = {
    "codes": [
        "US 90210",
        "GB SW1A 1AA",
        "DE 10115",
        "JP 100-0001",
        "KE 00100"
    ],
    "defaultCountry": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/postal-code-checker").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 = {
    "codes": [
        "US 90210",
        "GB SW1A 1AA",
        "DE 10115",
        "JP 100-0001",
        "KE 00100",
    ],
    "defaultCountry": "",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/postal-code-checker").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 '{
  "codes": [
    "US 90210",
    "GB SW1A 1AA",
    "DE 10115",
    "JP 100-0001",
    "KE 00100"
  ],
  "defaultCountry": ""
}' |
apify call scrapemint/postal-code-checker --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tI5LisooMSgxdXeSZ/builds/bDhWIwafbspx5QUqK/openapi.json
