接口地址:http://api.xtaoa.com/api/city.php?city=成都
返回格式:json/txt
请求方式:get
请求示例:http://api.xtaoa.com/api/city.php?city=成都
请求备注:暂无
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
city | 是 | string | 查询的城市地址 |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
success | string | 状态码 |
city | string | 地址 |
info | string | 内容 |
请求返回示例:
{ "success": true, "city": "成都", "info": { "date_time": "2023-08-24 19:00:00", "pm25": { "advice": "0", "aqi": "23", "citycount": 375, "cityrank": 81, "co": "0.5", "color": "0", "level": "0", "no2": "23", "o3": "57", "pm10": "19", "pm25": "16", "quality": "优", "so2": "2", "timestamp": "", "upDateTime": "2023-08-24 19:42:22" }, "realtime": { "img": "2", "sD": "100", "sendibleTemp": "25", "temp": "22", "time": "2023-08-24 19:42:23", "wD": "北风", "wS": "1级", "weather": "阴", "ziwaixian": "N/A" }, "indexes": [ { "abbreviation": "ct", "alias": "", "content": "预计今日天气温暖,建议穿出春夏过渡的衣物,如着棉麻衬衫、薄的长袖T恤、薄牛仔裤等,既舒适透气,又时尚。", "level": "衬衫", "name": "穿衣指数" }, { "abbreviation": "gm", "alias": "", "content": "感冒多发期,适当减少外出频率,适量补充水分,适当增减衣物。", "level": "多发", "name": "感冒指数" }, { "abbreviation": "xc", "alias": "", "content": "预计今日不宜洗车,未来24小时可能有雨或风力较大,如果在此期间洗车,雨水或灰尘可能会再次弄脏您的爱车。", "level": "不适宜", "name": "洗车指数" }, { "abbreviation": "yd", "alias": "", "content": "预计今日整体气象条件较差,不适宜户外锻炼,建议居家运动。", "level": "很不适宜", "name": "运动指数" }, { "abbreviation": "uv", "alias": "", "content": "属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF 在8-12 之间的防晒护肤品。", "level": "最弱", "name": "紫外线强度指数" }, { "abbreviation": "pp", "alias": "", "content": "", "level": "暂无", "name": "化妆指数" } ], "weathers": [ { "date": "2023-08-24", "img": "8", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "25", "temp_day_f": "77.0", "temp_night_c": "20", "temp_night_f": "68.0", "wd": "", "weather": "中雨", "week": "星期四", "ws": "" }, { "date": "2023-08-25", "img": "2", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "24", "temp_day_f": "75.2", "temp_night_c": "20", "temp_night_f": "68.0", "wd": "", "weather": "阴", "week": "星期五", "ws": "" }, { "date": "2023-08-26", "img": "2", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "23", "temp_day_f": "73.4", "temp_night_c": "20", "temp_night_f": "68.0", "wd": "", "weather": "阴", "week": "星期六", "ws": "" }, { "date": "2023-08-27", "img": "2", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "26", "temp_day_f": "78.8", "temp_night_c": "21", "temp_night_f": "69.8", "wd": "", "weather": "阴", "week": "星期日", "ws": "" }, { "date": "2023-08-28", "img": "7", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "29", "temp_day_f": "84.2", "temp_night_c": "21", "temp_night_f": "69.8", "wd": "", "weather": "小雨", "week": "星期一", "ws": "" }, { "date": "2023-08-29", "img": "8", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "28", "temp_day_f": "82.4", "temp_night_c": "21", "temp_night_f": "69.8", "wd": "", "weather": "中雨", "week": "星期二", "ws": "" }, { "date": "2023-08-23", "img": "8", "sun_down_time": "19:36", "sun_rise_time": "06:35", "temp_day_c": "31", "temp_day_f": "87.8", "temp_night_c": "23", "temp_night_f": "73.4", "wd": "", "weather": "中雨", "week": "星期三", "ws": "" } ] } }
服务级错误码参照:
错误码 | 说明 |
---|---|
201 | 无 |
202 | 无 |
203 | 无 |
实例演示代码:
暂无演示代码,正在拼命添加中...
暂无演示代码,正在拼命添加中...
暂无演示代码,正在拼命添加中...