小时级别预报
bash
curl "https://api.caiyunapp.com/v2.3/TAkhjf8d1nlSlspN/101.6656,39.2072/hourly?hourlysteps=1"
hourlysteps
: 控制返回多少小时的数据,[1, 360]
json
{
"status": "ok",
"api_version": "v2.3",
"api_status": "active",
"lang": "zh_CN",
"unit": "metric",
"tzshift": 28800,
"timezone": "Asia/Shanghai",
"server_time": 1640785832,
"location": [39.2072, 101.6656],
"result": {
"hourly": {
"status": "ok",
"description": "晴,明天凌晨4点钟后转多云,其后阴",
"precipitation": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 0
}
],
"temperature": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": -14
}
],
"wind": [
{
"datetime": "2021-12-29T21:00+08:00",
"speed": 6.84,
"direction": 172
}
],
"humidity": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 0.54
}
],
"cloudrate": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 0
}
],
"skycon": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": "CLEAR_NIGHT"
}
],
"pres": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 85651.2
}
],
"visibility": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 6.3
}
],
"dswrf": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 0
}
],
"aqi": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 89
}
],
"pm25": [
{
"datetime": "2021-12-29T21:00+08:00",
"value": 55
}
]
},
"primary": 0,
"forecast_keypoint": "晴,明天凌晨4点钟后转多云,其后阴"
}
}
JSONPath $.result.hourly. | 说明 |
---|---|
temperature.value | 地表 2 米气温 |
pres.value | 地面气压 |
humidity.value | 地表 2 米相对湿度(%) |
wind.direction.value | 地表 10 米风向 |
wind.speed.value | 地表 10 米风速 |
precipitation.value | 降水数据 |
cloudrate.value | 云量(0.0-1.0) |
dswrf.value | 向下短波辐射通量(W/M2) |
visibility.value | 地表水平能见度 |
skycon.value | 天气现象 |
description | 自然语言描述 |
forecast_keypoint | 自然语言描述 |
pm25.value | PM2.5 浓度(μg/m3) |
aqi.value | 国标 AQI |