Web/PC

PC端天气网站
桌面浏览器端的天气预报网站,提供实时的详细天气数据展示,包含趋势图表、温湿度等多种可视化内容
currentconditions/v1 实时实况接口:温度、湿度、风力、天气现象与体感温度,需 Location Key,支持 details=true 与公制/英制。
华风爱科实况天气 API 提供全球地点的实时气象数据,分为标准能力与进阶能力。调用前需通过 定位搜索 API 获取 Location Key。标准能力返回当前温度、天气状况、风力、体感温度等;进阶能力支持查询过去 6 小时(逐小时)或 24 小时的实况历史记录。由中国气象局授权品牌与 AccuWeather 全球数据能力提供支撑。
/currentconditions/v1/{locationkey}.json 获取当前实况historical / historical/24 查询过往实况details=true 返回 RealFeel、UV、降水摘要等扩展要素通过当前天气API可以构建的应用示例

桌面浏览器端的天气预报网站,提供实时的详细天气数据展示,包含趋势图表、温湿度等多种可视化内容

原生/混合移动应用,提供贴靠随身浏览的突发天气预防的用户界面

简洁直观的桌面天气小组件,快速浏览当前核心气象指标,提供沉浸式的使用体验

专为车载智能终端优化的实时天气界面,提供实时天气预警与安全驾驶辅助
URL 路径中的 {locationkey} 为定位 API 返回的 Location Key;下表为查询参数。进阶历史接口路径不同(historical / historical/24),查询参数与标准能力一致。
| 参数名 | 类型 | 必填 | 默认值 | 说明 | 示例 |
|---|---|---|---|---|---|
| apikey | String | 是 | - | 用以在API里验证与授权使用的用户密钥 | YOUR_API_KEY |
| version | String | 是 | v1 | 当前API版本 | v1 |
| locationkey | String | 是 | - | 用以搜索指定地点的特定ID | 101924 |
| format | String | 否 | JSON | 响应格式 | JSON |
| language | String | 否 | en-us | 指定响应数据语言的字符串 | zh-cn |
| details | String | 否 | false | 用以判断返回缩短版或完整版的当前天气状况 | details = true |
| 参数 | 类型 | 说明 | 数据形式示例 |
|---|---|---|---|
|
LocalObservationDateTime
|
String | 本地观测时间(ISO 8601格式) | 2026-07-27T13:48:09+08:00 |
|
EpochTime
|
Int | 观测时间的 UNIX 时间戳 | 1785131289 |
|
WeatherIcon
|
Int | 天气图标编号 | 7 |
|
WeatherText
|
String | 天气状况描述文本 | 多云 |
|
HasPrecipitation
|
Boolean | 是否有降水 | false |
|
PrecipitationType
|
String | 降水类型(雨/雪/冰等) | null |
|
LocalSource
▶
|
Object |
本地数据源信息
6 个子字段
|
- |
|
└─
Id
|
Int | 源 ID | 7 |
|
└─
Name
|
String | 源名称 | Huafeng |
|
└─
WeatherCode
|
String | 天气代码 | 01 |
|
└─
WindLevel
|
Int | 风力等级 | 4 |
|
└─
WindDirectionCode
|
String | 风向代码 | 5 |
|
└─
Temperature
|
String | 温度字符串 | 32.0 |
|
IsDayTime
|
Boolean | 是否为白天 | true |
|
Temperature
▶
|
Object |
温度
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
2 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 32 |
|
└─
Unit
|
String | 单位 | C |
|
└─
Imperial
▶
|
Object |
英制
2 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 89.6 |
|
└─
Unit
|
String | 单位 | F |
|
RelativeHumidity
|
Int | 相对湿度(%) | 57 |
|
MobileLink
|
String | 移动端链接 | http://m.weathercn.com/zh/cn/beijing/101924/current-weather/101924?lang=zh-cn |
|
Link
|
String | 网页端链接 | http://m.weathercn.com/zh/cn/beijing/101924/current-weather/101924?lang=zh-cn |
|
RealFeelTemperature
▶
|
Object |
体感温度
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
2 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 37.1 |
|
└─
Unit
|
String | 单位 | C |
|
└─
Imperial
▶
|
Object |
英制
2 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 98.8 |
|
└─
Unit
|
String | 单位 | F |
|
Wind
▶
|
Object |
风力信息
2 个子字段
|
- |
|
└─
Direction
▶
|
Object |
风向
3 个子字段
|
- |
|
└─
Degrees
|
Int | 角度 | 225 |
|
└─
Localized
|
String | 本地化方向 | 西南 |
|
└─
English
|
String | 英文方向 | SW |
|
└─
Speed
▶
|
Object |
风速
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 23.4 |
|
└─
Unit
|
String | 单位 | km/h |
|
└─
UnitType
|
Int | 单位类型 | 7 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 14.5 |
|
└─
Unit
|
String | 单位 | mi/h |
|
└─
UnitType
|
Int | 单位类型 | 9 |
|
WindGust
▶
|
Object |
阵风信息
1 个子字段
|
- |
|
└─
Speed
▶
|
Object |
阵风风速
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 23.4 |
|
└─
Unit
|
String | 单位 | km/h |
|
└─
UnitType
|
Int | 单位类型 | 7 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 14.5 |
|
└─
Unit
|
String | 单位 | mi/h |
|
└─
UnitType
|
Int | 单位类型 | 9 |
|
PrecipitationSummary
▶
|
Object |
降水总结
8 个子字段
|
- |
|
└─
Precipitation
▶
|
Object |
当前降水
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
PastHour
▶
|
Object |
过去1小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
Past3Hours
▶
|
Object |
过去3小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
Past6Hours
▶
|
Object |
过去6小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 1.7 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0.06 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
Past9Hours
▶
|
Object |
过去9小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 2.7 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0.1 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
Past12Hours
▶
|
Object |
过去12小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 2.7 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0.1 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
Past18Hours
▶
|
Object |
过去18小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 3.8 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0.15 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
└─
Past24Hours
▶
|
Object |
过去24小时
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 3.8 |
|
└─
Unit
|
String | 单位 | mm |
|
└─
UnitType
|
Int | 单位类型 | 3 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 0.15 |
|
└─
Unit
|
String | 单位 | in |
|
└─
UnitType
|
Int | 单位类型 | 1 |
|
TemperatureSummary
▶
|
Object |
温度总结
3 个子字段
|
- |
|
└─
Past6HourRange
▶
|
Object |
过去6小时范围
2 个子字段
|
- |
|
└─
Minimum
▶
|
Object |
最低
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 26.4 |
|
└─
Unit
|
String | 单位 | C |
|
└─
UnitType
|
Int | 单位类型 | 17 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 79 |
|
└─
Unit
|
String | 单位 | F |
|
└─
UnitType
|
Int | 单位类型 | 18 |
|
└─
Maximum
▶
|
Object |
最高
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 32.3 |
|
└─
Unit
|
String | 单位 | C |
|
└─
UnitType
|
Int | 单位类型 | 17 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 90 |
|
└─
Unit
|
String | 单位 | F |
|
└─
UnitType
|
Int | 单位类型 | 18 |
|
└─
Past12HourRange
▶
|
Object |
过去12小时范围
2 个子字段
|
- |
|
└─
Minimum
▶
|
Object |
最低
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 23.5 |
|
└─
Unit
|
String | 单位 | C |
|
└─
UnitType
|
Int | 单位类型 | 17 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 74 |
|
└─
Unit
|
String | 单位 | F |
|
└─
UnitType
|
Int | 单位类型 | 18 |
|
└─
Maximum
▶
|
Object |
最高
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 32.3 |
|
└─
Unit
|
String | 单位 | C |
|
└─
UnitType
|
Int | 单位类型 | 17 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 90 |
|
└─
Unit
|
String | 单位 | F |
|
└─
UnitType
|
Int | 单位类型 | 18 |
|
└─
Past24HourRange
▶
|
Object |
过去24小时范围
2 个子字段
|
- |
|
└─
Minimum
▶
|
Object |
最低
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 23.5 |
|
└─
Unit
|
String | 单位 | C |
|
└─
UnitType
|
Int | 单位类型 | 17 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 74 |
|
└─
Unit
|
String | 单位 | F |
|
└─
UnitType
|
Int | 单位类型 | 18 |
|
└─
Maximum
▶
|
Object |
最高
2 个子字段
|
- |
|
└─
Metric
▶
|
Object |
公制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 32.9 |
|
└─
Unit
|
String | 单位 | C |
|
└─
UnitType
|
Int | 单位类型 | 17 |
|
└─
Imperial
▶
|
Object |
英制
3 个子字段
|
- |
|
└─
Value
|
Float | 数值 | 91 |
|
└─
Unit
|
String | 单位 | F |
|
└─
UnitType
|
Int | 单位类型 | 18 |
# 调取当前实况天气数据(标准能力)
curl "https://openapi.weathercn.com/currentconditions/v1/101924.json?apikey=YOUR_API_KEY&language=zh-cn&details=true"
// 调取当前实况天气数据(标准能力)
fetch('https://openapi.weathercn.com/currentconditions/v1/101924.json?apikey=YOUR_API_KEY&language=zh-cn&details=true')
.then(response => response.json())
.then(data => console.log(data));
import requests
# 调取当前实况天气数据(标准能力)
url = "https://openapi.weathercn.com/currentconditions/v1/101924.json"
params = {'apikey': 'YOUR_API_KEY', 'language': 'zh-cn', 'details': 'true'}
response = requests.get(url, params=params)
print(response.json())
// 调取当前实况天气数据(标准能力)
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.weathercn.com/currentconditions/v1/101924.json?apikey=YOUR_API_KEY&language=zh-cn&details=true"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
<?php
// 调取当前实况天气数据(标准能力)
$url = 'https://openapi.weathercn.com/currentconditions/v1/101924.json';
$params = http_build_query(['apikey' => 'YOUR_API_KEY', 'language' => 'zh-cn', 'details' => 'true']);
$response = file_get_contents($url . '?' . $params);
print_r(json_decode($response, true));
?>
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://openapi.weathercn.com/currentconditions/v1/101924.json?apikey=YOUR_API_KEY&language=zh-cn&details=true"
resp, _ := http.Get(url)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
require 'net/http'
require 'json'
url = URI("https://openapi.weathercn.com/currentconditions/v1/101924.json")
params = {apikey: 'YOUR_API_KEY', language: 'zh-cn', details: 'true'}
url.query = URI.encode_www_form(params)
response = Net::HTTP.get_response(url)
puts JSON.parse(response.body)
let url = URL(string: "https://openapi.weathercn.com/currentconditions/v1/101924.json?apikey=YOUR_API_KEY&language=zh-cn&details=true")!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
if let data = data { print(try? JSONSerialization.jsonObject(with: data)) }
}
task.resume()
[
{
"LocalObservationDateTime": "2026-03-10T10:50:09+08:00",
"EpochTime": 1773111009,
"WeatherIcon": 7,
"WeatherText": "多云",
"HasPrecipitation": false,
"PrecipitationType": null,
"LocalSource": {
"Id": 7,
"Name": "Huafeng",
"WeatherCode": "01",
"WindLevel": 2,
"WindDirectionCode": "4",
"WindGustDirectionCode": "4",
"Temperature": "6.0"
},
"IsDayTime": true,
"Temperature": {
"Metric": { "Value": 6.0, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 42.8, "Unit": "F", "UnitType": 18 }
},
"RelativeHumidity": 39,
"MobileLink": "http://m.weathercn.com/zh/cn/beijing/101924/current-weather/101924?lang=zh-cn",
"Link": "http://m.weathercn.com/zh/cn/beijing/101924/current-weather/101924?lang=zh-cn",
"RealFeelTemperature": {
"Metric": { "Value": 3.3, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 37.9, "Unit": "F", "UnitType": 18 }
},
"RealFeelTemperatureShade": {
"Metric": { "Value": 1.3, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 34.3, "Unit": "F", "UnitType": 18 }
},
"IndoorRelativeHumidity": 33,
"DewPoint": {
"Metric": { "Value": -4.9, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 23.0, "Unit": "F", "UnitType": 18 }
},
"Wind": {
"Direction": { "Degrees": 180, "Localized": "南", "English": "S" },
"Speed": {
"Metric": { "Value": 10.4, "Unit": "km/h", "UnitType": 7 },
"Imperial": { "Value": 6.5, "Unit": "mi/h", "UnitType": 9 }
}
},
"WindGust": {
"Speed": {
"Metric": { "Value": 10.4, "Unit": "km/h", "UnitType": 7 },
"Imperial": { "Value": 6.5, "Unit": "mi/h", "UnitType": 9 }
}
},
"UVIndex": 3,
"UVIndexText": "弱",
"Visibility": {
"Metric": { "Value": 11.4, "Unit": "km", "UnitType": 6 },
"Imperial": { "Value": 7.1, "Unit": "mi", "UnitType": 2 }
},
"ObstructionsToVisibility": "",
"CloudCover": 10,
"Ceiling": {
"Metric": { "Value": 8961.0, "Unit": "m", "UnitType": 5 },
"Imperial": { "Value": 29400.0, "Unit": "ft", "UnitType": 0 }
},
"Pressure": {
"Metric": { "Value": 1017.0, "Unit": "mb", "UnitType": 14 },
"Imperial": { "Value": 30.03, "Unit": "inHg", "UnitType": 12 }
},
"PressureTendency": { "LocalizedText": "下降", "Code": "F" },
"Past24HourTemperatureDeparture": {
"Metric": { "Value": -1.7, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": -3.0, "Unit": "F", "UnitType": 18 }
},
"ApparentTemperature": {
"Metric": { "Value": 5.0, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 41.0, "Unit": "F", "UnitType": 18 }
},
"WindChillTemperature": {
"Metric": { "Value": 1.7, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 35.0, "Unit": "F", "UnitType": 18 }
},
"WetBulbTemperature": {
"Metric": { "Value": 0.8, "Unit": "C", "UnitType": 17 },
"Imperial": { "Value": 33.0, "Unit": "F", "UnitType": 18 }
},
"Precip1hr": {
"Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 },
"Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 }
},
"PrecipitationSummary": {
"Precipitation": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"PastHour": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"Past3Hours": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"Past6Hours": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"Past9Hours": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"Past12Hours": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"Past18Hours": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } },
"Past24Hours": { "Metric": { "Value": 0.0, "Unit": "mm", "UnitType": 3 }, "Imperial": { "Value": 0.0, "Unit": "in", "UnitType": 1 } }
},
"TemperatureSummary": {
"Past6HourRange": {
"Minimum": { "Metric": { "Value": -0.9, "Unit": "C", "UnitType": 17 }, "Imperial": { "Value": 30.0, "Unit": "F", "UnitType": 18 } },
"Maximum": { "Metric": { "Value": 4.2, "Unit": "C", "UnitType": 17 }, "Imperial": { "Value": 40.0, "Unit": "F", "UnitType": 18 } }
},
"Past12HourRange": {
"Minimum": { "Metric": { "Value": -0.9, "Unit": "C", "UnitType": 17 }, "Imperial": { "Value": 30.0, "Unit": "F", "UnitType": 18 } },
"Maximum": { "Metric": { "Value": 6.9, "Unit": "C", "UnitType": 17 }, "Imperial": { "Value": 45.0, "Unit": "F", "UnitType": 18 } }
},
"Past24HourRange": {
"Minimum": { "Metric": { "Value": -0.9, "Unit": "C", "UnitType": 17 }, "Imperial": { "Value": 30.0, "Unit": "F", "UnitType": 18 } },
"Maximum": { "Metric": { "Value": 12.7, "Unit": "C", "UnitType": 17 }, "Imperial": { "Value": 55.0, "Unit": "F", "UnitType": 18 } }
}
}
}
]
Key。X-Gw-API-Key: YOUR_API_KEY,避免 Key 出现在 URL 日志中。