# Hungarian Postcode & Address Validator (`unbearable_dev/hu-postcode-validator`) Actor

Validate Hungarian postal codes and addresses from your AI agent. Look up postcodes by city, cities by postcode, and Budapest district info. Powered by official Magyar Posta and KSH settlement data. Pennies per call. Built by Unbearable Labs.

- **URL**: https://apify.com/unbearable\_dev/hu-postcode-validator.md
- **Developed by:** [Noel Himer](https://apify.com/unbearable_dev) (community)
- **Categories:** Developer tools, Automation, MCP servers
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 hu postcode lookups

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/actors/running/actors-in-store.md#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

## Hungarian Postcode & Address Validator

> MCP server that validates Hungarian postcodes and addresses. Powered by the official Magyar Posta catalog and KSH (Hungarian Central Statistics Office) settlement data.

**Built by [Unbearable Labs](https://github.com/UnbearableDev). Free to use — bring your own Apify token.**

***

### Available on

- [Apify Actor Store](https://apify.com/unbearable_dev/hu-postcode-validator) — primary
- [Smithery](https://smithery.ai/servers/unbearabledev/hu-postcode-validator)

**Newsletter:** [Unbearable TechTips Weekly](https://unbearabletechtips.beehiiv.com) · **All Actors:** [github.com/UnbearableDev](https://github.com/UnbearableDev)

### What it does

Point any MCP-capable client (Claude Desktop, Cursor, n8n, Make, Zapier, custom agents) at this server and get fast, structured answers to Hungarian address questions:

- **Validate** a `(postcode, city)` pair before storing it in your DB
- **Look up** the settlement and county for any HU postcode
- **Find** all postcodes that serve a given city (handy for Budapest: 23 districts, 100+ postcodes)
- **List** every postcode in a Hungarian county
- **Map** Budapest district numbers (1–23 or I–XXIII) to their postcode ranges

### Tools

| Tool | Purpose |
|------|---------|
| `lookup_postcode(postcode)` | Settlement + county + (if BP) district for a 4-digit HU postcode |
| `lookup_city(city)` | All postcodes for a city (diacritic-insensitive — `gyor` matches `Győr`) |
| `validate_address(postcode, city)` | yes/no + corrected suggestion if mismatch |
| `budapest_district_lookup(district)` | Budapest I-XXIII (or 1-23) → list of postcodes in that district |
| `list_postcodes_in_county(county_name)` | Bulk listing — every postcode in a county |

### Example

Call: `lookup_postcode("6720")`

Output:

```json
{
  "postcode": "6720",
  "city": "Szeged",
  "county": "Csongrád-Csanád",
  "region": "Dél-Alföld",
  "country": "HU",
  "valid": true
}
```

Call: `validate_address(postcode="1051", city="Budapest")`

Output:

```json
{
  "valid": true,
  "postcode": "1051",
  "city": "Budapest",
  "district": "V. kerület",
  "county": "Budapest",
  "region": "Közép-Magyarország"
}
```

Call: `budapest_district_lookup("1117")`

Output:

```json
{
  "postcode": "1117",
  "district": "XI. kerület",
  "district_name": "Újbuda",
  "city": "Budapest"
}
```

### Pricing

Free to use — hosted on Apify, bring your own Apify token.

### Data sources

- **Magyar Posta official postal catalog** (`Iranyitoszam-Internet_uj.xlsx`) — postcode → settlement mapping
- **KSH (Hungarian Central Statistical Office) settlement registry** — county / district / KSH code per settlement, via the open [`tamas-ferenci/IrszHnk`](https://github.com/tamas-ferenci/IrszHnk) compilation

Coverage: 3,484 postcode-settlement entries spanning 2,962 unique postcodes (1011–9985), all 19 Hungarian counties + Budapest. Refreshed quarterly.

### Connecting from Claude Desktop

```json
{
  "mcpServers": {
    "hu-postcode": {
      "transport": "streamable-http",
      "url": "https://unbearable-dev--hu-postcode-validator.apify.actor/mcp",
      "headers": { "Authorization": "Bearer <YOUR_APIFY_TOKEN>" }
    }
  }
}
```

### What's NOT covered

- Street-level address validation (no clean public data source post-2022 KEKKH restrictions)
- Fuzzy / Levenshtein city-name matching (v1.1 roadmap)
- Non-Hungarian addresses

### Source / contact

Issues and ideas: `unbearabledev@gmail.com` or the GitHub org [`UnbearableDev`](https://github.com/UnbearableDev).

***

Built by Noel @ Unbearable Labs — more like this in the weekly newsletter: https://unbearabletechtips.beehiiv.com

# Actor input Schema

## Actor input object example

```json
{}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("unbearable_dev/hu-postcode-validator").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("unbearable_dev/hu-postcode-validator").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 '{}' |
apify call unbearable_dev/hu-postcode-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unbearable_dev/hu-postcode-validator"
        }
    }
}

```

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/AGZAOxb50xi2lNykN/builds/POGc0ZKE0ZihajACU/openapi.json
