返回首页

IP天气查询

/api/v1/iptq 0.02 积分/次 运行中

天气预报-天气查询-全国天气预报

 

请求示例
request
curl -X POST https://api.zhuimengapi.com/api/v1/iptq \
  -H "X-API-Key: RPA-xxxxxxxx"
  -d "ip=your_ip"
import requests

url = "https://api.zhuimengapi.com/api/v1/iptq"
headers = {"X-API-Key": "RPA-xxxxxxxx"}
data = {
  "ip": "your_ip"
}

res = requests.post(url, data=data, headers=headers)
print(res.json())
const axios = require('axios');

axios.post("https://api.zhuimengapi.com/api/v1/iptq", {
    ip: "your_ip"
}, {
  headers: { "X-API-Key": "RPA-xxxxxxxx" }
}).then(res => console.log(res.data));
响应示例
response.json
{
    "code": 0,
    "msg": "code对应的描述",
    "taskNo": "本次请求号",
    "data": {
        "area": "IP所在地区",
        "areaId": "地名id,详见地名说明",
        "province": "省份",
        "city": "城市",
        "now": {},
        "dayWeathers": []
    },
    "data.now.sd": "湿度",
    "data.now.aqi": "空气质量",
    "data.now.weather": "天气",
    "data.now.weather_pic": "天气图标",
    "data.now.temperature": "温度",
    "data.now.wind_direction": "风向",
    "data.now.wind_power": "风级",
    "data.dayWeathers.daytime": "日期",
    "data.dayWeathers.day_weather": "白天天气",
    "data.dayWeathers.day_weather_code": "白天天气编号,详见天气编号",
    "data.dayWeathers.day_weather_pic": "白天天气图标",
    "data.dayWeathers.day_high_temperature": "白天最高温度",
    "data.dayWeathers.day_wind_direction": "白天风向",
    "data.dayWeathers.day_wind_power": "白天风级",
    "data.dayWeathers.night_weather": "夜间天气",
    "data.dayWeathers.night_weather_code": "夜间天气编号",
    "data.dayWeathers.night_weather_pic": "夜间天气图标",
    "data.dayWeathers.night_low_temperature": "夜间最低温度",
    "data.dayWeathers.night_wind_direction": "夜间风向",
    "data.dayWeathers.night_wind_power": "夜间风级"
}
接口信息
请求地址 https://api.zhuimengapi.com/api/v1/iptq
请求方式 POST
Content-Type application/x-www-form-urlencoded
鉴权方式 X-API-Key: RPA-xxxxxxxx
ip string 必填
IP地址
code int 必填
状态码,详见code返回码说明
msg string 必填
code对应的描述
taskNo string 必填
本次请求号
data object 必填
返回数据
area string 必填
IP所在地区
areaId string 必填
地名id,详见地名说明
province string 必填
省份
city string 必填
城市
now object 必填
当前实时天气
dayWeathers array 必填
未来7天天气,按日期从早到晚排序
data.now.sd string 必填
湿度
data.now.aqi string 必填
空气质量
data.now.weather string 必填
天气
data.now.weather_pic string 必填
天气图标
data.now.temperature string 必填
温度
data.now.wind_direction string 必填
风向
data.now.wind_power string 必填
风级
data.dayWeathers.daytime string 必填
日期
data.dayWeathers.day_weather string 必填
白天天气
data.dayWeathers.day_weather_code string 必填
白天天气编号,详见天气编号
data.dayWeathers.day_weather_pic string 必填
白天天气图标
data.dayWeathers.day_high_temperature string 必填
白天最高温度
data.dayWeathers.day_wind_direction string 必填
白天风向
data.dayWeathers.day_wind_power string 必填
白天风级
data.dayWeathers.night_weather string 必填
夜间天气
data.dayWeathers.night_weather_code string 必填
夜间天气编号
data.dayWeathers.night_weather_pic string 必填
夜间天气图标
data.dayWeathers.night_low_temperature string 必填
夜间最低温度
data.dayWeathers.night_wind_direction string 必填
夜间风向
data.dayWeathers.night_wind_power string 必填
夜间风级
  • 200请求成功
  • 401API Key 无效或已过期,请检查密钥是否正确
  • 402余额不足,请充值后再试
  • 403IP 地址不在允许范围内或被限制访问
  • 404接口路由不存在,请检查接口地址
  • 429请求频率超限,请稍后再试
  • 500服务器内部错误,请联系技术支持
  • 502接口异常,或者传参错误,请联系技术支持
请求地址 https://api.zhuimengapi.com/api/v1/iptq
请求方式 POST
Content-Type application/x-www-form-urlencoded
鉴权 Header X-API-Key
Params Body
Params GET 请求只通过 URL 查询参数发送
Body 表单模式 POST + application/x-www-form-urlencoded 使用表单键值对请求体

快速信息

接口路由iptq
接口分类-
请求方式POST
计费方式0.02 积分/次
频率限制50 次/秒
认证方式X-API-Key
接口提供官方接口

如何调用

  1. 注册/登录本站账号
  2. 前往用户中心 → API密钥 ,创建一个密钥
  3. 在请求头添加 X-API-Key 携带密钥即可调用
  4. 每次成功调用将扣除 0.02 积分
前往创建 API 密钥