文章内容
接口简介:
根据IP查询7天天气预报,腾讯天气版。

请求地址:
https://cn.apihz.cn/api/tianqi/tengxunip.php

请求方式:
POST或GET。

请求参数:
【名称】【参数】【必填】【说明】
【用户ID】【id】【是】【用户中心的数字ID,例:id=10000000】
【用户KEY】【key】【是】【用户中心通讯秘钥,例:key=15he5h15ty854j5sr152hs2】
【IP地址】【ip】【否】【要查询的IP地址,如果为空则默认接口请求IP。例:ip=49.234.56.78】

返回参数:
【名称】【参数】【说明】
【状态码】【code】【200成功,400错误】
【消息内容】【msg】【信息提示。】
【省级名称】【province】【返回查询的省级名称。】
【市级名称】【getcity】【返回查询的市级名称。】
【地区名称】【county】【返回查询的区县级地区名称。】
【查询IP】【ip】【返回查询的IP地址。】
【数据集】【data】【天气信息数据集。】
【空气质量等级】【data.aqi_level】【空气质量等级,暂无用。】
【空气质量描述】【data.aqi_name】【空气质量描述,暂无用。】
【空气质量链接】【data.aqi_url】【空气质量详情链接,暂无用。】
【白天天气】【data.day_weather】【白天天气。】
【白天天气代码】【data.day_weather_code】【白天天气代码。】
【白天天气】【data.day_weather_short】【白天天气。】
【白天天气链接】【data.day_weather_url】【白天天气链接,暂无用。】
【白天风向描述】【data.day_wind_direction】【白天风向描述。】
【白天风向代码】【data.day_wind_direction_code】【白天风向代码。】
【白天风力等级】【data.day_wind_power】【白天风力等级。】
【白天风力等级代码】【data.day_wind_power_code】【白天风力等级代码,暂无用。】
【白天最高气温】【data.max_degree】【白天最高气温。】
【白天最低气温】【data.min_degree】【白天最低气温。】
【夜间天气】【data.night_weather】【夜间天气。】
【夜间天气代码】【data.night_weather_code】【夜间天气代码。】
【夜间天气】【data.night_weather_short】【夜间天气。】
【夜间天气链接】【data.night_weather_url】【夜间天气链接,暂无用。】
【夜间风向】【data.night_wind_direction】【夜间风向。】
【夜间风向代码】【data.night_wind_direction_code】【夜间风向代码。】
【夜间风力等级】【data.night_wind_power】【夜间风力等级。】
【夜间风力等级代码】【data.night_wind_power_code】【夜间风力等级代码。】
【天气预报时间】【data.time】【天气预报时间。】

GET请求示例:
https://cn.apihz.cn/api/tianqi/tengxunip.php?id=88888888&key=88888888&ip=49.234.56.78
注意:示例里的ID与KEY为公共ID与KEY,共享每分钟调用频次限制,接口本身免费,请使用自己的ID与KEY,独享每分钟调用频次。每日调用无上限。

POST请求示例:
请根据开发语言自行POST。

返回数据示例:
示例:{"code":400,"msg":"通讯秘钥错误。"}
示例:
{
"code": 200,
"province": "上海",
"getcity": "上海",
"county": "上海",
"ip": "49.234.56.78",
"data": [{
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "多云",
"day_weather_code": "01",
"day_weather_short": "多云",
"day_weather_url": "",
"day_wind_direction": "西风",
"day_wind_direction_code": "6",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "20",
"min_degree": "15",
"night_weather": "阴",
"night_weather_code": "02",
"night_weather_short": "阴",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-10-29"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "多云",
"day_weather_code": "01",
"day_weather_short": "多云",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "22",
"min_degree": "17",
"night_weather": "阴",
"night_weather_code": "02",
"night_weather_short": "阴",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-10-30"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "中雨",
"day_weather_code": "08",
"day_weather_short": "中雨",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "22",
"min_degree": "18",
"night_weather": "大雨",
"night_weather_code": "09",
"night_weather_short": "大雨",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-10-31"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "大暴雨",
"day_weather_code": "11",
"day_weather_short": "暴雨",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "20",
"min_degree": "17",
"night_weather": "小雨",
"night_weather_code": "07",
"night_weather_short": "小雨",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-11-01"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "晴",
"day_weather_code": "00",
"day_weather_short": "晴",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "20",
"min_degree": "16",
"night_weather": "晴",
"night_weather_code": "00",
"night_weather_short": "晴",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-11-02"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "多云",
"day_weather_code": "01",
"day_weather_short": "多云",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "22",
"min_degree": "15",
"night_weather": "晴",
"night_weather_code": "00",
"night_weather_short": "晴",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-11-03"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "晴",
"day_weather_code": "00",
"day_weather_short": "晴",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "19",
"min_degree": "13",
"night_weather": "晴",
"night_weather_code": "00",
"night_weather_short": "晴",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-11-04"
}, {
"aqi_level": 0,
"aqi_name": "",
"aqi_url": "",
"day_weather": "晴",
"day_weather_code": "00",
"day_weather_short": "晴",
"day_weather_url": "",
"day_wind_direction": "微风",
"day_wind_direction_code": "0",
"day_wind_power": "1-3",
"day_wind_power_code": "0",
"max_degree": "17",
"min_degree": "12",
"night_weather": "晴",
"night_weather_code": "00",
"night_weather_short": "晴",
"night_weather_url": "",
"night_wind_direction": "微风",
"night_wind_direction_code": "0",
"night_wind_power": "1-3",
"night_wind_power_code": "0",
"time": "2024-11-05"
}]
}

参考资料(版权):
https://www.apihz.cn/api/tianqitengxunip.html
如有侵权请联系我们删除!
新浪文章内容提取,可提取新闻等多栏目内容免费API接口教程

 查看详情 

随机头像图片[QQ用户头像]免费API接口教程

 查看详情 

云托管-MYSQL中间件免费API接口教程

 查看详情 

云托管-GETPOST免费API接口教程

 查看详情 

今日头条文章内容提取免费API接口教程

 查看详情 

随机一言免费API接口教程

 查看详情 

二维码操作[二维码生成]免费API接口教程

 查看详情 

查IP[查指定IP归属地]免费API接口教程

 查看详情 

短信验证码[转发-自有模板-腾讯云]免费API接口教程

 查看详情 

短信验证码[转发-自有模板-阿里云]免费API接口教程

 查看详情 

取接口访问者信息[IP,浏览器,操作系统]免费API接口教程

 查看详情 

时间操作[取当前北京时间]免费API接口教程

 查看详情 

时间操作[时间转时间戳]免费API接口教程

 查看详情 

时间操作[时间戳转时间]免费API接口教程

 查看详情 

时间操作[计算时间差]免费API接口教程

 查看详情 

二维码操作[二维码解析基础版]免费API接口教程

 查看详情 

BING壁纸免费API接口教程

 查看详情 

随机天文图[NASA官方]免费API接口教程

 查看详情 

随机成语[3万词库]免费API接口教程

 查看详情 

成语接龙[3万词库]免费API接口教程

 查看详情