API Reference

Postal Codes

Directory of 83,000+ postal code records (one per village) across Indonesia complete with regional hierarchy from province to village, keyed by Kemendagri region codes. Static data sourced from the official dataset. Mapping to BPS region codes is not available yet: the bps_* parameters exist, but the data behind them is still empty.

Main endpoint
GET https://use.apiindonesia.id/api/v1/kodepos
Endpoints
4
Authentication
x-api-key header (create one free in the dashboard)
Price
2 credits (Rp2) per successful request; failed requests are free
Format
JSON (REST), with cURL, JavaScript and Python examples
Product Brief

What this API gives you

Directory of 83,000+ postal code records (one per village) across Indonesia complete with regional hierarchy from province to village, keyed by Kemendagri region codes. Static data sourced from the official dataset. Mapping to BPS region codes is not available yet: the bps_* parameters exist, but the data behind them is still empty.

Coverage
4

ready-to-use endpoints in this product, with JSON responses and consistent error handling.

Access
API key

Can be tried with the 3,000 credit signup bonus, then used in production through one API Indonesia key.

Sample resource
https://use.apiindonesia.id/api/v1/kodepos

Returns paginated postal codes with explicit Kemendagri administrative codes. BPS code fields and filters are available for 96% of records (official SIG BPS 2025 bridge). A small number of newer villages have no BPS counterpart yet. Note: (not available).

When should you use it?

The Postal Code API supports products that need to connect postal codes with Indonesian region hierarchy. It fits checkout, shipping labels, address validation, area search, and customer segmentation.

Address forms must auto-fill postal codes after users choose a region.

Support teams need to find a region when customers only provide a postal code.

Logistics products need to match postal codes with province, city, district, and village.

Postal-code relationships are not always one-to-one. Design the UI so users can still choose the right option.

Example product scenarios

This section separates the product page from the docs. The docs explain how to call endpoints; this page explains why the endpoints make sense for your feature.

  • E-commerce & logistics: auto-fill postal codes when a customer selects a shipping address.
  • Fintech: validate that a postal code matches the stated domicile address during KYC.
  • Address-lookup apps: search a region by postal code or vice versa.

Example Usage

Request
curl "https://use.apiindonesia.id/api/v1/kodepos?kabupaten_id=3273" \\
  -H "x-api-key: YOUR_API_KEY"
Response · 200 OK
{
  "data": [
    {
      "id": "kp_3273011001",
      "village_code": "3273011001",
      "village_name": "Sukarasa",
      "district_code": "327301",
      "district_name": "Sukasari",
      "regency_code": "3273",
      "regency_name": "Kota Bandung",
      "province_code": "32",
      "province_name": "Jawa Barat",
      "postal_code": "40151",
      "kode_pos": "40151",
      "bps_village_code": null,
      "kemendagri_village_code": "3273011001",
      "source_version": "legacy-v1",
      "crosswalk_source_version": null,
      "is_active": 1
    }
  ],
  "meta": {
    "total": 151,
    "page": 1,
    "per_page": 20,
    "total_pages": 8
  }
}

Browse the data

Related Articles

Pricing 2 credits (Rp2) per successful request; failed requests are free. One-time 3,000 credit signup bonus, no credit card, no monthly allowance.

Postal Codes API questions

How many postal code records are there?

There are 83,000+ postal code records, one per village, with the full province-to-village hierarchy and Kemendagri region codes.

How do I find the area for a postal code?

Use GET /api/v1/kodepos/lookup?kode_pos=40151 for an exact match, or /kodepos/search?q=... to search by village name or postal code number.

Are BPS region codes available?

Not yet. The bps_* parameters and fields exist, but the BPS mapping data is still empty, so use Kemendagri codes for now.

Get Started

Start Integrating
Today

Sign up for free and get a 3,000 credit bonus (Rp3,000) once your email is verified, grab an API key, and call your first endpoint right away. No credit card, no tedious approval process.

Dot wave visualization