Playground
Try it right away
Usage
How to use this API
If you don't know the ID, follow the steps in order to get the correct data. Each step provides the needed IDs.
Replace the placeholder IDs in the endpoints below with the actual IDs.
1. Get All Provinces
To get a list of all provinces in Indonesia, use this endpoint:
https://cdn.jsdelivr.net/gh/rezzvy/geonesia-api/data/main.json
Sample Response
[
{
"id": "11",
"province": "ACEH"
},
{
"id": "12",
"province": "SUMATERA UTARA"
}
<-- More provinces -->
]
2. Get Cities by Province ID
Use the province ID from Step 1 to get its cities. Replace {ID} with the province ID:
https://cdn.jsdelivr.net/gh/rezzvy/geonesia-api/data/cities/{ID}.json
Sample Response
{
"id": "11",
"province": "ACEH",
"city": [
{
"id": "11.01",
"name": "KAB. ACEH SELATAN"
},
{
"id": "11.02",
"name": "KAB. ACEH TENGGARA"
}
<-- More cities -->
]
}
3. Get Districts by City ID
Use the city ID from Step 2 to get its districts:
https://cdn.jsdelivr.net/gh/rezzvy/geonesia-api/data/districts/{ID}.json
Sample Response
[
{
"id": "11.01.01",
"name": "Bakongan"
},
{
"id": "11.01.02",
"name": "Meukek"
}
<-- More districts -->
]
4. Get Villages by District ID
Use the district ID from Step 3 to get its villages:
https://cdn.jsdelivr.net/gh/rezzvy/geonesia-api/data/villages/{ID}.json
Sample Response
[
{
"id": "11.01.01.2001",
"name": "Keude Bakongan"
},
{
"id": "11.01.01.2002",
"name": "Lamreh"
}
<-- More villages -->
]