Weather — entry 011 of 31

Hong Kong Observatory

Verified Jul 2026

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.

forecastgovernmentalertsno-key
AuthenticationNone requiredCall it straight away — no key, no signup.
HTTPSSupportedTraffic is encrypted in transit.
CORSEnabledCallable directly from browser JavaScript.
PricingFreeNo paid tier — free for the documented use case.
FormatsJSON, XML, CSVResponses can be requested as JSON or XML or CSV.

GreatAPIs Score

Score94out of 100
Authentication25/25No authentication required
Pricing20/20Free to use
Docs14/20Documentation URL provided
Formats15/15Supports 3 response formats
Freshness20/20Verified within 6 months

Embed this badge

Scored 94 on greatapis.com
<a href="https://greatapis.com/api/hong-kong-obervatory/"><img src="https://greatapis.com/badge/hong-kong-obervatory.svg" alt="Scored 94 on greatapis.com"></a>

Auth quickstart

  1. No API key required — requests are public and keyless.
Stored keyNo key stored

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

200 application/json; charset=utf-8

{
  "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

Base URLhttps://data.weather.gov.hk/weatherAPI/opendata

Gotchas & 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