Skip to Content
Menu
v 18.0 Third Party 11
Download for v 18.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 28164
Technical Name infinys_wilayah_indonesia_api
LicenseLGPL-3
Websitehttps://www.infinyscloud.com/platform/odoo/
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 28164
Technical Name infinys_wilayah_indonesia_api
LicenseLGPL-3
Websitehttps://www.infinyscloud.com/platform/odoo/

API Wilayah Indonesia

About the Module

This module provides a RESTful API to access geographical and administrative data for all regions in Indonesia, from provinces, cities/regencies, districts, to sub-districts/villages. The main purpose of this API is to provide Indonesian region data that is free, easily accessible, and secure with an API key, so it can be used by developers for various application needs.

Setup

To use this module, you need to set up the API key in the system parameters. Upon installation, a default API key is created automatically. It is crucial that you change this default value to a secure, private key of your own.

  1. Navigate to Settings > Technical > Parameters > System Parameters. System Parameters Menu
  2. Find the parameter with the key wilayah.api.key. It will have a default value like change_this_to_your_secret_api_key.
  3. Edit the parameter and change the Value to a secure, random string that you generate (e.g., your-very-secret-and-long-api-key-12345). API Key Table
  4. Save the changes.
  5. When making requests to the API, include your new API key in the X-API-Key header. For example:

    curl -H "X-API-Key: your-very-secret-and-long-api-key-12345" http://your-odoo-instance/api/provinsi

Import Data

Before using the API, you need to import the geographical data into your Odoo instance. The data is provided in CSV format and must be imported in a specific order to maintain data integrity and relationships.

  1. Import Provinces ( data_provinsi.csv ):

    Navigate to the "Provinsi" menu (e.g., through your custom menu or by searching for "Provinsi" in the global search).

    Click on Actions > Import records.

    Upload data_provinsi.csv. Ensure the following mappings:

    • CSV column id maps to Odoo field External ID
    • CSV column name maps to Odoo field Name Provinsi
    • CSV column code maps to Odoo field Kode Provinsi
    Import Provinces Step
  2. Import Cities/Regencies ( data_kota.csv ):

    Navigate to the "Kota/Kabupaten" menu.

    Click on Actions > Import records.

    Upload data_kota.csv. Ensure the following mappings:

    • CSV column id maps to Odoo field External ID
    • CSV column name maps to Odoo field Nama Kota
    • CSV column code maps to Odoo field Kode Kota
    • CSV column provinsi_id/id maps to Odoo field Provinsi/External ID
    Import Cities Step
  3. Import Sub-Districts ( data_kecamatan.csv ):

    Navigate to the "Kecamatan" menu.

    Click on Actions > Import records.

    Upload data_kecamatan.csv. Ensure the following mappings:

    • CSV column id maps to Odoo field External ID
    • CSV column name maps to Odoo field Nama Kecamatan
    • CSV column code maps to Odoo field Kode Kecamatan
    • CSV column kota_id/id maps to Odoo field Kota/External ID
    Import Sub-Districts Step
  4. Import Villages ( data_kelurahan.csv ):

    Navigate to the "Kelurahan/Desa" menu.

    Click on Actions > Import records.

    Upload data_kelurahan.csv. Ensure the following mappings:

    • CSV column id maps to Odoo field External ID
    • CSV column name maps to Odoo field Nama Kelurahan
    • CSV column code maps to Odoo field Kode Kelurahan
    • CSV column kecamatan_id/id maps to Odoo field Kecamatan/External ID
    • CSV column postal_code maps to Odoo field Kode Pos
    Import Villages Step
API Documentation

Global Search

GET /api/search?q=<keyword>

Performs a case-insensitive search across provinces, cities, sub-districts, and villages. Returns a grouped list of results. Requires a query string of at least 3 characters.

Example Response:

[ { "provinsi": [ { "code": "12", "name": "SUMATERA UTARA" }, ... ], "kota": [ { "code": "1111", "name": "ACEH UTARA", "province_code": "11" }, ... ], "kecamatan": [ { "code": "1102021", "name": "SINGKIL UTARA", "city_code": "1102" }, ... ], "kelurahan": [ { "code": "1102021001", "name": "GOSONG TELAGA UTARA", "postal_code": "24787", "district_code": "1102021" }, ... ] } ]

Provinsi

GET /api/provinsi

Get a list of all provinces in Indonesia.

Example Response:

[ { "code": "11", "name": "ACEH" }, { "code": "12", "name": "SUMATERA UTARA" }, ... ]

GET /api/provinsi/<kode_provinsi>

Get province detail by its code.

Example URL: /api/provinsi/32

Example Response:
               
{
    "code": "32",
    "name": "JAWA BARAT"
}
            
GET /api/provinsi?name=<nama_provinsi>

Get a list of provinces filtered by name (case-insensitive, partial match).

Example URL: /api/provinsi?name=jawa

Example Response:

[ { "code": "32", "name": "JAWA BARAT" }, { "code": "33", "name": "JAWA TENGAH" }, ... ]

Kota & Kabupaten

GET /api/kota

Get a list of all cities/regencies in Indonesia.

Example Response:

[ { "code": "1101", "name": "SIMEULUE", "province_code": "11" }, { "code": "1102", "name": "ACEH SINGKIL", "province_code": "11" }, ... ]

GET /api/kota?kode_provinsi=<kode_provinsi>

Get a list of cities/regencies filtered by province.

Example URL: /api/kota?kode_provinsi=32

Example Response:

[ { "code": "3201", "name": "BOGOR", "province_code": "32" }, { "code": "3202", "name": "SUKABUMI", "province_code": "32" }, ... ]

GET /api/kota/<kode_kota>

Get city/regency detail including its province.

Example URL: /api/kota/3204

Example Response:

{ "code": "3204", "name": "BANDUNG", "province": { "code": "32", "name": "JAWA BARAT" } }

GET /api/kota?name=<nama_kota>

Get a list of cities/regencies filtered by name (case-insensitive, partial match).

Example URL: /api/kota?name=bandung

Example Response:

[ { "code": "3217", "name": "BANDUNG BARAT", "province_code": "32" }, { "code": "3273", "name": "BANDUNG", "province_code": "32" } ]

Kecamatan

GET /api/kecamatan

Get a list of all districts in Indonesia.

Example Response:

[ { "code": "1101010", "name": "TEUPAH SELATAN", "city_code": "1101" }, { "code": "1101020", "name": "SIMEULUE TIMUR", "city_code": "1101" }, ... ]

GET /api/kecamatan?kode_kota=<kode_kota>

Get a list of districts filtered by city/regency.

Example URL: /api/kecamatan?kode_kota=3204

Example Response:

[ { "code": 3204010, "name": "CIWIDEY", "city_code": "3204" }, { "code": 3204011, "name": "RANCABALI", "city_code": "3204" }, ... ]

GET /api/kecamatan/<kode_kecamatan>

Get district detail including its city and province data.

Example URL: /api/kecamatan/3204050

Example Response:

{ "code": "3204050", "name": "KERTASARI", "city": { "code": "3204", "name": "BANDUNG" }, "province": { "code": "32", "name": "JAWA BARAT" } }

GET /api/kecamatan?name=<nama_kecamatan>

Get a list of districts filtered by name (case-insensitive, partial match).

Example URL: /api/kecamatan?name=cicalengka

Example Response:

[ { "code": 3204100, "name": "CICALENGKA", "city_code": "3204" } ]

Kelurahan & Desa

GET /api/kelurahan

Get a list of all sub-districts/villages in Indonesia.

Example Response:

[ { "code": 1101010001, "name": "LATIUNG", "postal_code": "23895,23898", "district_code": 1101010 }, { "code": 1101010002, "name": "LABUHAN BAJAU", "postal_code": "23895,23898", "district_code": 1101010 }, ... ]

GET /api/kelurahan?kode_kecamatan=<kode_kecamatan>

Get a list of sub-districts/villages filtered by district.

Example URL: /api/kelurahan?kode_kecamatan=3204050

Example Response:

[ { "code": 3204050001, "name": "NEGLAWANGI", "postal_code": "40386", "district_code": 3204050 }, { "code": 3204050002, "name": "SANTOSA", "postal_code": "40386", "district_code": 3204050 }, ... ]

GET /api/kelurahan/<kode_kelurahan>

Get detail of a sub-district/village including its upper level hierarchy.

Example URL: /api/kelurahan/3204050001

Example Response:

{ "code": 3204050001, "name": "NEGLAWANGI", "postal_code": "40386", "sub_district": { "code": 3204050, "name": "KERTASARI" }, "city": { "code": 3204, "name": "BANDUNG" }, "province": { "code": 32, "name": "JAWA BARAT" } }

GET /api/kelurahan?name=<nama_kelurahan>

Get a list of sub-districts/villages filtered by name (case-insensitive, partial match).

Example URL: /api/kelurahan?name=cilandak

Example Response:

[ { "code": "3171020001", "name": "CILANDAK TIMUR", "postal_code": "12560", "district_code": "3171020" }, ... ]

Kode Pos

GET /api/kodepos/<kode_pos>

Returns a list of all regions (villages/kelurahan) that match the given postal code.

Example Response:

[ { "code": "3273080003", "name": "BATUNUNGGAL", "postal_code": "40266", "kecamatan": { "code": "3273080", "name": "BANDUNG KIDUL" }, "kota": { "code": "3273", "name": "BANDUNG" }, "provinsi": { "code": "32", "name": "JAWA BARAT" } } ]

ABOUT INFINYS

Infinyscloud is a trusted leader in Indonesia's cloud computing industry, delivering secure, scalable, and reliable cloud solutions that help businesses grow and stay competitive. With comprehensive services covering cloud consulting, strategy, migration, and optimization, we guide businesses through every step of their cloud journey making adoption smooth and effective.

Our commitment to innovation and quality is reflected in our ISO certifications and strong partnerships with global platforms like AWS and Odoo. Known for our responsive customer service and deep expertise in cloud technologies, Infinyscloud is here to support your business with solutions you can depend on.

Infinys System Indonesia is an Odoo Partner, a company that has been officially recognized by Odoo to sell, implement, consult, and provide technical support related to the use of Odoo. Odoo has a strict partnership system to ensure that its partners are able to provide high-quality services in accordance with Odoo's global standards. These partners also have access to exclusive resources, training, and support from Odoo to ensure the success of implementations in every project. Since we also operate in the field of cloud computing, we also provide Odoo Cloud Hosting services.

Try the Module :

🌐 Website: https://odoo-ce.atisicloud.com

👤 User: odoo-trial@isi.co.id

🔑 Password: odoo-trial

Help and Support

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.