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.

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

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

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.