Free REST API for Indonesian weather forecasts, earthquake data, weather warnings, and region lookup from BMKG.
๐ Demo: https://bmkg-restapi.vercel.app
This is a demo/public instance with rate limits (30 requests/minute) to ensure fair usage.
For production use with unlimited requests, please self-host.
- ๐ Earthquake Data โ Latest, recent (M 5.0+), felt earthquakes, nearby search by coordinates
- ๐ค๏ธ Weather Forecast โ 3-day forecasts & current weather for any kelurahan/desa in Indonesia
โ ๏ธ Weather Warnings (Nowcast) โ Real-time severe weather alerts with affected area polygons- ๐ Region Lookup โ Indonesian provinces, districts, subdistricts, villages, plus search
- ๐ Auto-generated Docs โ Interactive API documentation at
/docs - โก Caching โ Fast responses with in-memory cache (configurable TTL)
- ๐ CORS Enabled โ Use from any frontend
- ๐ No API Key Required โ Simple, anonymous access
- ๐ Rate Limit Headers โ
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reseton every response - ๐ณ Docker & GHCR โ Automated multi-arch Docker images published to GitHub Container Registry
- ๐ค MCP Server โ Model Context Protocol for AI assistants (Claude, Cursor, etc.)
# Latest earthquake
curl https://bmkg-restapi.vercel.app/v1/earthquake/latest
# Weather forecast for Pejaten Barat, Pasar Minggu, Jakarta Selatan
curl https://bmkg-restapi.vercel.app/v1/weather/31.74.04.1006
# Current weather
curl https://bmkg-restapi.vercel.app/v1/weather/31.74.04.1006/current
# Active weather warnings
curl https://bmkg-restapi.vercel.app/v1/nowcast
# Search regions
curl https://bmkg-restapi.vercel.app/v1/wilayah/search?q=tebet| Endpoint | Description |
|---|---|
GET /v1/earthquake/latest |
Latest earthquake |
GET /v1/earthquake/recent |
Recent earthquakes (M 5.0+) |
GET /v1/earthquake/felt |
Felt earthquakes |
GET /v1/earthquake/nearby?lat=&lon=&radius_km= |
Nearby earthquakes |
| Endpoint | Description |
|---|---|
GET /v1/weather/{adm4_code} |
3-day forecast for a kelurahan/desa |
GET /v1/weather/{adm4_code}/current |
Current weather for a kelurahan/desa |
| Endpoint | Description |
|---|---|
GET /v1/nowcast |
Active weather warnings by province |
GET /v1/nowcast/{alert_code} |
Warning detail with affected area polygons |
GET /v1/nowcast/check?location= |
Check warnings for a specific location |
| Endpoint | Description |
|---|---|
GET /v1/wilayah/provinces |
List provinces |
GET /v1/wilayah/districts?province_code= |
List districts |
GET /v1/wilayah/subdistricts?district_code= |
List subdistricts |
GET /v1/wilayah/villages?subdistrict_code= |
List villages |
GET /v1/wilayah/search?q={query} |
Search regions |
Full documentation: https://bmkg-restapi.vercel.app/docs
Use BMKG data directly in Claude Desktop, Cursor, VS Code, Windsurf, Zed, and other MCP-compatible AI assistants.
We support two deployment modes:
๐ Option A: HTTP Transport (No Installation Required)
- Connect via Smithery or HTTP-compatible MCP clients
- No local installation needed
- Best for: Web IDEs, cloud environments
๐ป Option B: Stdio Transport (Local Install)
- Install via pipx/pip and run locally
- Best for: Claude Desktop, Cursor, local development
Smithery (smithery.ai) - Easiest:
- Go to https://smithery.ai
- Search for "bmkg-api-mcp" or visit direct link
- Click "Add to Client"
- Done! No installation required.
Manual HTTP Configuration:
For MCP clients that support Streamable HTTP transport:
Claude Code:
claude mcp add --transport http bmkg-api https://mcp-bmkg.dhanypedia.it.com/mcpClaude Desktop (Settings โ MCP):
{
"mcpServers": {
"bmkg-api": {
"url": "https://mcp-bmkg.dhanypedia.it.com/mcp"
}
}
}Cursor (Settings โ MCP Servers):
- Click "Add New MCP Server"
- Name:
bmkg-api - Type:
http - URL:
https://mcp-bmkg.dhanypedia.it.com/mcp
VS Code (Cline/Roo Code):
{
"mcpServers": {
"bmkg-api": {
"url": "https://mcp-bmkg.dhanypedia.it.com/mcp",
"disabled": false,
"autoApprove": []
}
}
}Windsurf:
- Open Cascade โ MCP Servers
- Click "+ Add Custom Server"
- Select "HTTP Transport"
- Enter URL:
https://mcp-bmkg.dhanypedia.it.com/mcp
# Via pipx (recommended)
pipx install bmkg-api-mcp
# Via pip
pip install bmkg-api-mcpClaude Desktop:
# Edit config file
nano ~/Library/Application\ Support/Claude/claude_desktop_config.jsonAdd this to your config:
{
"mcpServers": {
"bmkg-api": {
"command": "bmkg-api-mcp"
}
}
}Cursor:
- Open Settings โ Features โ MCP Servers
- Click "Add New MCP Server"
- Name:
bmkg-api, Type:command, Command:bmkg-api-mcp
VS Code (Cline/Roo Code):
{
"mcpServers": {
"bmkg-api": {
"command": "bmkg-api-mcp",
"disabled": false,
"autoApprove": []
}
}
}| Category | Tools |
|---|---|
| ๐ Earthquake | get_latest_earthquake, get_recent_earthquakes, get_felt_earthquakes, get_nearby_earthquakes |
| ๐ค๏ธ Weather | get_weather_forecast, get_current_weather |
get_weather_warnings, check_location_warnings |
|
| ๐ Region | search_regions, get_provinces, get_districts, get_subdistricts, get_villages |
| ๐ง Utility | get_cache_stats, debug_ping |
Try these natural language queries in your AI assistant:
"Gempa terbaru di Indonesia berapa magnitudenya?"
"Cuaca 3 hari ke depan di Jakarta Selatan?"
"Cari kode wilayah untuk Kelapa Gading"
"Ada peringatan cuaca ekstrem di Yogyakarta?"
"Gempa dengan magnitud di atas 5 derajat minggu ini?"
"Bandung ada gempa dekat-dekat sini?"
- โก Caching โ Smart TTL-based caching for optimal performance
- ๐ Debug Mode โ Run
bmkg-api-mcp --debugfor verbose logging - ๐ 7 Specialized Prompts โ Earthquake, weather, region, emergency, travel, research, and daily briefing assistants
๐ Full Setup Guide: See MCP_SETUP.md for detailed configuration for all supported IDEs.
# Pull from GitHub Container Registry
docker pull ghcr.io/dhanyyudi/bmkg-api:latest
# Or build and run with Docker Compose
git clone https://github.com/dhanyyudi/bmkg-api.git
cd bmkg-api
docker-compose up -dgit clone https://github.com/dhanyyudi/bmkg-api.git
cd bmkg-api
make setup
source venv/bin/activate
make dev # starts server on http://localhost:8099Deploy to Vercel with one click โ the api/index.py and vercel.json are pre-configured.
See Self-Hosting Guide for detailed instructions.
Available on the landing page for: cURL, JavaScript, Python, Go, PHP, Ruby, and Dart (Flutter).
API REST gratis untuk prakiraan cuaca, data gempa bumi, peringatan cuaca, dan pencarian wilayah Indonesia dari BMKG.
๐ Demo: https://bmkg-restapi.vercel.app
Ini adalah instance demo/publik dengan batasan rate limit (30 request/menit).
Untuk penggunaan produksi dengan request tanpa batas, silakan self-host.
- ๐ Data Gempa โ Gempa terbaru, terkini (M 5.0+), dirasakan, pencarian radius
- ๐ค๏ธ Prakiraan Cuaca โ 3 hari & cuaca saat ini untuk lokasi mana pun di Indonesia
โ ๏ธ Peringatan Cuaca (Nowcast) โ Peringatan dini real-time dengan poligon area terdampak- ๐ Pencarian Wilayah โ Provinsi, kabupaten, kecamatan, desa, plus pencarian
- ๐ Dokumentasi Auto โ Dokumentasi API interaktif di
/docs - โก Caching โ Response cepat dengan cache lokal (TTL bisa dikonfigurasi)
- ๐ CORS Enabled โ Bisa dipakai dari frontend mana saja
- ๐ Tanpa API Key โ Akses sederhana dan anonim
- ๐ Rate Limit Headers โ
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Resetdi setiap response - ๐ณ Docker & GHCR โ Image Docker multi-arsitektur otomatis di GitHub Container Registry
- ๐ค MCP Server โ Model Context Protocol untuk AI assistants (Claude, Cursor, dll)
# Gempa terbaru
curl https://bmkg-restapi.vercel.app/v1/earthquake/latest
# Prakiraan cuaca Pejaten Barat, Pasar Minggu, Jakarta Selatan
curl https://bmkg-restapi.vercel.app/v1/weather/31.74.04.1006
# Cuaca saat ini
curl https://bmkg-restapi.vercel.app/v1/weather/31.74.04.1006/current
# Peringatan cuaca aktif
curl https://bmkg-restapi.vercel.app/v1/nowcast
# Cari wilayah
curl https://bmkg-restapi.vercel.app/v1/wilayah/search?q=wiradesa| Endpoint | Deskripsi |
|---|---|
GET /v1/earthquake/latest |
Gempa terbaru |
GET /v1/earthquake/recent |
Gempa terkini (M 5.0+) |
GET /v1/earthquake/felt |
Gempa dirasakan |
GET /v1/earthquake/nearby?lat=&lon=&radius_km= |
Gempa terdekat |
| Endpoint | Deskripsi |
|---|---|
GET /v1/weather/{adm4_code} |
Prakiraan 3 hari |
GET /v1/weather/{adm4_code}/current |
Cuaca saat ini |
| Endpoint | Deskripsi |
|---|---|
GET /v1/nowcast |
Peringatan cuaca aktif per provinsi |
GET /v1/nowcast/{alert_code} |
Detail peringatan dengan poligon area |
GET /v1/nowcast/check?location= |
Cek peringatan untuk lokasi tertentu |
| Endpoint | Deskripsi |
|---|---|
GET /v1/wilayah/provinces |
Daftar provinsi |
GET /v1/wilayah/districts?province_code= |
Daftar kabupaten/kota |
GET /v1/wilayah/subdistricts?district_code= |
Daftar kecamatan |
GET /v1/wilayah/villages?subdistrict_code= |
Daftar desa/kelurahan |
GET /v1/wilayah/search?q={query} |
Cari wilayah |
Dokumentasi lengkap: https://bmkg-restapi.vercel.app/docs
Gunakan data BMKG langsung di Claude Desktop, Cursor, VS Code, Windsurf, Zed, dan AI assistants lain yang kompatibel dengan MCP.
# Via pipx (direkomendasikan)
pipx install bmkg-api-mcp
# Via pip
pip install bmkg-api-mcpClaude Desktop:
# Edit file config
nano ~/Library/Application\ Support/Claude/claude_desktop_config.jsonTambahkan ke config:
{
"mcpServers": {
"bmkg-api": {
"command": "bmkg-api-mcp"
}
}
}Cursor:
- Buka Settings โ Features โ MCP Servers
- Klik "Add New MCP Server"
- Name:
bmkg-api, Type:command, Command:bmkg-api-mcp
VS Code (Cline/Roo Code):
{
"mcpServers": {
"bmkg-api": {
"command": "bmkg-api-mcp",
"disabled": false,
"autoApprove": []
}
}
}| Kategori | Tools |
|---|---|
| ๐ Gempa | get_latest_earthquake, get_recent_earthquakes, get_felt_earthquakes, get_nearby_earthquakes |
| ๐ค๏ธ Cuaca | get_weather_forecast, get_current_weather |
get_weather_warnings, check_location_warnings |
|
| ๐ Wilayah | search_regions, get_provinces, get_districts, get_subdistricts, get_villages |
| ๐ง Utility | get_cache_stats, debug_ping |
Coba query bahasa alami ini di AI assistant Anda:
"Gempa terbaru di Indonesia berapa magnitudenya?"
"Cuaca 3 hari ke depan di Jakarta Selatan?"
"Cari kode wilayah untuk Kelapa Gading"
"Ada peringatan cuaca ekstrem di Yogyakarta?"
"Gempa dengan magnitud di atas 5 derajat minggu ini?"
"Bandung ada gempa dekat-dekat sini?"
- โก Caching โ Caching cerdas dengan TTL untuk performa optimal
- ๐ Debug Mode โ Jalankan
bmkg-api-mcp --debuguntuk logging detail - ๐ 7 Prompt Spesialis โ Asisten gempa, cuaca, wilayah, darurat, travel, riset, dan briefing harian
๐ Panduan Lengkap: Lihat MCP_SETUP.md untuk konfigurasi detail semua IDE yang didukung.
# Pull dari GitHub Container Registry
docker pull ghcr.io/dhanyyudi/bmkg-api:latest
# Atau build dan jalankan dengan Docker Compose
git clone https://github.com/dhanyyudi/bmkg-api.git
cd bmkg-api
docker-compose up -dgit clone https://github.com/dhanyyudi/bmkg-api.git
cd bmkg-api
make setup
source venv/bin/activate
make dev # jalankan server di http://localhost:8099Deploy ke Vercel โ api/index.py dan vercel.json sudah dikonfigurasi.
Lihat Panduan Self-Hosting untuk detail.
Tersedia di halaman utama untuk: cURL, JavaScript, Python, Go, PHP, Ruby, dan Dart (Flutter).
All data is sourced from BMKG (Badan Meteorologi, Klimatologi, dan Geofisika).
This API is not affiliated with BMKG. All data belongs to BMKG.
MIT License โ see LICENSE
Built with โค๏ธ by dhanypedia