# Indonesian Regions



Every province, city, and district, browsable by level or searched by name and postal code.



## Administrative Regions

Every Indonesian province, city, and district with its official code — the three lists an address form walks, in the order it walks them.

- Method: `GET`
- Path: `/v1/regions/{level}`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `level` | path segment | required | `provinces`, `regencies`, or `districts`. |
| `province_code` | string | optional | Two digits. Required when listing regencies. |
| `regency_code` | string | optional | Four digits. Required when listing districts — and the districts carry the postal code. |

**Example request**

```bash
curl https://api.diraz.ae/v1/regions/%7Blevel%7D \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "level": "districts",
    "parent_code": "3171",
    "regions": [
      {
        "code": "317106",
        "name": "MENTENG",
        "level": "district",
        "parent_code": "3171",
        "postal_code": "10330"
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
```

## Region and Postal Code Search

Find a place by name for an autocomplete, or by postal code to fill an address in one step. Prefix matches rank first.

- Method: `GET`
- Path: `/v1/regions/search`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `q` | string | optional | At least two characters, matched against the name. Prefix matches are returned first. |
| `postal_code` | string | optional | Five digits. One of `q` or `postal_code` is required. |
| `level` | string | optional | Narrow to `province`, `regency`, or `district`. |
| `limit` | integer | optional | 1 to 50. |

**Example request**

```bash
curl https://api.diraz.ae/v1/regions/search \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "query": "10330",
    "regions": [
      {
        "code": "317106",
        "name": "MENTENG",
        "level": "district",
        "parent_code": "3171",
        "postal_code": "10330"
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
```