接口调用地址
说明:直接访问 https://api.apihz.cn/getapi.php 获取当前最优IP接口地址。由普通负载集群服务器组成,通过IP接口地址调用,如果单个服务器过载可自行切换IP接口地址尝试其他负载服务器。IP并非永久固定且容易遭受攻击,平台可能不定期更换。
说明:域名接口会自动分发请求到普通集群服务器均衡负载,该域名TTL值为60秒,表示你的请求会每60秒实现自动轮换负载服务器,但也可能因你的网络服务商存在DNS缓存造成短时间内无法自动切换负载。如果某个负载服务器出现故障,也可能会造成个别地区存在一定时间的故障期。
说明:VIP专线在普通集群组的基础上额外增加独享大带宽集群组,每次请求自动均衡负载,自动故障切换,抗攻击,全球智能CDN加速。超高稳定性!最低30¥/月,彩钻以上会员专属,登录后购买。注:VIP线路是指调用接口的线路更有保障以及每分钟拥有更高的调用频次等,并非收费接口包月使用。
请求示例
[GET]请求示例:(请登录后使用自己的KEY独享频次)
复制参数
复制全部
[POST]请求示例:(请根据开发语言自行POST,参考【GET/POST教程】,或下载【超级客户端】调试。)
请求参数说明
注意:请求编码为UTF8,否则带中文请求可能失败。一般参数不能带+号,会被自动替换为空格。参数内容较大的必须用POST,不能GET。
提示:如发现接口有BUG,可加服务QQ群及时向我们反馈。
提示:请求参数里的开发者ID与KEY,登录后台菜单【个人资料】里查看。
提示:如发现接口有BUG,可加服务QQ群及时向我们反馈。
提示:请求参数里的开发者ID与KEY,登录后台菜单【个人资料】里查看。
| 名称 | 参数 | 必填 | 说明 |
|---|---|---|---|
| 开发者ID | id | 是 | 用户中心的数字ID,例:id=10000000 |
| 开发者KEY | key | 是 | 用户中心通讯秘钥,例:key=15he5h15ty854j5sr152hs2 |
| 排行类型 | type | 否 | 1=白天温度,2=夜间温度,默认按白天温度排行。例:type=1 |
| 排序方式 | px | 否 | 1=温度从高到低,2=温度从低到高,默认按温度从高到低排行。例:px=1 |
| 查询页码 | page | 否 | 查询页码,每页最多返回10条数据,默认第1页。例:page=1 |
| 动态秘钥 | dkey | 否 | 开发者开启动态秘钥验证后需传此参数,主要针对直接在客户端调用接口的场景。请在官网后台菜单【个人资料】里配置。例:dkey=0cd2a494831736587c33f30d1e544371 |
| 用户IP | uip | 否 | 接口调用者IP,用于后台统计IP地域分布,ISP运营商,时段IP数统计等,如不传该参数则默认为接口请求端IP,该参数主要用于使用后端服务器/中间件请求接口的方式使用。例:uip=123.123.123.123。该参数彩钻/炫钻/焱钻会员专享。 |
返回参数说明
| 名称 | 参数 | 说明 |
|---|---|---|
| 状态码 | code | 200成功,400错误 |
| 信息提示 | msg | 信息提示 |
| 当前页码 | page | 当前页码 |
| 最大页码 | maxpage | 最大页码 |
| 排名数据集 | data | 排名数据集 |
| 排名 | data.top | 排名 |
| 省级名称 | data.sheng | 省级名称 |
| 市级名称 | data.shi | 市级名称 |
| 地区名称 | data.name | 地区名称 |
| 白天温度 | data.wd1 | 白天温度 |
| 夜间温度 | data.wd2 | 夜间温度 |
| 白天天气 | data.weather1 | 白天天气 |
| 夜间天气 | data.weather2 | 夜间天气 |
| 白天天气图标 | data.weather1img | 白天天气图标 |
| 夜间天气图标 | data.weather2img | 夜间天气图标 |
| 白天风向 | data.winddirection1 | 白天风向 |
| 夜间风向 | data.winddirection2 | 夜间风向 |
| 白天风力等级 | data.windleve1 | 白天风力等级 |
| 夜间风力等级 | data.windleve2 | 夜间风力等级 |
| 当前天气数据集 | data.nowdata | 当前天气数据集 |
| 当前降水量 | data.nowdata.precipitation | 当前降水量 |
| 当前温度 | data.nowdata.temperature | 当前温度 |
| 当前气压 | data.nowdata.pressure | 当前气压 |
| 当前湿度 | data.nowdata.humidity | 当前湿度 |
| 当前风向 | data.nowdata.windDirection | 当前风向 |
| 当前风向度 | data.nowdata.windDirectionDegree | 当前风向度 |
| 当前风速 | data.nowdata.windSpeed | 当前风速 |
| 当前风力 | data.nowdata.windScale | 当前风力 |
| 当前体感温度 | data.nowdata.feelst | 当前体感温度 |
| 当前天气更新时间 | data.nowdata.uptime | 当前天气信息更新时间,个别地区某些数据可能没有更新,会显示9999 |
返回数据示例
示例:{"code":400,"msg":"通讯秘钥错误。"}
示例:
{
"code": 200,
"page": 1,
"maxpage": 244,
"data": [{
"top": 1,
"sheng": "新疆",
"shi": "托克逊",
"name": "托克逊",
"wd1": "38",
"wd2": "20",
"weather1": "多云",
"weather2": "多云",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"winddirection1": "西北风",
"winddirection2": "西风",
"windleve1": "5~6级",
"windleve2": "5~6级",
"nowdata": {
"precipitation": 0,
"temperature": 33.2,
"pressure": 998,
"humidity": 7,
"windDirection": "东北风",
"windDirectionDegree": 87,
"windSpeed": 2.7,
"windScale": "微风",
"feelst": 31.8,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 2,
"sheng": "新疆",
"shi": "吐鲁番",
"name": "吐鲁番",
"wd1": "37",
"wd2": "21",
"weather1": "多云",
"weather2": "阴",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/yin.png",
"winddirection1": "南风",
"winddirection2": "北风",
"windleve1": "微风",
"windleve2": "3~4级",
"nowdata": {
"precipitation": 0,
"temperature": 31.4,
"pressure": 998,
"humidity": 6,
"windDirection": "东南风",
"windDirectionDegree": 113,
"windSpeed": 2.4,
"windScale": "微风",
"feelst": 29.9,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 3,
"sheng": "新疆",
"shi": "鄯善",
"name": "鄯善",
"wd1": "34",
"wd2": "18",
"weather1": "多云",
"weather2": "阴",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/yin.png",
"winddirection1": "西南风",
"winddirection2": "西风",
"windleve1": "3~4级",
"windleve2": "3~4级",
"nowdata": {
"precipitation": 0,
"temperature": 31.3,
"pressure": 952,
"humidity": 10,
"windDirection": "西南风",
"windDirectionDegree": 209,
"windSpeed": 3.5,
"windScale": "3级",
"feelst": 29.4,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 4,
"sheng": "海南",
"shi": "三亚",
"name": "三亚",
"wd1": "32",
"wd2": "24",
"weather1": "多云",
"weather2": "多云",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"winddirection1": "无持续风向",
"winddirection2": "无持续风向",
"windleve1": "微风",
"windleve2": "微风",
"nowdata": {
"precipitation": 0,
"temperature": 30.5,
"pressure": 1013,
"humidity": 76,
"windDirection": "西北风",
"windDirectionDegree": 282,
"windSpeed": 1.5,
"windScale": "微风",
"feelst": 35.6,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 5,
"sheng": "新疆",
"shi": "尉犁",
"name": "尉犁",
"wd1": "32",
"wd2": "16",
"weather1": "阴",
"weather2": "多云",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/yin.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"winddirection1": "北风",
"winddirection2": "东北风",
"windleve1": "微风",
"windleve2": "微风",
"nowdata": {
"precipitation": 0,
"temperature": 27.3,
"pressure": 907,
"humidity": 14,
"windDirection": "东南风",
"windDirectionDegree": 127,
"windSpeed": 1.2,
"windScale": "微风",
"feelst": 26.7,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 6,
"sheng": "海南",
"shi": "保亭",
"name": "保亭",
"wd1": "32",
"wd2": "23",
"weather1": "雷阵雨",
"weather2": "雷阵雨",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/leizhenyu.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/leizhenyu.png",
"winddirection1": "无持续风向",
"winddirection2": "无持续风向",
"windleve1": "微风",
"windleve2": "微风",
"nowdata": {
"precipitation": 0,
"temperature": 30.5,
"pressure": 1006,
"humidity": 63,
"windDirection": "东南风",
"windDirectionDegree": 164,
"windSpeed": 0.4,
"windScale": "微风",
"feelst": 35.2,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 7,
"sheng": "海南",
"shi": "西沙",
"name": "西沙",
"wd1": "31",
"wd2": "27",
"weather1": "多云",
"weather2": "多云",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"winddirection1": "东北风",
"winddirection2": "东北风",
"windleve1": "3~4级",
"windleve2": "3~4级",
"nowdata": {
"precipitation": 0,
"temperature": 32,
"pressure": 1013,
"humidity": 67,
"windDirection": "东北风",
"windDirectionDegree": 58,
"windSpeed": 3.1,
"windScale": "微风",
"feelst": 35.9,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 8,
"sheng": "新疆",
"shi": "乌苏",
"name": "乌苏",
"wd1": "31",
"wd2": "19",
"weather1": "多云",
"weather2": "多云",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"winddirection1": "西风",
"winddirection2": "西风",
"windleve1": "3~4级",
"windleve2": "微风",
"nowdata": {
"precipitation": 0,
"temperature": 26.7,
"pressure": 954,
"humidity": 22,
"windDirection": "西南风",
"windDirectionDegree": 259,
"windSpeed": 4.8,
"windScale": "3级",
"feelst": 24.3,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 9,
"sheng": "新疆",
"shi": "博乐",
"name": "博乐",
"wd1": "31",
"wd2": "12",
"weather1": "多云",
"weather2": "多云",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"winddirection1": "西风",
"winddirection2": "东南风",
"windleve1": "微风",
"windleve2": "微风",
"nowdata": {
"precipitation": 0,
"temperature": 26.8,
"pressure": 949,
"humidity": 23,
"windDirection": "东南风",
"windDirectionDegree": 104,
"windSpeed": 2.7,
"windScale": "微风",
"feelst": 25.8,
"uptime": "2026/05/04 12:40"
}
}, {
"top": 10,
"sheng": "新疆",
"shi": "哈密",
"name": "哈密",
"wd1": "31",
"wd2": "12",
"weather1": "多云",
"weather2": "阴",
"weather1img": "https://rescdn.apihz.cn/resimg/tianqi/duoyun.png",
"weather2img": "https://rescdn.apihz.cn/resimg/tianqi/yin.png",
"winddirection1": "西南风",
"winddirection2": "东北风",
"windleve1": "微风",
"windleve2": "3~4级",
"nowdata": {
"precipitation": 0,
"temperature": 28.6,
"pressure": 921,
"humidity": 10,
"windDirection": "西南风",
"windDirectionDegree": 200,
"windSpeed": 1.3,
"windScale": "微风",
"feelst": 27.8,
"uptime": "2026/05/04 12:40"
}
}]
}
更新记录