# Indonesia Address Parser & Normalizer (`devan_ziho/indonesia-address-parser`) Actor

Parse and normalize messy Indonesian addresses into structured JSON. Extract province, city/regency, district, village, street, RT/RW, postal code, landmarks, and match confidence. Supports single and batch processing.

- **URL**: https://apify.com/devan\_ziho/indonesia-address-parser.md
- **Developed by:** [Devan Primadita](https://apify.com/devan_ziho) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 parsed addresses

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?

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

## Indonesia Address Parser & Normalizer

Parse messy Indonesian addresses into structured, normalized JSON.

This Actor is designed for Indonesian address data that may contain abbreviations, inconsistent formatting, informal city names, district names, RT/RW, landmarks, and mixed administrative references.

It uses a national Indonesian administrative dataset and custom matching logic to identify the most likely province, city/regency, district, and village level when available.

### What it does

The Actor can extract and normalize:

- Raw address
- Normalized address
- Street
- House number
- RT
- RW
- Village / Kelurahan / Desa
- District / Kecamatan
- City / Regency
- Province
- Postal code
- Landmark
- Region code
- Match level
- Match score
- Confidence
- Warnings

It supports both single-address and batch processing.

### Example input

Single address:

````json
{
  "address": "Jl Margonda 45 Beji Depok Jabar"
}

Batch input :
{
  "addresses": [
    "Jl Kaliurang 25 Depok Sleman Jogja",
    "Jl Margonda 45 Beji Depok Jabar",
    "Jl Soekarno Hatta 30 Lowokwaru Malang Jatim"
  ]
}

Example Output :
{
  "raw_address": "jl margonda 45 beji depok jabar",
  "normalized_address": "Jalan Margonda 45 Beji Depok Jabar, Kota Depok, Jawa Barat",
  "street": "Jalan Margonda",
  "house_number": "45",
  "rt": null,
  "rw": null,
  "village": null,
  "district": "Beji",
  "city": "Kota Depok",
  "province": "Jawa Barat",
  "postal_code": null,
  "landmark": null,
  "region_code": null,
  "national_match_score": 480,
  "match_level": "district",
  "confidence": 0.6,
  "warnings": []
}

Indonesian address normalization

The Actor is built to handle common Indonesian address variations and abbreviations such as:

Jl / Jln → Jalan
Jabar → Jawa Barat
Jateng → Jawa Tengah
Jatim → Jawa Timur
DIY / Jogja → Daerah Istimewa Yogyakarta
Jaksel → Jakarta Selatan
Jaktim → Jakarta Timur
Sby → Surabaya
Mlg → Malang
Bdg → Bandung
Smg → Semarang
Sumut → Sumatera Utara
Sulsel → Sulawesi Selatan
Sulut → Sulawesi Utara

The parser also understands administrative hierarchy to reduce ambiguity between locations with the same or similar names.

For example:
Jl Kaliurang 25 Depok Sleman Jogja

is resolved as: 
Province: Daerah Istimewa Yogyakarta
City/Regency: Kabupaten Sleman
District: Depok

Match levels

The match_level field indicates how far the national administrative matcher could confidently resolve the address.

Possible values include:

province
city
district
village
partial
unmatched

The Actor does not intentionally invent lower administrative levels when they are not present in the input.

For example, if an address only contains city and district information, the village field may remain null.

Batch processing

Use the addresses field to process multiple addresses in one run.

Example:
{
  "addresses": [
    "Jl Setiabudi 12 Setiabudi Jaksel DKI",
    "Jl Imam Bonjol 12 Denpasar Barat Bali",
    "Jl Gatot Subroto 25 Medan Petisah Sumut"
  ]
}

Each address is returned as a separate dataset item.

Use cases

This Actor can be useful for:

E-commerce address cleaning
Marketplace seller data
Logistics and delivery systems
CRM data normalization
Customer databases
Lead enrichment
Shipping address validation
Indonesian location analytics
Data cleansing pipelines
ETL workflows
API-based address preprocessing
Output dataset

Results are stored in the default Apify dataset.

They can be exported as:

JSON
CSV
Excel
XML
RSS

The dataset can also be accessed through the Apify API.

API usage

You can run this Actor using the Apify API and retrieve the default dataset after the run finishes.

Typical workflow:
Send address input
→ Run Actor
→ Parse and normalize
→ Store structured results
→ Retrieve dataset through API

This makes the Actor suitable for integration with external applications, backend systems, automation tools, and data pipelines.

Important notes

Indonesian addresses are often incomplete, inconsistent, or ambiguous.

The Actor attempts to resolve administrative hierarchy using national reference data and custom normalization logic, but not every input can be matched perfectly.

When a lower-level administrative area cannot be determined safely, the Actor may return null rather than guess.

For best results, include as much location context as possible, such as:

street + district + city/regency + province
Example recommended format
Jl Soekarno Hatta No. 30 Lowokwaru Kota Malang Jawa Timur

Informal formats and abbreviations are also supported.

Current scope

The Actor currently focuses on Indonesian address parsing and administrative normalization.

Coverage includes national administrative data down to village / kelurahan level where the input provides sufficient information.

Feedback

If you encounter an Indonesian address format that is not parsed correctly, please report the input example so the matching logic can be improved.

# Actor input Schema

## `address` (type: `string`):

Masukkan satu alamat Indonesia yang ingin diproses.
## `addresses` (type: `array`):

Masukkan beberapa alamat untuk diproses sekaligus.

## Actor input object example

```json
{
  "address": "Jl Sunan Kalijaga No 27 RT02 RW05 Kec Lowokwaru Kota Malang Jatim dekat Alfamart",
  "addresses": [
    "Jl Kaliurang 25 Depok Sleman Jogja",
    "Jl Margonda 45 Beji Depok Jabar"
  ]
}
````

# Actor output Schema

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

Open the default dataset containing structured Indonesian address results.

# 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 = {
    "address": "Jl Sunan Kalijaga No 27 RT02 RW05 Kec Lowokwaru Kota Malang Jatim dekat Alfamart",
    "addresses": [
        "Jl Kaliurang 25 Depok Sleman Jogja",
        "Jl Margonda 45 Beji Depok Jabar"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("devan_ziho/indonesia-address-parser").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 = {
    "address": "Jl Sunan Kalijaga No 27 RT02 RW05 Kec Lowokwaru Kota Malang Jatim dekat Alfamart",
    "addresses": [
        "Jl Kaliurang 25 Depok Sleman Jogja",
        "Jl Margonda 45 Beji Depok Jabar",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("devan_ziho/indonesia-address-parser").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 '{
  "address": "Jl Sunan Kalijaga No 27 RT02 RW05 Kec Lowokwaru Kota Malang Jatim dekat Alfamart",
  "addresses": [
    "Jl Kaliurang 25 Depok Sleman Jogja",
    "Jl Margonda 45 Beji Depok Jabar"
  ]
}' |
apify call devan_ziho/indonesia-address-parser --silent --output-dataset

```

## MCP server setup

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

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/dqat5B1U5maRBH3d2/builds/HveJH9MfBGQk4mWSj/openapi.json
