# KRL Commuter Line



The Jabodetabek commuter railway: the station directory, each station's departures, and every train's stop-by-stop route.



## KRL Station Directory

Every Jabodetabek commuter station with its operator code — the `{station_id}` the departure board and train routes take.

- Method: `GET`
- Path: `/v1/transit/krl/stations`

**Example request**

```bash
curl https://api.diraz.ae/v1/transit/krl/stations \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "stations": [
      { "id": "AC", "name": "ANCOL" },
      { "id": "AK", "name": "ANGKE" },
      { "id": "BKS", "name": "BEKASI" }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-19T00:00:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-20T00:00:00.000Z"
  }
}
```

## KRL Departure Board

Every train that calls at one station today, in order: line, destination, departure time, and arrival at the destination.

- Method: `GET`
- Path: `/v1/transit/krl/schedules/{station_id}`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `station_id` | path segment | required | Operator station code from the directory, e.g. `BKS` for Bekasi. |

**Example request**

```bash
curl https://api.diraz.ae/v1/transit/krl/schedules/%7Bstation_id%7D \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "station": { "id": "BKS", "name": "BEKASI" },
    "departures": [
      { "train_id": "6005", "line": "COMMUTER LINE CIKARANG", "route": "BEKASI-KAMPUNGBANDAN VIA PSE", "destination": "KAMPUNGBANDAN VIA PSE", "departs_at": "06:03", "destination_arrival": "06:48", "line_color": "#0084D8" },
      { "train_id": "5020A", "line": "COMMUTER LINE CIKARANG", "route": "MANGGARAI-CIKARANG", "destination": "CIKARANG", "departs_at": "06:10", "destination_arrival": "06:31", "line_color": "#0084D8" }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-19T00:00:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-20T00:00:00.000Z"
  }
}
```

## KRL Train Route

The stop-by-stop route of one train: every station it calls at, in order, with its time and connection holds.

- Method: `GET`
- Path: `/v1/transit/krl/trains/{train_id}`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `train_id` | path segment | required | A train number from the departure board, e.g. `6005`. |

**Example request**

```bash
curl https://api.diraz.ae/v1/transit/krl/trains/%7Btrain_id%7D \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "train_id": "6005",
    "line": "COMMUTER LINE CIKARANG",
    "stops": [
      { "station_id": "BKS", "station_name": "BEKASI", "time": "06:03", "transit_station": false },
      { "station_id": "KRI", "station_name": "KRANJI", "time": "06:05", "transit_station": false }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-19T00:00:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-20T00:00:00.000Z"
  }
}
```