---
title: Wilayah Indonesia API
url: https://rone.dev/projects/wilayah-indonesia-api
description: Every Indonesian province, regency, district and village under one URL scheme.
language: en-US
updated: 2026-09-27
translations:
  id: https://rone.dev/id/projects/wilayah-indonesia-api
---

# Wilayah Indonesia API

Every Indonesian province, regency, district and village under one URL scheme.

[Projects](https://rone.dev/projects) / [API](https://rone.dev/projects/category/api)

Live · Started 2026 · 0 GitHub stars · 1 Forks

<Frame>
  ![The Wilayah Indonesia home page, with live counts of every administrative level](https://rone.dev/projects/wilayah-indonesia-api/home.webp)
</Frame>

Thirty-eight provinces, 514 regencies and cities, 7,277 districts and 83,731 villages, served as a REST API whose URL shape mirrors the administrative hierarchy itself. Every record carries its parent chain, and the entire dataset ships with the code — there is no database and no upstream call.

## Numbers

* **91,560** Records
* **4** Administrative levels
* **12** Endpoints

## Project facts

|          |                                                                                                                                                    |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status   | Live                                                                                                                                               |
| Category | API                                                                                                                                                |
| Started  | 2026                                                                                                                                               |
| Role     | Design and build                                                                                                                                   |
| Stack    | Python, FastAPI, Pydantic, Vercel                                                                                                                  |
| Licence  | MIT                                                                                                                                                |
| Links    | [Live API](https://wilayah.rone.dev) · [API reference](https://wilayah.rone.dev/docs) · [Source](https://github.com/ridwaanhall/wilayah-indonesia) |

## Overview

Indonesian administrative data is public and reasonably stable, and almost every project that needs it ends up re-scraping or re-typing it. This serves the whole hierarchy — province, regency or city, district, village — from one API, with each record naming its parent so a caller can walk back up without a second request.

The data does not change often enough to justify a database. All four levels load from JSON at import, get indexed into dictionaries by code and by parent, and are held for the process lifetime. Lookups are hash hits; there is no query planner and nothing to keep in sync.

## Two ways to address the same place

The primary scheme uses official codes, nested the way the hierarchy nests: a province code, then a regency code beneath it, then a district. That is the right shape when you already hold an official code and want its children.

A parallel scheme addresses the same records by ordinal position — the third regency of a province, the second district of that regency — which is what you want when you are walking a form from a dropdown rather than resolving a known code. A separate lookup resolves any code at any level in one call, without the caller needing to know which level it belongs to.

<CardGroup cols={2}>
  <Card title="Previous: SpaceX API" href="https://rone.dev/projects/spacex-api">
    Launch statistics, upcoming missions and Dragon tracking behind one REST contract.
  </Card>

  <Card title="Next: Arena Card" href="https://rone.dev/projects/arena-card">
    A signed-in profile card: ranked statistics, battle highlights and recent matches.
  </Card>
</CardGroup>
