Infinys Wilayah Indonesia API
by Infinys System Indonesia https://www.infinyscloud.com/platform/odoo/Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 28164 |
Technical Name |
infinys_wilayah_indonesia_api |
License | LGPL-3 |
Website | https://www.infinyscloud.com/platform/odoo/ |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 28164 |
Technical Name |
infinys_wilayah_indonesia_api |
License | LGPL-3 |
Website | https://www.infinyscloud.com/platform/odoo/ |
API Wilayah Indonesia
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.
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.
-
Navigate to
Settings > Technical > Parameters > System Parameters.
-
Find the parameter with the key
wilayah.api.key
. It will have a default value likechange_this_to_your_secret_api_key
. -
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
). - Save the changes.
-
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
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.
-
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 fieldExternal ID
-
CSV column
name
maps to Odoo fieldName Provinsi
-
CSV column
code
maps to Odoo fieldKode Provinsi
-
CSV column
-
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 fieldExternal ID
-
CSV column
name
maps to Odoo fieldNama Kota
-
CSV column
code
maps to Odoo fieldKode Kota
-
CSV column
provinsi_id/id
maps to Odoo fieldProvinsi/External ID
-
CSV column
-
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 fieldExternal ID
-
CSV column
name
maps to Odoo fieldNama Kecamatan
-
CSV column
code
maps to Odoo fieldKode Kecamatan
-
CSV column
kota_id/id
maps to Odoo fieldKota/External ID
-
CSV column
-
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 fieldExternal ID
-
CSV column
name
maps to Odoo fieldNama Kelurahan
-
CSV column
code
maps to Odoo fieldKode Kelurahan
-
CSV column
kecamatan_id/id
maps to Odoo fieldKecamatan/External ID
-
CSV column
postal_code
maps to Odoo fieldKode Pos
-
CSV column
Global Search
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 a list of all provinces in Indonesia.
Example Response:
[
{
"code": "11",
"name": "ACEH"
},
{
"code": "12",
"name": "SUMATERA UTARA"
},
...
]
Get province detail by its code.
Example URL: /api/provinsi/32
{
"code": "32",
"name": "JAWA BARAT"
}
Get a list of provinces filtered by name (case-insensitive, partial match).
Example URL: /api/provinsi?name=jawa
[
{
"code": "32",
"name": "JAWA BARAT"
},
{
"code": "33",
"name": "JAWA TENGAH"
},
...
]
Kota & Kabupaten
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 a list of cities/regencies filtered by province.
Example URL:
/api/kota?kode_provinsi=32
[
{
"code": "3201",
"name": "BOGOR",
"province_code": "32"
},
{
"code": "3202",
"name": "SUKABUMI",
"province_code": "32"
},
...
]
Get city/regency detail including its province.
Example URL: /api/kota/3204
{
"code": "3204",
"name": "BANDUNG",
"province": {
"code": "32",
"name": "JAWA BARAT"
}
}
Get a list of cities/regencies filtered by name (case-insensitive, partial match).
Example URL: /api/kota?name=bandung
[
{
"code": "3217",
"name": "BANDUNG BARAT",
"province_code": "32"
},
{
"code": "3273",
"name": "BANDUNG",
"province_code": "32"
}
]
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 a list of districts filtered by city/regency.
Example URL:
/api/kecamatan?kode_kota=3204
[
{
"code": 3204010,
"name": "CIWIDEY",
"city_code": "3204"
},
{
"code": 3204011,
"name": "RANCABALI",
"city_code": "3204"
},
...
]
Get district detail including its city and province data.
Example URL:
/api/kecamatan/3204050
{
"code": "3204050",
"name": "KERTASARI",
"city": {
"code": "3204",
"name": "BANDUNG"
},
"province": {
"code": "32",
"name": "JAWA BARAT"
}
}
Get a list of districts filtered by name (case-insensitive, partial match).
Example URL:
/api/kecamatan?name=cicalengka
[
{
"code": 3204100,
"name": "CICALENGKA",
"city_code": "3204"
}
]
Kelurahan & Desa
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 a list of sub-districts/villages filtered by district.
Example URL:
/api/kelurahan?kode_kecamatan=3204050
[
{
"code": 3204050001,
"name": "NEGLAWANGI",
"postal_code": "40386",
"district_code": 3204050
},
{
"code": 3204050002,
"name": "SANTOSA",
"postal_code": "40386",
"district_code": 3204050
},
...
]
Get detail of a sub-district/village including its upper level hierarchy.
Example URL:
/api/kelurahan/3204050001
{
"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 a list of sub-districts/villages filtered by name (case-insensitive, partial match).
Example URL:
/api/kelurahan?name=cilandak
[
{
"code": "3171020001",
"name": "CILANDAK TIMUR",
"postal_code": "12560",
"district_code": "3171020"
},
...
]
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
Please log in to comment on this module