bilibili-API-collect/other/ip.md
2020-07-19 21:56:58 +08:00

57 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 通过ip确定位置
> http://api.bilibili.com/x/web-interface/zone
*请求方式GET*
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------- |
| code | num | 返回值 | 0成功 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 1 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ------------ | ---- | ------------- | ------------ |
| addr | str | 公网IP地址 | |
| country | str | 国家/地区名 | |
| province | str | 省/州 | 非必须存在项 |
| city | str | 城市 | 非必须存在项 |
| isp | str | 运营商名 | |
| latitude | num | 纬度 | |
| longitude | num | 经度 | |
| zone_id | num | | |
| country_code | num | 国家/地区代码 | |
**示例:**
```shell
curl 'http://api.bilibili.com/x/web-interface/zone'
```
```json
{
"code":0,
"message":"0",
"ttl":1,
"data":{
"addr":"36.40.120.145",
"country":"中国",
"province":"陕西",
"city":"渭南",
"isp":"电信",
"latitude":34.4995,
"longitude":109.492821,
"zone_id":4472912,
"country_code":86
}
}
```