Weather — entry 011 of 31
Hong Kong Observatory
The Hong Kong Observatory's Open Data API exposes roughly 50 machine-readable datasets covering real-time weather observations, 9-day forecasts, lightning counts, tropical cyclone tracking, tidal predictions, UV index and radiation levels, plus historical rainfall and sunshine records, for Hong Kong and nearby waters. It is a free, keyless service built for machine-to-machine consumption, mirrored on the government's data.gov.hk portal alongside the Observatory's own documented endpoint.
The Hong Kong Observatory's Open Data API is a single `weather.php` endpoint whose `dataType` query parameter selects which of its ~50 datasets to return — `rhrread` bundles the current rainfall, temperature, humidity, UV index, and weather-icon snapshot in one call.
GreatAPIs Score
Auth quickstart
- No API key required — requests are public and keyless.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Current weather snapshot for Hong Kong (rhrread)
GEThttps://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang=en
{
"rainfall": {
"data": [
{ "unit": "mm", "place": "Central & Western District", "max": 5, "min": 1, "main": "FALSE" },
{ "unit": "mm", "place": "Eastern District", "max": 8, "min": 5, "main": "FALSE" },
{ "...": "16 more districts, same shape" }
],
"startTime": "2026-07-26T09:45:00+08:00",
"endTime": "2026-07-26T10:45:00+08:00"
},
"rainstormReminder": "Though rainstorm warning has been cancelled, people should stay alert to the danger that may be brought about by river flooding.",
"icon": [63],
"iconUpdateTime": "2026-07-26T10:45:00+08:00",
"uvindex": {
"data": [{ "place": "King's Park", "value": 0.7, "desc": "low" }],
"recordDesc": "During the past hour"
},
"updateTime": "2026-07-26T11:02:00+08:00",
"temperature": {
"data": [
{ "place": "King's Park", "value": 25, "unit": "C" },
{ "place": "Hong Kong Observatory", "value": 26, "unit": "C" },
{ "...": "24 more stations, same shape" }
],
"recordTime": "2026-07-26T11:00:00+08:00"
},
"humidity": {
"recordTime": "2026-07-26T11:00:00+08:00",
"data": [{ "unit": "percent", "value": 89, "place": "Hong Kong Observatory" }]
}
}Developer reference
https://data.weather.gov.hk/weatherAPI/opendataGotchas & limits
- An invalid or missing `dataType` still returns HTTP 200, not a 4xx — the body becomes a plain-text, tri-lingual error message pointing at the docs PDF, so check the body content rather than the status code to detect a bad request
- `rainfall.data[].main` is the literal string `"TRUE"`/`"FALSE"` (marking the citywide-representative station), not a JSON boolean — compare it as a string
- `icon` returns bare numeric weather-icon codes (e.g. `63`) with no accompanying text; the code-to-description mapping only exists in the docs PDF, not in this response
- `lang` defaults to English when omitted, not Chinese — confirmed live by dropping the parameter entirely from a `dataType=fnd` (9-day forecast) request