# BNPB Disaster Data

Search the national disaster agency's own register — historical event datasets and hazard-zone layers, with every dataset's downloadable files.

- Method: `GET`
- Path: `/v1/disasters/datasets`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `q` | string | required | Keyword in Indonesian, e.g. `banjir`, `gempa`, `longsor`. |
| `page` | integer | optional | 1 to 500. |
| `page_size` | integer | optional | Datasets per page, 1 to 50. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

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

**Example response**

```json
{
  "data": {
    "query": "banjir",
    "page": 1,
    "page_size": 20,
    "total_items": 31,
    "total_pages": 2,
    "results": [
      {
        "name": "banjir_ar",
        "title": "BANJIR_AR",
        "notes": "Berisi informasi sebaran lokasi banjir dalam bentuk polygon (AR) di Kabupaten Kotabaru Provinsi Kalimantan Selatan.",
        "organization": "Data Integrasi",
        "num_resources": 4,
        "modified": "2023-10-25",
        "resources": [
          { "name": "BANJIR_AR (CSV)", "format": "CSV", "url": "https://data.bnpb.go.id/dataset/banjir_ar/resource.csv" }
        ]
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-22T14:40:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-22T15:40:00.000Z"
  }
}
```