天气预报15日-墨迹天气-IP查询版免费API接口教程

简介: 该接口提供基于指定IP地址的15日天气预报,支持POST和GET请求方式。请求需包含用户ID、KEY,可选填IP地址,默认查询访问者IP所在地天气,查询失败时默认返回北京天气。返回值包括状态码、地点及15天天气详情,如星期、日历、天气状况、温度范围及天气图标等。示例请求和响应详见文档。

接口简介:
15日天气预报,根据指定IP获取墨迹天气预报。

请求地址:
https://cn.apihz.cn/api/tianqi/tqybmoji15ip.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】【如果状态码返回400则msg返回错误提示】
【地点】【place】【返回查询地点】
【结果集】【data】【返回15天天气结果集】
【星期】【week1】【返回星期几】
【日历】【week2】【返回日历】
【天气1】【wea1】【当日天气开始】
【天气2】【wea2】【当日天气结束,开始加结束表示,多云转雷阵雨】
【最高温度】【wendu1】【返回当日最高温度】
【最低温度】【wendu2】【返回当日最低温度】
【天气1图标】【img1】【返回当日天气1图标地址】
【天气2图标】【img2】【返回当日天气2图标地址】

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

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

返回数据示例:
示例:{"code":400,"msg":"通讯秘钥错误。"}
示例:{"data":[{"week1":"周四","week2":"04/04","wea1":"少云","wea2":"雷阵雨","wendu1":"25°","wendu2":"17°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w1.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w4.png"},{"week1":"周五","week2":"04/05","wea1":"阴","wea2":"阵雨","wendu1":"21°","wendu2":"17°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w33.png"},{"week1":"周六","week2":"04/06","wea1":"阵雨","wea2":"阵雨","wendu1":"18°","wendu2":"15°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w3.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w33.png"},{"week1":"周日","week2":"04/07","wea1":"阴","wea2":"阵雨","wendu1":"19°","wendu2":"15°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w33.png"},{"week1":"周一","week2":"04/08","wea1":"阴","wea2":"阵雨","wendu1":"20°","wendu2":"13°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w33.png"},{"week1":"周二","week2":"04/09","wea1":"阴","wea2":"阴","wendu1":"20°","wendu2":"15°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周三","week2":"04/10","wea1":"阴","wea2":"阴","wendu1":"23°","wendu2":"15°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周四","week2":"04/11","wea1":"阴","wea2":"阴","wendu1":"23°","wendu2":"15°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周五","week2":"04/12","wea1":"阴","wea2":"阴","wendu1":"25°","wendu2":"16°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周六","week2":"04/13","wea1":"少云","wea2":"阴","wendu1":"26°","wendu2":"17°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w1.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周日","week2":"04/14","wea1":"阴","wea2":"少云","wendu1":"27°","wendu2":"18°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w31.png"},{"week1":"周一","week2":"04/15","wea1":"少云","wea2":"少云","wendu1":"28°","wendu2":"19°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w1.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w31.png"},{"week1":"周二","week2":"04/16","wea1":"阴","wea2":"阴","wendu1":"27°","wendu2":"20°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周三","week2":"04/17","wea1":"阴","wea2":"阵雨","wendu1":"25°","wendu2":"19°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w33.png"},{"week1":"周四","week2":"04/18","wea1":"阴","wea2":"阴","wendu1":"20°","wendu2":"17°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"},{"week1":"周五","week2":"04/19","wea1":"阴","wea2":"阴","wendu1":"21°","wendu2":"15°","img1":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png","img2":"https://h5tq.moji.com/tianqi/assets/images/weather/w2.png"}],"code":200,"place":"三星堆博物馆, 四川省, 中国"}

参考资料(版权):
https://www.apihz.cn/api/tianqitqybmoji15ip.html

相关文章
|
14天前
|
API
国外地区经纬度查询免费API接口教程
此接口用于查询国外地区的经纬度信息,支持POST和GET请求方式。需提供用户ID、用户KEY、省级名称及具体地点。返回数据包括地区名称(中英文)、国家代码及经纬度等详细信息。示例请求与响应数据详见文档。
74 29
|
7月前
|
JSON JavaScript 前端开发
免费实时天气预报api接口
免费实时天气预报api接口
899 0
|
7月前
|
API
免费节假日api接口使用教程-聚合数据
免费节假日api接口使用教程-聚合数据
2614 0
免费节假日api接口使用教程-聚合数据
|
12天前
|
缓存 API
全球最新地震信息免费API接口教程
该接口提供全球最新地震信息,数据源自中国地震台网,每5分钟更新一次。支持POST/GET请求,需提供用户ID和KEY。返回数据包括地震等级、时间、经纬度、深度及位置等详细信息。示例请求和响应详见文档。
|
12天前
|
API
天气预报15日-墨迹天气-地址查询版免费API接口教程
该接口提供15日天气预报服务,通过指定地址获取墨迹天气预报。支持POST或GET请求,需提供用户ID、KEY、省份名称及地点等参数。返回数据包括15天内每天的天气详情,如最高最低温度、天气变化及图标等。示例中使用的ID和KEY为公共测试账号,建议使用个人账号以获得更高调用频率。
|
XML API 数据格式
天气预报API接口
原文:天气预报API接口 一、中央气象台API接口: 1.
18687 0
|
14天前
|
API
全国行政区划查询免费API接口教程
该接口提供全国(不含港澳台)各级行政区划查询服务,适用于地址填写、资料登记等场景。支持5级划分:省、市、区县、乡镇、村。请求需提供用户ID、KEY及查询级别等参数,返回地名列表或错误信息。 示例中ID和KEY为公共测试用,建议使用个人ID和KEY以享受更高调用频率。
72 23
|
11天前
|
API
万年历[取当日信息]免费API接口教程
此API提供万年历当天的详细信息,包括农历、星期、宜忌、生肖、星座、节日、五行、星宿等。支持POST和GET请求,需提供用户ID和KEY。返回数据包含阳历、农历、干支、节日列表等多项内容。示例URL:https://cn.apihz.cn/api/time/getday.php?id=88888888&key=88888888。
62 10
|
12天前
|
API 定位技术
天气预报1天-中国气象局-IP查询版免费API接口教程
此接口基于IP地址自动判断并提供该地区当日的天气信息,数据源自中国气象局。支持POST/GET请求,需提供用户ID和KEY,可选输入IP地址,默认返回北京天气。返回参数包括天气详情、地理位置及IP等。示例请求与响应详见文档。
|
13天前
|
API
天气预报1天-中国气象局-地址查询版免费API接口教程
此接口提供中国气象局官方的当日天气信息,支持POST和GET请求,需提供用户ID、KEY、省份及具体地点。返回数据包括状态码、消息、天气详情等。示例中使用的ID与KEY为公共测试用,建议使用个人ID与KEY以享受更高调用频次。