Path: http://ip:port/query (将ip和port使用实际运行服务的IP和端口)
Method: GET
接口描述:
返回结果JSON格式参照1:
{
"code": 0,
"msg": "success",
"result": {
"country": "中国",
"province": "江苏",
"city": "无锡",
"district": "",
"isp": "电信"
}
}
返回结果JSON格式参照2:
{
"code": 201,
"msg": "ip format error",
"result": null
}
Query
| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| ip | 是 | 58.215.154.11 | 需要查询的IPv4地址 |
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| code | number | 非必须 | 返回码, 0:表示请求成功 其他表示请求错误 | ||
| msg | string | 非必须 | 返回描述 | ||
| result | object | 非必须 | 返回结果, 可能为null | ||
| ├─ country | string | 非必须 | 国家/地区, 可能为空 | ||
| ├─ province | string | 非必须 | 省份, 可能为空 | ||
| ├─ city | string | 非必须 | 城市, 可能为空 | ||
| ├─ district | string | 非必须 | 区域, 可能为空 | ||
| ├─ isp | string | 非必须 | 运营商, 可能为空 |