Misc

Weather History

0calls
1 credits / call

Need to know whether it rained in a city over the past few days, or how much rainfall was recorded? This endpoint queries up to 366 days of daily historical weather.

GET
uapis.cn
/api/v1/misc/weather/history
Query parameters
6
city
string

City name in Chinese or English. Optional; when city/adcode are omitted, IP auto-location is attempted.

adcode
string

Six-digit administrative region code. Takes precedence over city.

start_date
string

Start date in YYYY-MM-DD format. Use together with end_date.

end_date
string

End date in YYYY-MM-DD format. Defaults to yesterday.

days
integer

Look-back days, 1-366. Defaults to 365 and only applies when start_date is not provided.

lang
string

Response language: zh (default) or en.

Overview

You can query by city, adcode, or let the system auto-locate by client IP. Use start_date + end_date for an explicit range, or days to look back a number of days. The response focuses on rained and rain, making it useful for travel reviews, agriculture records, weather dashboards, and data analysis.

Notes

Note

Location priority:adcode > city > IP auto-location. When both start_date and days are provided, the start_date + end_date range takes precedence.

Query parameters

city
stringoptional

City name in Chinese or English. Optional; when city/adcode are omitted, IP auto-location is attempted.

adcode
stringoptional

Six-digit administrative region code. Takes precedence over city.

start_date
stringoptional

Start date in YYYY-MM-DD format. Use together with end_date.

end_date
stringoptional

End date in YYYY-MM-DD format. Defaults to yesterday.

days
integeroptional

Look-back days, 1-366. Defaults to 365 and only applies when start_date is not provided.

lang
stringoptional

Response language: zh (default) or en.

Response

200 / OK

Returns daily historical weather for the city.

JSON
{
  "city": "Beijing",
  "adcode": "110000",
  "start_date": "2026-05-01",
  "end_date": "2026-05-31",
  "days": [
    {
      "date": "2026-05-01",
      "weather": "Light rain",
      "temp_max": 24,
      "temp_min": 15,
      "rained": true,
      "rain": 3.6
    }
  ]
}

400 / Bad Request

Invalid parameters, such as an invalid date format or lang not being zh/en.

404 / Not Found

Location was not found.

502 / Bad Gateway

Service temporarily unavailable. Please try again later.