Search Subdistrict
https://rajaongkir.komerce.id/api/v1/destination/sub-district/{district_id}
The Search Subdistrict Endpoint represents the third vital step in the hierarchical location selection process for the RajaOngkir API. This endpoint retrieves all districts (kecamatan) within a specific city, enabling applications to offer a fully detailed and dynamic location selection experience down to the district level.
By supplying the city ID obtained from the Search District endpoint, users can access structured district data necessary for accurate shipping rate calculations, service availability checks, or address validation. This fine-grained geographic data is particularly beneficial for last-mile delivery logistics, dynamic form population, and e-commerce checkout flows.
This endpoint plays a critical role in systems that require complete administrative breakdowns, ensuring that end users can precisely define their shipping destinations with minimal error.
Endpoint Details
-
Method:
GET
-
Base URL:
https://rajaongkir.komerce.id/api/v1/destination/sub-district/{district_id}
-
Description:
Retrieves a list of all subdistrict within a specified Indonesian district using the district ID. This endpoint provides the third level in the location hierarchy and is essential for completing the destination input needed for shipping cost calculations and logistic planning.
This endpoint serves as the third step in the Step-by-Step Method integration model, following the city selection process and enabling deeper geographic targeting for shipping and service delivery.
Request Body
curl --location 'https://rajaongkir.komerce.id/api/v1/destination/sub-district/5823' \
--header 'Key: YOUR_API_KEY'
Response
{}{
"meta": {
"message": "Success Get Sub District By District ID",
"code": 200,
"status": "success"
},
"data": [
{
"id": 68513,
"name": "BALERAKSA",
"zip_code": "53355"
},
{
"id": 68514,
"name": "GRANTUNG",
"zip_code": "53355"
},
{
"id": 68515,
"name": "KARANGSARI",
"zip_code": "53355"
},
{
"id": 68516,
"name": "KRAMAT",
"zip_code": "53355"
},
{
"id": 68517,
"name": "PEKIRINGAN",
"zip_code": "53355"
},
{
"id": 68518,
"name": "PEPEDAN",
"zip_code": "53355"
},
{
"id": 68519,
"name": "RAJAWANA",
"zip_code": "53355"
},
{
"id": 68520,
"name": "SIRAU",
"zip_code": "53355"
},
{
"id": 68521,
"name": "TAJUG",
"zip_code": "53355"
},
{
"id": 68522,
"name": "TAMANSARI",
"zip_code": "53355"
},
{
"id": 68523,
"name": "TUNJUNGMULI",
"zip_code": "53355"
}
]
}