Skip to content

Districts API

The Districts API provides access to all 7,285 Indonesian districts (kecamatan) with their administrative relationships.

Endpoints

List Districts

http
GET /nusa/districts

Returns a paginated list of all districts.

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 15, max: 100)
searchstringSearch by name or code
codes[]arrayFilter by specific district codes

Example Request

bash
curl "https://your-app.com/nusa/districts?search=pekalongan&per_page=10"

Get District

http
GET /nusa/districts/{code}

Returns a specific district by its code.

Path Parameters

ParameterTypeDescription
codestringDistrict code in xx.xx.xx format

Example Request

bash
curl "https://your-app.com/nusa/districts/33.75.01"

Get District Villages

http
GET /nusa/districts/{code}/villages

Returns all villages within a specific district.

Example Request

bash
curl "https://your-app.com/nusa/districts/33.75.01/villages"

Data Attributes

District Object

AttributeTypeDescription
codestringDistrict code in xx.xx.xx format
regency_codestringParent regency code
province_codestringParent province code
namestringDistrict name in Indonesian
postal_codesarrayAll postal codes within the district

Released under the MIT License.