天气查询
查询城市当前天气及7天预报,数据源tianqi.com
接口地址
GET, POST https://api.tinyaii.cn/v1/weather
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
city | string | 是 | 城市名称(中文或拼音),如:北京、上海、guangzhou |
返回字段
| 字段名 | 类型 | 说明 |
|---|---|---|
data.city | string | 城市名称 |
data.current.temp | string | 当前温度(℃) |
data.current.weather | string | 天气状况 |
data.current.temp_low | string | 最低温度 |
data.current.temp_high | string | 最高温度 |
data.current.humidity | string | 湿度(%) |
data.current.wind | string | 风向 |
data.current.wind_level | string | 风力等级 |
data.current.aqi | string | 空气质量 |
data.current.pm25 | string | PM2.5 |
data.current.uv | string | 紫外线强度 |
data.current.sunrise | string | 日出时间 |
data.current.sunset | string | 日落时间 |
data.forecast | array | 7天天气预报 |
data.forecast[].date | string | 日期 |
data.forecast[].week | string | 星期 |
data.forecast[].weather | string | 天气状况 |
data.forecast[].temp_low | string | 最低温度 |
data.forecast[].temp_high | string | 最高温度 |
data.forecast[].wind | string | 风向 |
data.forecast[].wind_level | string | 风力等级 |
返回示例
{
"code": 200,
"data": {
"city": "北京",
"current": {
"temp": "23",
"weather": "多云",
"temp_low": "22",
"temp_high": "29",
"humidity": "65",
"wind": "东北风",
"wind_level": "1级",
"aqi": "优",
"pm25": "11",
"uv": "很弱",
"sunrise": "04:48",
"sunset": "19:47"
},
"forecast": [
{
"date": "06月30日",
"week": "星期二",
"weather": "多云转小雨",
"temp_low": "21",
"temp_high": "28",
"wind": "东北风",
"wind_level": "1级"
},
{
"date": "07月01日",
"week": "星期三",
"weather": "多云转小雨",
"temp_low": "22",
"temp_high": "28",
"wind": "东风",
"wind_level": "1级"
}
]
},
"message": "success"
}
调用示例
curl "https://api.tinyaii.cn/v1/weather?apikey=YOUR_KEY&city=北京"
相关接口(生活查询)
- 国内油价查询 — 查询全国或指定省份的汽柴油最新价格
- 黄金价格 — 查询国内黄金价格,含品牌金价、银行投资金条、贵金属回收价格
- 天气查询2 —
- 天气查询【增强版】 — 天气查询增强版
- 台风列表 —
- 台风详情 —
本站收录 353 个可免费调用的 API 接口,查看完整开发文档 或
注册获取 API Key。