Discover/weather.com.cn API
live

weather.com.cn APIweather.com.cn

Access real-time weather, 7–40 day forecasts, AQI rankings, hourly observations, and active alerts for any Chinese city via the weather.com.cn API.

Endpoints
8
Updated
3mo ago
Try it
City name to search for, in Chinese characters or pinyin (e.g. '北京', 'shanghai').
api.parse.bot/scraper/91fc294e-bc9f-47ba-b48e-d6ab94bebab7/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/91fc294e-bc9f-47ba-b48e-d6ab94bebab7/search_city_weather?query=%E4%B8%8A%E6%B5%B7' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 8 totalclick to expand

Search for a city by name to find its city code. Returns matching cities, districts, and scenic spots. Use the returned city_code in other endpoints.

Input
ParamTypeDescription
queryrequiredstringCity name to search for, in Chinese characters or pinyin (e.g. '北京', 'shanghai').
Response
{
  "type": "object",
  "fields": {
    "results": "array of city objects each containing city_code, pinyin, city_name, en_name, district, province, full_info"
  },
  "sample": {
    "data": {
      "results": [
        {
          "pinyin": "shanghai",
          "en_name": "Shanghai",
          "district": "上海",
          "province": "上海",
          "city_code": "101020100",
          "city_name": "上海",
          "full_info": "101020100~shanghai~上海~Shanghai~上海~Shanghai~21~200000~SH~上海"
        }
      ]
    },
    "status": "success"
  }
}

About the weather.com.cn API

The weather.com.cn API provides 8 endpoints covering real-time conditions, multi-range forecasts (7-day, 15-day, 40-day), hourly observations, air quality rankings, and nationwide weather alerts for cities across China. Start with search_city_weather to resolve a city name or pinyin string into the 9-digit city code required by every other endpoint, then pull station-level temperature, humidity, wind, and AQI alongside daily life indices like UV, comfort, and clothing recommendations.

City Resolution and Real-Time Conditions

Every data request in this API is keyed on a 9-digit city_code. Use search_city_weather with a Chinese-character name or pinyin string (e.g. '北京' or 'shanghai') to get back matching cities, districts, and scenic spots, each with city_code, pinyin, city_name, en_name, district, and province fields. Once you have a code, get_current_weather returns five response objects: dataSK (real-time station observations: temp, humidity, wind, AQI), dataZS (daily life indices: comfort, UV, clothing, travel), cityDZ (today's brief forecast and any active alarm info), fc (short-range daily forecast array), and sk_detailed (extended station data).

Forecast Ranges

get_forecast_7day returns a 5–7 day array where each object carries fa (day weather code), fb (night weather code), fc (high temp), fd (low temp), and wind fields. get_forecast_15day extends this to 15 days and adds sunrise/sunset times and lunar calendar dates encoded under numeric keys (001 for day weather code, 003/004 for high/low temps, 009 for date in YYYYMMDD format). get_forecast_40day produces a calendar array covering up to 40 days and includes historical average highs/lows (hmax/hmin), lunar day (nl), almanac data (nlyf), and both observed and forecast temperatures — useful for agricultural or travel planning tools that need longer-horizon context.

Hourly Observations and Air Quality

get_hourly_observations returns up to 24 hours of station records under observations_24h.od.od2, with per-hour fields od21 (hour), od22 (temp), od23 (wind speed), od24 (wind direction), and AQI. get_air_quality requires no inputs and returns national AQI rankings split into four arrays: af (best air quality cities), ab (worst), p10 (ranked by PM10), and p25 (ranked by PM2.5). Each entry includes a (city_code), n (name), p (province), and v (AQI value). get_weather_alerts also requires no inputs and returns all currently active nationwide alerts as an array of entries with location name, alert ID, and longitude, plus a count field.

Coverage Scope

All endpoints are scoped to mainland China cities, districts, and scenic spots indexed by weather.com.cn. The city search covers Chinese-character input and pinyin, but results are limited to locations that weather.com.cn tracks — smaller townships or newly established administrative areas may not appear. The 40-day forecast includes historical baselines alongside forward projections, making it distinct from the 7-day and 15-day endpoints which carry only forecast data.

Common use cases
  • Display real-time temperature, humidity, and AQI for a Chinese city in a travel or logistics dashboard using get_current_weather.
  • Build a clothing or activity recommendation feature using the dataZS life indices (UV, comfort, clothing) returned by get_current_weather.
  • Render a 15-day forecast calendar with lunar dates and sunrise/sunset times for a Chinese-market calendar app via get_forecast_15day.
  • Plot a 40-day temperature range chart against historical averages using hmax/hmin fields from get_forecast_40day.
  • Monitor nationwide air quality trends by polling get_air_quality for ranked PM2.5 and PM10 city lists.
  • Surface active weather alerts on a map by parsing the location and coordinates returned by get_weather_alerts.
  • Back-fill a 24-hour temperature and wind time series for a city using the od2 hourly records from get_hourly_observations.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does weather.com.cn have an official developer API?+
weather.com.cn (operated by the China Meteorological Administration) does not publish a documented public developer API with open registration. The data is accessible through its website rather than an officially documented REST or SDK offering for third-party developers.
How do I look up the city code for a specific location?+
search_city_weather accepts a query parameter in either Chinese characters or pinyin and returns an array of matching cities, districts, and scenic spots. Each result includes a city_code (9-digit string) that is the required input for all other endpoints. For example, querying '北京' returns Beijing's code 101010100.
What does the 40-day forecast endpoint actually include versus the 7-day and 15-day endpoints?+
get_forecast_40day is a calendar-style view: each day entry combines historical average high/low (hmax/hmin), lunar calendar information (nl, nlyf), almanac data, and forecast or observed temperatures. The 7-day and 15-day endpoints focus on day/night weather codes, actual forecast temperatures, and wind data without the historical baseline or lunar fields. The 40-day endpoint also accepts an optional month parameter to fetch a specific month's calendar.
Does the API cover weather data for Taiwan, Hong Kong, or Macau?+
The API indexes cities and locations tracked by weather.com.cn, which is a mainland China meteorological service. Coverage for Taiwan, Hong Kong, and Macau is not currently included. You can fork this API on Parse and revise it to add endpoints targeting other regional weather sources.
Does `get_weather_alerts` let me filter alerts by province or city?+
Not currently. get_weather_alerts returns all active nationwide alerts in a single response; there is no input parameter to filter by region, severity, or alert type. The response includes a location name and alert ID per entry that you can filter client-side. You can fork this API on Parse and revise it to add a filtered alerts endpoint that accepts a province or city code.
Page content last updated . Spec covers 8 endpoints from weather.com.cn.
Related APIs in WeatherSee all →
sentinel-hub.com API
Access satellite imagery from around the world and retrieve spectral band data, timestamps, and geographic coverage information to analyze Earth observation data. Process and generate statistics from satellite images for your specific areas of interest using powerful image processing tools.
openweathermap.org API
Search for cities and retrieve live weather conditions and forecasts (current, minutely precipitation, hourly and daily) by coordinates or by city name.
api.nasa.gov API
Access NASA's suite of open data APIs — including the Astronomy Picture of the Day, Near Earth Object tracking, DONKI space weather events, EPIC Earth imagery, Mars weather, the NASA Image and Video Library, the Exoplanet Archive, and EONET natural events.
weatherspark.com API
Get historical weather data, current METAR reports, and monthly climate summaries for any location by searching WeatherSpark's comprehensive weather database. Access detailed weather insights including temperature trends, precipitation patterns, and atmospheric conditions to power weather-dependent applications and analysis.
breckenridge.com API
Check real-time snow conditions, weather forecasts, lift operations, and trail status at Breckenridge Ski Resort to plan your day on the mountain. View live mountain cameras and get up-to-the-minute updates on slopes, lifts, and weather before you head out.
surfline.com API
Check real-time surf conditions, forecasts for waves and wind, tide predictions, and live camera feeds from thousands of surf spots around the world. Browse spots by geographic region and access detailed weather data to plan your perfect surfing session.
ingres.iith.ac.in API
Access groundwater resource estimation data across India at multiple geographic levels—from national summaries down to block-level details—and search specific locations to track groundwater availability and assessment trends. View historical assessment years and generate reports to analyze groundwater resources by state, district, or region.
zoom.earth API
Search Zoom Earth for places and get live environmental data including weather forecasts by coordinates, satellite imagery timestamps, active tropical storm tracks, active fires, and current platform status.
weather.com.cn API – China Weather Data · Parse