文章内容
接口简介:

根据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接口教程

 查看详情 

短网址生成-查询信息免费API接口教程

 查看详情 

短网址生成-指定后缀免费API接口教程

 查看详情 

短网址生成-随机后缀免费API接口教程

 查看详情 

百家号文章内容提取免费API接口教程

 查看详情 

火车车次经停站点查询免费API接口教程

 查看详情 

火车票票价查询免费API接口教程

 查看详情 

火车票余票信息查询免费API接口教程

 查看详情 

微信公众号文章内容提取免费API接口教程

 查看详情 

检查指定网站SSL证书信息免费API接口教程

 查看详情 

国内无法拉取Docker镜像了?这些方法拯救你的Docker

 查看详情 

解决Python报错:ModuleNotFoundError: No module named ‘requests‘

 查看详情 

MySQL删除表数据、清空表命令(truncate、drop、delete 区别)

 查看详情 

国产数据库:目前最火的五款国产数据介绍

 查看详情 

推荐一些好用的数据库管理工具合集

 查看详情 

深入理解分布式锁Redis

 查看详情 

MySQL删除表数据、清空表命令(truncate、drop、delete 区别)

 查看详情 

如何在IDEA中使用DeepSeek

 查看详情 

全球域名WHOIS信息查询免费API接口教程

 查看详情 

sql如何查询表中数据 sql表数据查询技巧

 查看详情