Misc

Query Weather

0calls
2 credits / call

Checking the weather before heading out is always a good habit. This endpoint provides accurate, real-time weather data for both domestic and international cities.

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

City name. Accepts both Chinese (北京) and English (Tokyo). Optional — when omitted, the API attempts to auto-locate by IP.

adcode
string

Administrative district code (e.g. 110000). Higher priority than city. Optional — when omitted, the API attempts to auto-locate by IP.

lang
string

Response language. zh returns Chinese (default), en returns English. City-name translations cover 7000+ cities. Lifestyle indices (indices) currently support Chinese only.

extended
boolean
Pro

Return extended meteorological fields (apparent temperature, visibility, pressure, UV, precipitation, cloud cover, air quality index, and pollutant breakdown).

forecast
boolean
Pro

Return multi-day forecast data (up to 7 days), including daily high and low temperatures, day/night weather, wind direction and force, sunrise/sunset, and more.

hourly
boolean
Pro

Return an hourly forecast (24 hours), including temperature, weather, wind direction and speed, humidity, precipitation probability, and more.

minutely
boolean
Pro

Return minute-level precipitation forecast (domestic cities only), 2-minute resolution.

indices
boolean
Pro

Return 18 lifestyle indices (clothing, UV, car wash, drying, AC, cold-and-flu, sports, comfort, travel, fishing, allergy, sun protection, mood, beer, umbrella, traffic, air purifier, pollen).

Overview

Three query modes are supported:

  • Pass adcode to query by administrative district code (highest priority).
  • Pass city to query by city name. Both Chinese (北京) and English (Tokyo) are accepted.
  • Pass neither and the API will auto-locate using the client IP.

The lang parameter accepts zh (default) and en. City-name translations cover 7000+ cities.

Optional modules

  • extended=true: extended meteorological fields (apparent temperature, visibility, pressure, UV, air quality, and pollutant breakdown).
  • forecast=true: multi-day forecast (up to 7 days), with daily high/low temperature, sunrise/sunset, wind speed, and other detailed data.
  • hourly=true: hourly forecast (24 hours).
  • minutely=true: minute-level precipitation forecast (domestic cities only, 2-minute resolution).
  • indices=true: 18 lifestyle indices (clothing, UV, car wash, sports, pollen, and more).

Notes on the weather field

weather is a free-form weather description, not a fixed enum.

Common Chinese values returned by the API include: 晴 (sunny), 多云 (cloudy), 阴 (overcast), 小雨 (light rain), 中雨 (moderate rain), 大雨 (heavy rain), 雷阵雨 (thunderstorm), 小雪 (light snow), 中雪 (moderate snow), 大雪 (heavy snow), 雨夹雪 (sleet), 雾 (fog), 霾 (haze), 沙尘 (sand).

If your application needs a stable weather classification, map against weather_code instead. See the weather icon code table for all possible values.

Query parameters

city
stringoptional

City name. Accepts both Chinese (北京) and English (Tokyo). Optional — when omitted, the API attempts to auto-locate by IP.

adcode
stringoptional

Administrative district code (e.g. 110000). Higher priority than city. Optional — when omitted, the API attempts to auto-locate by IP.

extended
booleanoptional

Return extended meteorological fields (apparent temperature, visibility, pressure, UV, precipitation, cloud cover, air quality index, and pollutant breakdown).

forecast
booleanoptional

Return multi-day forecast data (up to 7 days), including daily high and low temperatures, day/night weather, wind direction and force, sunrise/sunset, and more.

hourly
booleanoptional

Return an hourly forecast (24 hours), including temperature, weather, wind direction and speed, humidity, precipitation probability, and more.

minutely
booleanoptional

Return minute-level precipitation forecast (domestic cities only), 2-minute resolution.

indices
booleanoptional

Return 18 lifestyle indices (clothing, UV, car wash, drying, AC, cold-and-flu, sports, comfort, travel, fishing, allergy, sun protection, mood, beer, umbrella, traffic, air purifier, pollen).

lang
stringoptional

Response language. zh returns Chinese (default), en returns English. City-name translations cover 7000+ cities. Lifestyle indices (indices) currently support Chinese only.

Response

200 / OK

Lookup succeeded. Returns the real-time weather for the area.

JSON
{
  // Province (Chinese name).
  "province": "北京市",
  // City name. Returned in Chinese by default; pass `lang=en` for the English name when available.
  "city": "北京",
  // District or finer-grained administrative area. More commonly returned when auto-locating by IP.
  "district": "海淀区",
  // Administrative district code (may be empty for some data sources).
  "adcode": "",
  // Weather condition. Returned in Chinese by default; pass `lang=en` for English. Not a fixed enum.
  "weather": "晴",
  // Weather icon code. See the [weather icon code table](#enum-list) for all possible values.
  "weather_icon": "100",
  // Current temperature in °C.
  "temperature": 18.3,
  // Wind direction. Chinese by default; pass `lang=en` for English.
  "wind_direction": "西南风",
  // Wind force level. Chinese by default; pass `lang=en` for English.
  "wind_power": "微风",
  // Relative humidity (%).
  "humidity": 20,
  // Data update time.
  "report_time": "2026-02-19 15:25:58",
  // Apparent temperature in °C (returned when extended=true).
  "feels_like": 6,
  // Visibility in km (returned when extended=true).
  "visibility": 11.3,
  // Atmospheric pressure in hPa (returned when extended=true).
  "pressure": 1017.5,
  // UV index (returned when extended=true).
  "uv": 2.9,
  // Current precipitation in mm (returned when extended=true).
  "precipitation": 0,
  // Cloud cover (%) (returned when extended=true).
  "cloud": 75,
  // Air quality index (0-500). Returned when extended=true.
  "aqi": 56,
  // AQI level (1-6). Returned when extended=true.
  "aqi_level": 2,
  // AQI level description (Excellent / Good / Lightly Polluted / Moderately Polluted / Heavily Polluted / Severely Polluted). Returned in Chinese; returned when extended=true.
  "aqi_category": "良",
  // Primary pollutant (e.g. PM2.5, PM10, O3). Returned when extended=true.
  "aqi_primary": "PM10",
  // Per-pollutant breakdown. Returned when extended=true; some data sources may not return this field.
  "air_pollutants": {
    // PM2.5 μg/m³
    "pm25": 33,
    // PM10 μg/m³
    "pm10": 69,
    // Ozone (μg/m³).
    "o3": 91,
    // Nitrogen dioxide (μg/m³).
    "no2": 13,
    // Sulfur dioxide (μg/m³).
    "so2": 7,
    // Carbon monoxide (mg/m³).
    "co": 0.4
  },
  // Official meteorological warnings (returned when active warnings exist).
  "alerts": [
    {
      // Warning title.
      "title": "string",
      // Warning type, e.g. lightning, rainstorm.
      "type": "string",
      // Warning level, e.g. blue, yellow, orange, red.
      "level": "string",
      // Warning body text.
      "text": "string",
      // Warning publish time.
      "publish_time": "string",
      // Issuing authority.
      "publisher": "string",
      // List of safety guidance entries.
      "guidance": [
        "string"
      ]
    }
  ],
  // Daily high temperature in °C (returned when forecast=true).
  "temp_max": 14,
  // Daily low temperature in °C (returned when forecast=true).
  "temp_min": -1,
  // Multi-day weather forecast (up to 7 days). Returned when forecast=true.
  "forecast": [
    {
      // Date in YYYY-MM-DD format.
      "date": "2026-02-19",
      // Day of the week. Pass `lang=en` for English.
      "week": "星期四",
      // Daily high temperature (°C).
      "temp_max": 14,
      // Daily low temperature (°C).
      "temp_min": -1,
      // Daytime weather. Pass `lang=en` for English.
      "weather_day": "晴",
      // Nighttime weather. Pass `lang=en` for English.
      "weather_night": "晴",
      // Daytime wind direction (optional). Pass `lang=en` for English.
      "wind_dir_day": "西南风",
      // Nighttime wind direction (optional). Pass `lang=en` for English.
      "wind_dir_night": "北风",
      // Daytime wind force (optional). Pass `lang=en` for English.
      "wind_scale_day": "微风",
      // Nighttime wind force (optional). Pass `lang=en` for English.
      "wind_scale_night": "微风",
      // Daytime wind speed in km/h (optional).
      "wind_speed_day": 17,
      // Humidity (%) (optional).
      "humidity": 40,
      // Precipitation (mm) (optional).
      "precip": 0,
      // Visibility in km (optional).
      "visibility": 25,
      // UV index (optional).
      "uv_index": 5,
      // Sunrise time HH:MM (optional).
      "sunrise": "06:52",
      // Sunset time HH:MM (optional).
      "sunset": "17:56"
    }
  ],
  // Hourly forecast (up to 24 hours). Returned when hourly=true.
  "hourly_forecast": [
    {
      // Forecast time (ISO8601 or YYYY-MM-DD HH:MM).
      "time": "2026-02-19T17:00:00+0900",
      // Temperature (°C).
      "temperature": 8,
      // Weather condition.
      "weather": "晴",
      // Wind direction (optional).
      "wind_direction": "北北西",
      // Wind speed in km/h (optional).
      "wind_speed": 17,
      // Wind force level (optional).
      "wind_scale": "3级",
      // Humidity (%) (optional).
      "humidity": 25,
      // Precipitation (mm) (optional).
      "precip": 0,
      // Apparent temperature in °C (optional).
      "feels_like": 6,
      // Visibility in km (optional).
      "visibility": 14,
      // Probability of precipitation (%) (optional).
      "pop": 0,
      // UV index (optional; usually not returned for domestic cities).
      "uv_index": 0
    }
  ],
  // Minute-level precipitation forecast. Returned when minutely=true; available for domestic cities only with 2-minute resolution.
  "minutely_precip": {
    // Precipitation summary.
    "summary": "未来2小时无降水",
    // Update time.
    "update_time": "2026-02-19T15:30:00+08:00",
    // Data points at 2-minute resolution.
    "data": [
      {
        // Forecast time (ISO8601).
        "time": "2026-02-19T15:30:00+08:00",
        // Precipitation at this time point (mm).
        "precip": 0,
        // Precipitation type: rain or snow.
        "type": "rain"
      }
    ]
  },
  // 18 lifestyle indices (returned when indices=true). Each entry contains `level` (level name), `brief` (short description), and `advice` (detailed guidance).
  "life_indices": {
    // Clothing index.
    "clothing": {
      "level": "较舒适",
      "brief": "微凉",
      "advice": "建议穿薄外套、卫衣或长袖衬衫"
    },
    // UV index.
    "uv": {
      "level": "高",
      "brief": "较强",
      "advice": "紫外线较强,减少10-14点户外活动,涂抹SPF30+防晒霜,戴帽子和墨镜"
    },
    // Car wash index.
    "car_wash": {
      "level": "非常适宜",
      "brief": "极佳",
      "advice": "天气晴好,非常适合洗车"
    },
    // Drying index.
    "drying": {
      "level": "适宜",
      "brief": "较好",
      "advice": "天气较好,适合晾晒"
    },
    // AC index.
    "air_conditioner": {
      "level": "建议制热",
      "brief": "寒冷",
      "advice": "建议开启空调制热"
    },
    // Cold risk index.
    "cold_risk": {
      "level": "较低",
      "brief": "较少发",
      "advice": "感冒风险较低"
    },
    // Exercise index.
    "exercise": {
      "level": "适宜",
      "brief": "较好",
      "advice": "天气适合运动"
    },
    // Comfort index.
    "comfort": {
      "level": "冷",
      "brief": "偏冷",
      "advice": "体感偏冷,适当添加衣物"
    },
    // Travel index.
    "travel": {
      "level": "适宜",
      "brief": "较好",
      "advice": "天气较好,适合出行"
    },
    // Fishing index.
    "fishing": {
      "level": "适宜",
      "brief": "较好",
      "advice": "天气适合钓鱼"
    },
    // Allergy index.
    "allergy": {
      "level": "较低",
      "brief": "不易发",
      "advice": "过敏风险较低"
    },
    // Sunscreen index.
    "sunscreen": {
      "level": "中等",
      "brief": "需防晒",
      "advice": "建议涂抹防晒霜"
    },
    // Mood index.
    "mood": {
      "level": "较好",
      "brief": "愉悦",
      "advice": "天气不错,心情愉悦"
    },
    // Beer index.
    "beer": {
      "level": "适宜",
      "brief": "较好",
      "advice": "适合来一杯冰啤酒"
    },
    // Umbrella index.
    "umbrella": {
      "level": "不需要",
      "brief": "无需",
      "advice": "天气晴好,无需带伞"
    },
    // Traffic index.
    "traffic": {
      "level": "良好",
      "brief": "较好",
      "advice": "天气对交通无明显影响"
    },
    // Air purifier index.
    "air_purifier": {
      "level": "建议开启",
      "brief": "一般",
      "advice": "空气质量一般,建议开启空气净化器"
    },
    // Pollen dispersion index.
    "pollen": {
      "level": "较低",
      "brief": "不易发",
      "advice": "花粉浓度较低"
    }
  }
}

400 / Bad Request

Invalid parameter. Common causes: malformed adcode, invalid lang (only zh/en are supported), wrong parameter type, or invalid parameter combination.

JSON
{
  "code": "INVALID_PARAMETER",
  "message": "Invalid parameter"
}

404 / Not Found

City not found.

JSON
{
  "code": "NOT_FOUND",
  "message": "No weather data found for the requested city"
}

500 / Internal Server Error

Internal server error.

JSON
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error"
}

503 / Service Unavailable

Weather service temporarily unavailable.

JSON
{
  "code": "SERVICE_UNAVAILABLE",
  "message": "Weather service temporarily unavailable"
}