Should you be worried today?

Water, heat, rain and typhoon risks for your barangay, in plain words.

Open tubig.rjhon.net

API

The history as JSON, free to reuse with credit to its sources.

Start here

Every endpoint answers a plain GET, needs no key, and returns JSON. The list of endpoints is itself an endpoint:

curl "https://tubig-api.rjhon.net/v1/history"

Endpoints

EndpointWhat it returns
/v1/history/interruptionsMaynilad interruption notices, kept after they end
/v1/history/damsDams with their thresholds and latest reading
/v1/history/dams/{dam}/readingsEvery reading kept for one dam
/v1/history/cyclone-alertsPAGASA's cyclone alerts, read and rated for Metro Manila
/v1/history/cyclone-statusEach change on PAGASA's cyclone page
/v1/history/flood-advisoriesPAGASA's General Flood Advisories
/v1/history/riversRiver gauges with their alert, alarm and critical levels
/v1/history/rivers/{code}/readingsEvery reading kept for one river gauge
/v1/history/rain-gaugesRain gauges
/v1/history/rain-gauges/{code}/readingsEvery reading kept for one rain gauge
/v1/history/droughtPAGASA's latest drought outlook and assessment, every province
/v1/history/ensoNOAA's Oceanic Niño Index or weekly Niño 3.4 anomaly
/v1/history/enso-statementsPAGASA's ENSO advisories and outlooks

How it works

Limits
5 calls a minute per visitor, and at most 500 items a call. Over the limit you get 429 with a Retry-After header in seconds. Short bursts are also limited at the edge.
Paging
Lists are newest first. Ask for up to 500 with limit, then follow next until it is null. The cursor in next is opaque: pass it back as it is.
Times
Times are UTC in ISO 8601. The from and to filters are Manila dates (YYYY-MM-DD), from 2000 to 2100.
Errors
404 for an unknown dam or gauge, 422 for a parameter out of range (the body says which), 429 over the limit.
From a website
Readable from any site: responses carry Access-Control-Allow-Origin: *, errors included. Plain GETs only, no credentials.
Freshness
Responses may be cached for up to 2 minutes. Sources are read every 10 minutes (river and rain gauges) to once a day (dams, drought).
Privacy
Nothing about who uses Tubig or where: no cities, barangays or places in use. Cyclone alerts are rated for Metro Manila.

Credit and licences

Each response lists its sources. Credit them when you reuse the data.