weather.php: Get weather data

API: gov.hk:hong-kong-obervatory
Endpoint: /weather.php
Response format: text/plain
Auth: unknown
Method: GET
Last Status: 200
Latency: 2111ms

Description

Retrieve various types of weather data including current weather report, local forecast, 9-day forecast, warnings, and special weather tips.

Parameters (2)

dataType (string, query, required)

Type of weather data to retrieve

Constraints: {'enum': ['rhrread', 'flw', 'fnd', 'warningInfo', 'swt']}

lang (string, query, optional, default: en)

Language for the response

Constraints: {'enum': ['en', 'tc', 'sc']}

Examples (1)

Get weather data probe-gate
curl 'https://data.weather.gov.hk/weatherAPI/opendata/weather.php?lang=en'
import requests

resp = requests.get(
    "https://data.weather.gov.hk/weatherAPI/opendata/weather.php",
    params={
        'lang': 'en',
    },
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("gov")
result = api.fetch("weather.php", lang="en")

for item in result:
    print(item)
const resp = await fetch("https://data.weather.gov.hk/weatherAPI/opendata/weather.php?lang=en");
const data = await resp.json();

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-04-16 00:33:20.217605 200 2111ms
2026-04-15 02:24:01.086329 200 1702ms
2026-04-14 01:23:01.260870 200 2506ms
2026-04-12 12:54:51.219377 200 1908ms
2026-04-10 02:00:33.280659 200 2640ms
2026-04-09 00:12:54.183530 200 2162ms
2026-03-27T12:34:13.577810 200 1387ms