深色模式
天气实况
更新频率:约15分钟
滞后时间:约30分钟
调用示例
sh
POST https://open.apihub.net/api/weather-basic/now
apihub-token: {{ apihub_token }}
{
"lng": 116.40,
"lat": 39.93
}
sh
curl -X POST \
"https://open.apihub.net/api/weather-basic/now" \
-H "apihub-token: {{ apihub_token }}" \
-H "Content-Type: application/json" \
-d '{
"lng": 116.40,
"lat": 39.93
}'
参数说明
参数 | 位置 | 类型 | 必传 | 说明 |
---|---|---|---|---|
lng | JsonBody | number | 是 | 经度 |
lat | JsonBody | number | 是 | 纬度 |
未传经纬度时,将默认尝试ip定位。
返回值说明
{>...3
"success": true,
"trace": "c0f039d8219c11f09f814a73ab197607",
"result": {>...3
"location": {>...2
"name": "福州",
"path": "福州,福州,福建,中国"
},
"now": {>...3
"text": "阴",
"code": "9",
"temperature": "17"
},
"lastUpdated": 1745561261000
}
}
字段 | 说明 |
---|---|
now.text | 天气现象 文字描述 |
now.code | 天气现象 编码 |
now.temperature | 温度,单位:°C |
逐日天气
数据时间范围:今天,明天,后天
更新频率:3~4次每天
调用示例
sh
POST https://open.apihub.net/api/weather-basic/daily
apihub-token: {{ apihub_token }}
{
"lng": 116.40,
"lat": 39.93
}
sh
curl -X POST \
"https://open.apihub.net/api/weather-basic/daily" \
-H "apihub-token: {{ apihub_token }}" \
-H "Content-Type: application/json" \
-d '{
"lng": 116.40,
"lat": 39.93
}'
参数说明
参数 | 位置 | 类型 | 必传 | 说明 |
---|---|---|---|---|
lng | JsonBody | number | 是 | 经度 |
lat | JsonBody | number | 是 | 纬度 |
未传经纬度时,将默认尝试ip定位。
返回值说明
{>...3
"success": true,
"trace": "e91ab94c219c11f096f8c6807b612ccf",
"result": {>...3
"location": {>...2
"name": "福州",
"path": "福州,福州,福建,中国"
},
"daily": [>...3
{>...14, }
{>...14, }
{>...14 }
],
"lastUpdated": 1745539200000
}
}
字段 | 说明 |
---|---|
daily[].text_day | 白天 天气现象 文字描述 |
daily[].code_day | 白天 天气现象 编码 |
daily[].text_night | 晚间 天气现象 文字描述 |
daily[].code_night | 晚间 天气现象 编码 |
daily[].high | 当天最高温度,单位:°C |
daily[].low | 当天最低温度,单位:°C |
daily[].precip | 降水概率,范围:0~1 |
daily[].rainfall | 降水量,单位:mm |
daily[].wind_direction | 风向 文字描述 |
daily[].wind_direction_degree | 风向角度,范围:0~360 |
daily[].wind_speed | 风速,单位:km/h |
daily[].wind_scale | 风力等级 |
daily[].humidity | 相对湿度,0~100,单位:百分比 |
相关资源
天气图标
适合深色背景下使用。资源地址:https://apihub-net.oss-cn-beijing.aliyuncs.com/img/weather/v3/${天气现象 编码}.svg