API Indonesia docsAPI referenceGet an API keyllms.txt

BMKG: earthquakes, weather, warnings and air quality

Documentation index for AI agents: /llms.txt. Every page is also available as markdown: add .md to the URL.

BMKG earthquakes, 3-day weather forecasts, early weather warnings and air quality.

Weather forecasts are per village: use the village code (adm4) from the regions endpoints.

All endpoints need the x-api-key header (see Authentication) and return the standard envelope. A successful request costs 2 credits.

Endpoints on this page

Earthquakes

Realtime earthquake data sourced from BMKG, refreshed automatically every hour via cron.

GET /api/v1/gempa/terkini

Latest earthquakes. Returns the 15 most recent earthquakes, newest first.

curl "https://use.apiindonesia.id/api/v1/gempa/terkini" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "data": [
    {
      "id": "eq_20260702_0413",
      "datetime": "2026-07-02 04:13:21",
      "magnitude": 5.4,
      "depth_km": 10,
      "lat": -8.12,
      "lng": 110.34,
      "region": "Pacitan, Jawa Timur",
      "potential": "Tidak berpotensi tsunami",
      "is_felt": 1,
      "felt_areas": "III Yogyakarta, II-III Pacitan",
      "source": "BMKG"
    }
  ]
}

GET /api/v1/gempa/dirasakan

Felt earthquakes. Returns the 15 most recent felt earthquakes (BMKG term for quakes reported felt by the public), complete with the MMI scale per area.

curl "https://use.apiindonesia.id/api/v1/gempa/dirasakan" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "data": [
    {
      "id": "eq_20260702_0413",
      "datetime": "2026-07-02 04:13:21",
      "magnitude": 5.4,
      "depth_km": 10,
      "lat": -8.12,
      "lng": 110.34,
      "region": "Pacitan, Jawa Timur",
      "potential": "Tidak berpotensi tsunami",
      "is_felt": 1,
      "felt_areas": "III Yogyakarta, II-III Pacitan",
      "source": "BMKG"
    }
  ]
}

GET /api/v1/gempa/history

Earthquake history. Returns earthquakes within a given date range, up to 100 records, newest first.

ParameterInRequiredTypeDescription
startqueryyesstringStart date, YYYY-MM-DD format.
endqueryyesstringEnd date, YYYY-MM-DD format.
curl "https://use.apiindonesia.id/api/v1/gempa/history?start=2026-06-01&end=2026-06-30" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "data": [
    {
      "id": "eq_20260628_2205",
      "datetime": "2026-06-28 22:05:44",
      "magnitude": 4.8,
      "depth_km": 22,
      "lat": -3.51,
      "lng": 128.09,
      "region": "Ambon, Maluku",
      "potential": "Tidak berpotensi tsunami",
      "is_felt": 0,
      "felt_areas": null,
      "source": "BMKG"
    }
  ]
}

Weather Forecast

3-day weather forecast from BMKG for all villages across Indonesia. Data is fetched on demand and cached for 6 hours. Use the village code (adm4) from the Regions endpoint.

GET /api/v1/cuaca

Village weather forecast. Returns a 3-day weather forecast for a single village. Choose between adm4 (village code) or kabupaten_id to fetch a representative forecast for the regency.

ParameterInRequiredTypeDescription
adm4querynostringVillage code from the Regions endpoint, e.g. 32.73.01.1001.
kabupaten_idquerynostringRegency/city code (alternative to adm4), e.g. 3273.
curl "https://use.apiindonesia.id/api/v1/cuaca" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "data": [
    {
      "id": "w_327301100120260706010000",
      "adm4": "32.73.01.1001",
      "provinsi": "Jawa Barat",
      "kotkab": "Kota Bandung",
      "kecamatan": "Sukasari",
      "desa": "Isola",
      "datetime": "2026-07-06T01:00:00",
      "local_datetime": "2026-07-06 08:00:00",
      "weather": "Cerah",
      "weather_code": "0",
      "weather_desc": "Cerah Berawan",
      "weather_desc_en": "Partly Cloudy",
      "temperature_c": 29,
      "humidity_percent": 62,
      "cloud_cover_percent": 2,
      "precipitation_mm": 0,
      "wind_direction": "E",
      "wind_direction_to": "W",
      "wind_direction_degrees": 125,
      "wind_speed": 3.5,
      "visibility_m": 15060,
      "visibility_text": "> 10 km",
      "analysis_date": "2026-07-05T12:00:00",
      "source": "BMKG"
    }
  ]
}

Search forecast location. Searches for villages or cities that have weather forecast data by name. Returns a list of adm4 codes usable in the main endpoint.

ParameterInRequiredTypeDescription
qqueryyesstringSearch keyword, e.g. bandung.
curl "https://use.apiindonesia.id/api/v1/cuaca/search?q=bandung" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "data": [
    {
      "adm4": "32.73.01.1001",
      "provinsi": "Jawa Barat",
      "kotkab": "Kota Bandung",
      "kecamatan": "Sukasari",
      "desa": "Isola",
      "lat": -6.8593,
      "lng": 107.5921
    }
  ]
}

Weather Warnings

Extreme weather warnings from BMKG RSS/CAP. Data is refreshed hourly and refreshed on demand when the cache is empty.

GET /api/v1/peringatan-dini

List weather warnings. Returns all currently active weather warnings. Can be filtered by province name.

ParameterInRequiredTypeDescription
provinsiquerynostringFilter by province name, e.g. Jawa Barat.
curl "https://use.apiindonesia.id/api/v1/peringatan-dini" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "data": [
    {
      "id": "warn_2-49-0-1-360-0-2026-07-05-21-18-003",
      "alert_id": "2.49.0.1.360.0.2026.07.05.21.18.003",
      "event": "Hujan Lebat disertai Petir",
      "urgency": "Expected",
      "severity": "Moderate",
      "certainty": "Likely",
      "area": "Batanghari, Bumi Waras, Enggal",
      "province": "Lampung",
      "effective": "2026-07-05T21:00:00.000Z",
      "expires": "06 July 2026, 07:30 WIB",
      "headline": "Hujan Lebat disertai Petir di Lampung",
      "description": "Hujan lebat disertai petir akan terjadi...",
      "instruction": "Ikuti informasi resmi BMKG dan arahan petugas setempat.",
      "source": "BMKG-CAP",
      "is_active": 1
    }
  ]
}

Air Quality

List only readings cached today; city lookup returns the latest reading, which may be older.

GET /api/v1/kualitas-udara

Today cached readings. List may be empty.

curl "https://use.apiindonesia.id/api/v1/kualitas-udara" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "success": true,
  "data": []
}

GET /api/v1/kualitas-udara/{city}

Latest city reading. Substring city lookup; 404 when absent.

ParameterInRequiredTypeDescription
citypathyesstringCity name.
curl "https://use.apiindonesia.id/api/v1/kualitas-udara/Jakarta" \
  -H "x-api-key: YOUR_API_KEY"

Example response (shortened):

{
  "success": true,
  "data": {
    "city": "Jakarta",
    "aqi": 75,
    "source": "BMKG-CAMS",
    "cached_at": "2026-09-27 00:00:00"
  }
}