Get Started
SIDARMA API provides BMKG weather radar product that compatible to be displayed in web GIS using leaflet or other library.
To use this API, you need an API token. Please register at Registration Form to get your own API token.
Radar Image (.png)
To get weather radar images you need to make a GET call to the following url :
https://radar.bmkg.go.id:8090/sidarmaimage
The output (json format) also contains the legend of the image in colors order.
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
token | String | Your API token. |
radar | String | BMKG weather radar site ID. See all BMKG weather radar ID at here. See at key kode. |
product | String | (optional) If product is not set, the default value is CMAX product. |
EXAMPLE
// Example displaying Batam Weather Radar (weather radar id is BTH) with laefletjs using L.imageOverlay var radarID = 'BTH' var token = 'your token' var urlImage='https://radar.bmkg.go.id:8090/sidarmaimage?'+'token='+token+'&radar='+radarID function getAPI(url){ var value= $.ajax({ url: url, async: false, dataType:'json' }).responseJSON; return value; } var result = getAPI(urlImage); var latestImage = result.Latest.file var latLngBounds = L.latLngBounds([result.bounds.overlayBRC, result.bounds.overlayTLC]); var imageOverlay = L.imageOverlay(latestImage, latLngBounds, { opacity: 0.8, interactive: true }) var osm=L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }); var map = new L.map('map',{ zoomControl: false, zoom:5, center: new L.latLng(-0.251250,118.944833), layers: osm }); imageOverlay.addTo(map); map.fitBounds(latLngBounds);
Web Map Service (WMS)
To get weather radar images you need to make a GET call to the following url :
https://radar.bmkg.go.id:8090/sidarmawms
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
token | String | Your API token. |
radar | String | BMKG weather radar site. See all BMKG weather radar network at here |
product | String | (optional) If product is not set, the default value is CMAX product. |
EXAMPLE
// Example displaying Batam Weather Radar (weather radar id is BTH) with laefletjs using L.tileLayer.wms var radarID = 'BTH' var token = 'your token' var urlWMS='https://radar.bmkg.go.id:8090/sidarmawms?'+'token='+token+'&radar='+radarID function getAPI(url){ var value= $.ajax({ url: url, async: false, dataType:'json' }).responseJSON; return value; } var wmsOption=getAPI(urlWMS); var wmsRadar = L.tileLayer.wms(wmsOption.urlWMS, { layers: wmsOption.layer, format: 'image/png', transparent: true, version: '1.1.0', attribution: "myattribution", styles:'CMAX_dBZ' }).addTo(map);
Storm Detection
SIDARMA also provide API for storm detection and prediction product.
The algorithm used are SSA (Storm Structure Analysis) and TITAN (Thunderstorm Identification Tracking Analysis and Nowcasting).
The API output is geojson format. To get storm polygon and its properties, you need to make a GET call to the following url :
https://radar.bmkg.go.id:8090/sidarmastorm
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
token | String | Your API token. |
radar | String | BMKG weather radar site ID. See all BMKG weather radar ID at here. See at key kode. |
algorithm | String | It must be ssa or titan |
SSA EXAMPLE
// Example displaying SSA using leflet L.geoJson // You can add pop up onEachFeature (see https://leafletjs.com/examples/geojson/) function styleSSA(feature){ return {color : "#000000"} }; var radarID = 'BAL' var token = '19387e71e78522ae4172ec0fda640983b8438c9cfa0ca571623cb69d8327' var algorithm = 'ssa' var urlStorm='https://radar.bmkg.go.id:8090/sidarmastorm?'+'token='+token+'&radar='+radarID+'&algorithm='+algorithm function getAPISSA(url){ var value= $.ajax({ url: url, async: false, dataType:'json' }).responseJSON; return value; } var resultSSA = getAPISSA(urlStorm); var ssaLayer=L.geoJson(resultSSA,{ style:styleSSA, zIndex:100 }).addTo(map);
TITAN EXAMPLE
// Example displaying TITAN using leflet L.geoJson // You can add pop up onEachFeature (see https://leafletjs.com/examples/geojson/) function styleTITAN(feature){ switch (feature.properties.description){ case 'History' : return {color : "#228B22"}; case 'Current' : return {color : "#000000"}; case 'Forecast': return {color : "#ff0000"} } }; var radarID = 'BAL' var token = '19387e71e78522ae4172ec0fda640983b8438c9cfa0ca571623cb69d8327' var algorithm = 'titan' var urlStorm='https://radar.bmkg.go.id:8090/sidarmastorm?'+'token='+token+'&radar='+radarID+'&algorithm='+algorithm function getAPISSA(url){ var value= $.ajax({ url: url, async: false, dataType:'json' }).responseJSON; return value; } var forecast30minLayer=L.layerGroup(); var forecast60minLayer=L.layerGroup(); var vectorLayer=L.layerGroup(); var currentLayer=L.layerGroup(); var resultTITAN = getAPISSA(urlStorm); var titanLayer=L.geoJson(resultTITAN,{ style:styleTITAN, zIndex:100 }).addTo(map);