Rainfall
These endpoints serve accumulated rainfall from Central Weather Administration (CWA) rain gauges, for 10 minutes, 1 hour, and on through 3 days. A new snapshot arrives about every 10 minutes and is kept for 3 days. There is also a rainfall trend for one station over the last 24 hours or 7 days. Use them for rainfall maps, heavy-rain rankings, and rainfall charts. The shared format (columnar snapshots, delta-encoded time lists, and which server to call) is in the Weather API.
Data license
Section titled “Data license”AttributionData: Central Weather Administration (CWA), ExpTech Studio (exptech.dev)
- Central Weather Administration (CWA): CWA's own data terms (such as the Open Government Data License) also apply; CWA's official releases take precedence.
Where to show it, examples and commercial-use requests: Data licensing and attribution.
Authentication
Section titled “Authentication”No API Token is required.
Station catalog
Section titled “Station catalog”Station id to name, county or city, township, elevation, and coordinates. The format matches the weather station catalog.
curl "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/station"const res = await fetch("https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/station");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/station", timeout=10,)res.raise_for_status()print(res.json())Success
{ "C0TB40": { "n": "崇德", "c": "花蓮縣", "t": "秀林鄉", "alt": 8, "lat": 24.1661, "lon": 121.6574 }, "C0SD20": { "n": "富山", "c": "臺東縣", "t": "卑南鄉", "alt": 21, "lat": 22.8224, "lon": 121.1908 }}Not modified (If-None-Match matched). No bodyNo response body
Try it
Response fields
Section titled “Response fields”The response is an object. Each key is a station id.
| Field | Type | Description |
|---|---|---|
{站號}.n | string | Station name |
{站號}.c | string | County or city |
{站號}.t | string | Township, town, or district |
{站號}.alt | number | Elevation (m) |
{站號}.lat | number | Latitude, 4 decimal places |
{站號}.lon | number | Longitude, 4 decimal places |
The catalog is taken from the latest snapshot, so it lists only the stations in that snapshot (see Notes). When there is no data yet, the response is {}.
Latest rainfall
Section titled “Latest rainfall”The latest rainfall snapshot, in columnar form: each field is an array, aligned with ids by index.
curl "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain"const res = await fetch("https://api.core-tnn1.exptech.dev/api/v5/meteor/rain");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get("https://api.core-tnn1.exptech.dev/api/v5/meteor/rain", timeout=10)res.raise_for_status()print(res.json())Success
{ "time": 1794635400, "ids": [ "C0TB40", "C0SD20" ], "now": [ 12.5, 0 ], "10m": [ 1.5, 0 ], "1h": [ 6, 0 ], "3h": [ 11, 0 ], "6h": [ 12.5, 0 ], "12h": [ 20, 0 ], "24h": [ 48.5, 0.5 ], "2d": [ 52, 0.5 ], "3d": [ 52, 3 ]}Not modified (If-None-Match matched). No bodyNo response body
Try it
Response fields
Section titled “Response fields”Rainfall is in mm, to 1 decimal place.
| Field | Type | Description |
|---|---|---|
time | number | Observation time, Unix seconds |
ids | string[] | Station ids. Every other array follows this order |
now | number[] | Rainfall accumulated for the day (as defined in the CWA data) |
10m | number[] | Rainfall accumulated over the past 10 minutes |
1h | number[] | Rainfall accumulated over the past 1 hour |
3h | number[] | Rainfall accumulated over the past 3 hours |
6h | number[] | Rainfall accumulated over the past 6 hours |
12h | number[] | Rainfall accumulated over the past 12 hours |
24h | number[] | Rainfall accumulated over the past 24 hours |
2d | number[] | Rainfall accumulated over the past 2 days |
3d | number[] | Rainfall accumulated over the past 3 days |
Values are passed through from the source. Rainfall is never negative. Any negative value (often -99) means there is no valid observation. When there is no data yet, the response is {}.
Snapshot times
Section titled “Snapshot times”Rainfall snapshot times you can query now, as delta-encoded Unix seconds, oldest first. See Delta-encoded time lists for how to decode them.
curl "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/list"const res = await fetch("https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/list");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/list", timeout=10,)res.raise_for_status()print(res.json())Success
[ 1794376800, 600, 600, 600]Not modified (If-None-Match matched). No bodyNo response body
Try it
Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
[0] | number | Time of the oldest snapshot, in Unix seconds |
[i](i ≥ 1) | number | Gap from the previous time, in seconds |
When there are no snapshots, the response is [].
Rainfall at a time
Section titled “Rainfall at a time”The rainfall snapshot at a chosen time. The structure matches Latest rainfall. It is served only on static.core. api.core returns 404 for this path.
timePath parameter. Snapshot time, a 10-digit Unix timestamp in seconds. It must be a value that appeared in /list
curl "https://static.core-tnn1.exptech.dev/api/v5/meteor/rain/<time>"const res = await fetch("https://static.core-tnn1.exptech.dev/api/v5/meteor/rain/<time>");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://static.core-tnn1.exptech.dev/api/v5/meteor/rain/<time>", timeout=10,)res.raise_for_status()print(res.json())Success. Same structure as the latest rainfall
{ "time": 1794634800, "ids": [ "C0TB40" ], "now": [ 11 ], "10m": [ 2 ], "1h": [ 5.5 ], "3h": [ 9.5 ], "6h": [ 11 ], "12h": [ 18.5 ], "24h": [ 47 ], "2d": [ 50.5 ], "3d": [ 50.5 ]}Not modified (If-None-Match matched). No bodyNo response body
time is not an integer, or there is no snapshot at that time (including past the retention window). No bodyNo response body
Try it
Response fields
Section titled “Response fields”Same response fields as Latest rainfall.
Station rainfall trend
Section titled “Station rainfall trend”The series of “rainfall over the past 1 hour” for one rain gauge, for the last 24 hours or 7 days. Use it to draw a rainfall chart.
idPath parameter. Station id, for example C0TB40
rangeQuery parameter. Only the literal 7d returns 7 days. Any other value, or omitting it, is 24h
curl "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/trend/<id>"const res = await fetch("https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/trend/<id>");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://api.core-tnn1.exptech.dev/api/v5/meteor/rain/trend/<id>", timeout=10,)res.raise_for_status()print(res.json())Success
{ "id": "C0TB40", "range": "24h", "ts": [ 1794549600, 600, 600 ], "rain": [ 0, 0.5, 1 ]}Not modified (If-None-Match matched). No bodyNo response body
This station id has no data points in the range. No bodyNo response body
Try it
Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
id | string | Station id |
range | string | Range actually used: 24h or 7d |
ts | number[] | Data-point times, delta-encoded Unix seconds |
rain | number[] | Rainfall accumulated over the past 1 hour at each time (mm) |
24h: every snapshot in the last 24 hours in which this station appears (about one point every 10 minutes).tsis the observation time.7d: one point per hour for the last 7 days.tsis the top of that hour. The value is the last observation in that hour, close to the rainfall accumulated for that hour.
- Every time is Unix seconds.
- Each snapshot includes only stations whose observation time is exactly that moment. Observation times in the source data do not always match across stations, so one snapshot can contain fewer stations than the full set. When you need the latest value at every station, merge the last few snapshots from oldest to newest.
- Snapshots are kept for 3 days. The 7-day trend comes from a separate hourly rollup.
- Source: rainfall observations in CWA open data.
- Which server to call is in the Weather API. Timestamp snapshots go to
static.core. Everything else goes toapi.core. Use the TNN-1 URLs directly.
