分钟级天气预测
接口说明
查询指定城市未来1小时分钟级(15分钟一步)天气走势和未来数小时逐小时预报,含温度/降水/天气现象/风速/湿度
可选参数hours=逐小时预报数量(1-24,默认6),return=text返回纯文本,也可用lat/lon直接传经纬度
请求示例
请求地址
https://api.tangdouz.com/a/weather/mtq.php?city=[城市名,如北京]&hours=[可选,1-24默认6]&return=[可填json或text]
请求地址
https://api.tangdouz.com/a/weather/mtq.php?city=上海&return=text
请求参数说明
| 参数名 | 说明 | 是否必填 |
|---|---|---|
city |
城市名,如北京 | 是 |
hours |
可选,1-24默认6 | 是 |
return |
可填json或text | 否 |
返回参数说明
| 参数名 | 说明 |
|---|---|
code |
状态码 |
city |
城市名 |
admin |
上级行政区 |
location |
经纬度 |
current |
当前天气(时间/温度/天气/湿度/降水量/风速) |
minutely |
未来1小时分钟级走势(15分钟一步,summary为降水概括) |
hourly |
逐小时预报(默认6小时,hours可调1-24,summary为概括) |
JSON返回示例
JSON格式
{
"code": 200,
"city": "北京",
"admin": "北京市",
"location": {
"lat": 39.9075,
"lon": 116.3972
},
"current": {
"time": "2026-09-01 12:00",
"temperature": 31,
"weather": "多云",
"humidity": 62,
"precipitation": 0,
"wind_speed": 4.9
},
"minutely": {
"summary": "未来1小时无降水",
"items": [
{
"time": "12:00",
"temperature": 31,
"weather": "多云",
"precipitation": 0,
"wind_speed": 4.9,
"visibility_km": 19.4
}
]
},
"hourly": {
"summary": "未来6小时气温 26~31°C,无降水",
"items": [
{
"time": "09-01 12:00",
"temperature": 31,
"weather": "多云",
"precipitation_probability": 10,
"precipitation": 0,
"wind_speed": 4.9,
"humidity": 62
}
]
}
}
在线测试
访问测试接口
点击上方链接将在新窗口打开接口测试页面