天气查询2
查询城市天气信息,返回当前天气、24小时预报、7天预报。输入中文城市名即可查询。
接口地址
GET https://api.tinyaii.cn/v1/weather2
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
city | string | 是 | 城市名称,如:北京、上海、广州 |
返回字段
| 字段名 | 类型 | 说明 |
|---|---|---|
city | string | 查询的城市名 |
current.weather | string | 当前天气状况 |
current.temp | string | 当前温度(摄氏度) |
current.humidity | string | 湿度百分比 |
current.pressure | string | 气压(百帕) |
current.wind | string | 风向风力 |
current.aqi | string | 空气质量指数 |
current.aqi_level | string | 空气质量等级 |
forecast | array | 7天预报列表 |
forecast[].date | string | 日期 |
forecast[].day | object | 白天天气 |
forecast[].night | object | 夜间天气 |
hourly | array | 24小时预报列表 |
hourly[].time | string | 时间 |
hourly[].weather | string | 天气状况 |
hourly[].temp | string | 温度 |
返回示例
{
"code": 200,
"message": "success",
"data": {
"city": "北京",
"current": {
"weather": "多云",
"temp": "22",
"humidity": "66",
"pressure": "999",
"wind": "东南风 4-5级",
"aqi": "45",
"aqi_level": "优"
},
"forecast": [
{
"date": "06/13",
"day": {
"temp": "29℃",
"weather": "今天",
"wind": "西南风 3-4级"
},
"night": {
"temp": "20℃",
"weather": "雷阵雨",
"wind": "东风 1-3级"
}
}
],
"hourly": [
{
"time": "23:00",
"weather": "多云",
"temp": "22℃"
}
]
}
}
调用示例
curl "https://api.tinyaii.cn/v1/weather2?apikey=YOUR_KEY&city=北京"
相关接口(生活查询)
- 天气查询 — 查询城市当前天气及7天预报,数据源tianqi.com
- 国内油价查询 — 查询全国或指定省份的汽柴油最新价格
- 黄金价格 — 查询国内黄金价格,含品牌金价、银行投资金条、贵金属回收价格
- 天气查询【增强版】 — 天气查询增强版
- 台风列表 —
- 台风详情 —
本站收录 353 个可免费调用的 API 接口,查看完整开发文档 或
注册获取 API Key。