Indonesian Address Provider API
Indonesia has 5 levels of address types starting from the province, district or city, sub-district and finally the kelurahan (sub from sub-district).
This address types, sometimes confusing peoples if they are less aware of the surrounding area.
So, with from that problem we built solution for providing address to get matched content or nearly closed to exact address.
Key Features
This API must be able to display 5 types of addresses based on the hierarchy plus the zipcode (postal code).
Lightweight. This API was built from Seme Framework v4.0.0 (PHP MVC framework) that blazingly fast with simple codes.
RDBMS. You can played with the data sources, because its use common DB that used with PHP, like MySQL or MariaDB.
JSON. The API output has own standard result in json format that can be implemented to any applications.
License
This API and Seme Framework are licensed under MIT.
Question and Answer
Feel free to ask me on my instagram, facebook, or open an issue on github.
Resources
This API and pages source codes are available on github.
Getting Started
This API is can be used for free but with no warranty. First thing first the base url of API endpoint is https://alamat.thecloudalert.com/api/
.
The API endpoint should follow the base url endpoint before consumed.
Get Provinces
API endpoint for getting list of provinces in Indonesia.
Basic Usage
GET provinsi/get/
Example
Example API request:
GET https://alamat.thecloudalert.com/api/provinsi/get/
Example result:
{ "status": 200, "message": "Berhasil", "result": [ { "id": "1", "text": "Bali" }, { "id": "2", "text": "Bangka Belitung" } ] }
Get Cities
API endpoint for getting the list of cities in Indonesia by province ID.
Basic Usage
GET kabkota/get/?d_provinsi_id=[ID_FROM_PROVINCE_API]
Example
Example API request:
GET https://alamat.thecloudalert.com/api/kabkota/get/?d_provinsi_id=1
Example result:
{ "status": 200, "message": "Berhasil", "result": [ { "id": "1", "text": "Kabupaten Badung" }, { "id": "2", "text": "Kabupaten Bangli" } ] }
Get Districts
API endpoint for getting the list of districts in Indonesia by cities ID.
Basic Usage
GET kecamatan/get/?d_kabkota_id=[ID_FROM_CITIES_API]
Example
Example API request:
GET https://alamat.thecloudalert.com/api/kecamatan/get/?d_kabkota_id=1
Example result:
{ "status": 200, "message": "Berhasil", "result": [ { "id": "1", "text": "Abiansemal" }, { "id": "2", "text": "Kuta" } ] }
Get Sub Districts
API endpoint for getting the list of sub districts in Indonesia by districts ID.
Basic Usage
GET kelurahan/get/?d_kecamatan_id=[ID_FROM_DISTRICT_API]
Example
Example API request:
GET https://alamat.thecloudalert.com/api/kelurahan/get/?d_kecamatan_id=1
Example result:
{ "status": 200, "message": "Berhasil", "result": [ { "id": "17", "text": "Abiansemal" }, { "id": "18", "text": "Angantaka" } ] }
Get Zip Codes
API endpoint for getting the list of Zip Codes in Indonesia by cities ID and districts ID.
Basic Usage
GET kodepos/get/?d_kabkota_id=[ID_FROM_CITIES_API]&d_kecamatan_id=[ID_FROM_DISTRICT_API]
Example
Example API request:
GET https://alamat.thecloudalert.com/api/kodepos/get/?d_kabkota_id=1&d_kecamatan_id=1
Example result:
{ "status": 200, "message": "Berhasil", "result": [ { "id": "3719", "text": "29871" }, { "id": "3720", "text": "29872" } ] }
Get Address by Keyword (Filter / Search)
API endpoint for filtering the address result by keyword.
Basic Usage
GET cari/index/?keyword=[Keyword]
Example
Example API request:
GET https://alamat.thecloudalert.com/api/cari/index/?keyword=Soreang
Example result:
{ "status": 200, "message": "Berhasil", "result": [ "negara": "Indonesia", "provinsi": "Jawa Barat", "kabkota": "Kabupaten Bandung", "kecamatan": "Soreang", "desakel": "Bukit Harapan" }, ... ] }