Flood Warning API Endpoint
GET https://api.data.gov.my/flood-warning
Source of Flood Warning Data
The Flood Warning API provides real-time information on water levels and flood warnings at monitoring stations around the country. These data are collected by the Department of Irrigation and Drainage. You can also access all the data from the Flood Warning API on The Official Web of Public Infobanjir (opens in a new tab).
Frequency of data update
The Flood Warning API data is updated every 15 minutes.
Request Query & Response Format
To filter and request data, use the standard filtering operations in the Request Query. For information on how the API responds to your requests, refer to the Response Format section.
Example Query
To fetch data from the Flood Warning API, use the following curl
command. Open your terminal and enter this command:
curl --location 'http://api.data.gov.my/flood-warning?limit=3'
Understanding the field values
Here is a table of all possible field names returned and the description of them.
Key | Type | Description | Example Value |
---|---|---|---|
station_id | string | Unique identifier for the monitoring station. | "26167" |
station_name | string | The name or description of the monitoring station. | "Sg. Anak Bukit di Jambatan TAR" |
latitude | float | The latitude coordinate of the monitoring station's location. | 6.123722 |
longitude | float | The longitude coordinate of the monitoring station's location. | 100.3599 |
district | string | The district where the monitoring station is located. | "Kota Setar" |
state | string | The state where the monitoring station is located. | "KEDAH" |
sub_basin | string | The sub-basin associated with the monitoring station. | "Sg. Anak Bukit" |
main_basin | string | The main basin associated with the monitoring station. | "Sungai Kedah" |
station_type | string | The type of the monitoring station, such as rain fall (RF ) or water level (WL ). Can contain both types. | "WL" |
water_level_current | float | The current water level at the station. | 1.73 |
water_level_indicator | string | An indicator of the water level condition, e.g., NORMAL , ALERT , WARNING , DANGER and ERROR . | "DANGER" |
water_level_normal_level | float | The normal level for the water level at the station. | 4.5 |
water_level_alert_level | float | The alert level for the water level at the station. | 7.5 |
water_level_danger_level | float | The danger level for the water level at the station. | 4.5 |
water_level_warning_level | float | The warning level for the water level at the station. | 1.7 |
water_level_increment | float | The increment or change in water level. | 0.03 |
water_level_update_datetime | datetime | The date and time when the water level information was last updated. | "2023-09-12 13:00:00" |
water_level_update_date | date | The date when the water level information was last updated. | "2023-09-12" |
water_level_trend | string | The trend of the water level, e.g., RISING , RECEDING or NO_CHANGE | "RISING" |
rainfall_clean | float | The clean (filtered) rainfall data, if available. | 1.3 |
rainfall_latest_1hr | float | The latest rainfall measurement for the past 1 hour, if available. | 2.3 |
rainfall_total_today | float | The total rainfall recorded for the current day, if available. | 3.1 |
rainfall_indicator | string | An indicator related to rainfall conditions, if available (e.g., NO_RAINFALL , LIGHT , MODERATE or ERROR ) | "LIGHT" |
rainfall_update_datetime | string | The date and time when the rainfall information was last updated, if available. | "2023-09-12 13:00:00" |
rainfall_update_date | string | The date when the rainfall information was last updated, if available. | "2023-09-12" |
water_level_display | string | The display value for water level, which may be different from the raw value. | "1" |
rainfall_display | string | The display value for rainfall, which may be different from the raw value, if available. | "0" |
raw_water_level | float | The raw, unprocessed water level measurement. | 1.73 |
raw_rainfall | float | The raw, unprocessed rainfall measurement, if available. | 1.3 |
station_status | string | The status of the monitoring station (e.g., ON or OFF ). | "ON" |
station_code | string | A unique code or identifier for the monitoring station. | "JAMBATANTAR" |
water_level_status | string | The status of the water level monitoring (e.g., ON , OFF or NA ) | "ON" |
rainfall_status | string | The status of rainfall monitoring, if available. (e.g., ON , OFF or NA ) | "ON" |
Note: A value of -9999
in the numeric fields indicates a service interruption or sensor malfunction at the time of measurement.