稳定、快速、免费的 API 接口服务
用于查询某城市地区多日的###天气
接口地址: https://api.52vmy.cn/api/query/tian/many
返回格式: JSON
请求方式: GET
请求示例: https://api.52vmy.cn/api/query/tian/many?city=北京市
接口定制: 点此加入用户群
默认QPS: 每2秒最多4次 携带Token可无视限制
接口备注:点击前往当日详细天气API
请求参数说明:
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
| city | 是 | string | 城市 |
| type | 否 | string | 返回格式默认JSON可选text |
返回参数说明:
| 名称 | 类型 | 说明 |
|---|
返回示例:
{
"code": 200,
"msg": "成功",
"data": {
"city": "北京市",
"info": [
{
"Time": "周五",
"temperature": "5~11℃",
"weather": "小雨",
"bearing": "北风-1级",
"air_quality": "良"
},
{
"Time": "周六",
"temperature": "3~13℃",
"weather": "小雨",
"bearing": "南风-1级",
"air_quality": "良"
},
{
"Time": "周日",
"temperature": "0~14℃",
"weather": "多云",
"bearing": "西风-1级",
"air_quality": "优"
},
{
"Time": "周一",
"temperature": "2~11℃",
"weather": "晴",
"bearing": "南风-1级",
"air_quality": "良"
},
{
"Time": "周二",
"temperature": "3~14℃",
"weather": "晴",
"bearing": "东南风-1级",
"air_quality": "良"
},
{
"Time": "周三",
"temperature": "2~15℃",
"weather": "晴",
"bearing": "西北风-1级",
"air_quality": "优"
}
]
}
}
PHP代码示例:
$city = $_GET["city"]; $type = $_GET["type"]; $url = "https://api.52vmy.cn/api/query/tian/many?city=".$city."&type=".$type; echo file_get_contents($url);