获取本机IP

bilibili

获取当前 IP 地址 以及大概位置的接口

1
https://api.bilibili.com/x/web-interface/zone

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"addr": "23.95.20.176",
"country": "美国",
"province": "加利福尼亚州",
"city": "圣克拉拉",
"isp": "colocrossing.com",
"latitude": 37.355701,
"longitude": -121.955002,
"zone_id": 29409504,
"country_code": 1
}
}

ip.sb

1
https://api.ip.sb/ip -A Mozilla

返回格式

1
156.238.233.37

百度云盘

1
https://d.pcs.baidu.com/rest/2.0/pcs/file?method=locateupload

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"bak_server": [
"c.pcs.baidu.com"
],
"client_ip": "43.134.99.64",
"error_code": 0,
"error_msg": "",
"expire": 60,
"host": "c.pcs.baidu.com",
"newno": "",
"quic_server": [
"https://c3.pcs.baidu.com"
],
"request_id": 2.1707703965593718e+18,
"server": [
"c.pcs.baidu.com",
"c2.pcs.baidu.com",
"c3.pcs.baidu.com"
],
"server_time": 1743747549,
"sl": 0
}

Tencent Map

1
2
3
4
5
6
7
8
9
10
11
12
13
14
https://h5gw.map.qq.com/ws/location/v1/ip?key=2J4BZ-PBHH2-VYGU4-CODCH-C4EA2-W4BAU&apptag=h5loc_ip_loc&output=json
https://apis.map.qq.com/ws/location/v1/ip?key=ACEBZ-FDXWP-WFRDV-VGS5Q-S2Q5K-HQBNA
https://apis.map.qq.com/ws/location/v1/ip?key=RMJBZ-2IP64-CSNUJ-DLU7O-O3DF7-MMB5E
https://apis.map.qq.com/ws/location/v1/ip?key=4RYBZ-4TRHF-GDOJU-NS5TO-3PIX7-LRF5F
https://apis.map.qq.com/ws/location/v1/ip?key=N7XBZ-NX764-OFOUH-D5LJY-KZ3QK-6WFNX
https://apis.map.qq.com/ws/location/v1/ip?key=3JLBZ-I2OWJ-3AAFI-KDLGM-UMDPO-Q6BRM
https://apis.map.qq.com/ws/location/v1/ip?key=EIMBZ-RBNH4-NZQUG-X7RKQ-3SPPH-YSFCX
https://apis.map.qq.com/ws/location/v1/ip?key=IDHBZ-7F2KM-SFY6S-6OQYE-6VWRE-WVB5N
https://apis.map.qq.com/ws/location/v1/ip?key=GWSBZ-HTTWJ-QJIF2-KLHLC-X3WKV-ZZFV6
https://apis.map.qq.com/ws/location/v1/ip?key=T3EBZ-TJ7LI-YRBG2-5ZLUR-KD3OS-U6BJO
https://apis.map.qq.com/ws/location/v1/ip?key=PTMBZ-GCQLW-SC2RG-R2FNI-HWPNQ-4PBQM
https://apis.map.qq.com/ws/location/v1/ip?key=PTMBZ-GCQLW-SC2RG-R2FNI-HWPNQ-4PBQM
https://apis.map.qq.com/ws/location/v1/ip?key=EP7BZ-JAOKQ-NIV55-GPNDX-CBPOQ-PHB7E
https://apis.map.qq.com/ws/location/v1/ip?key=OIVBZ-MQZ6X-V2T4C-TLTXF-2X755-6CBAZ

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"status": 0,
"message": "Success",
"request_id": "ee7af169ec7e41338bb859ef1338b64a",
"result": {
"ip": "43.134.99.64",
"location": {
"lat": 1.2833,
"lng": 103.85
},
"ad_info": {
"nation": "新加坡",
"province": "",
"city": "",
"district": "",
"adcode": -1,
"nation_code": 702
}
}
}

Tencent Video

1
https://disp-qryapi.3g.qq.com/v1/dispatch

返回格式

1
2
3
4
5
6
7
8
9
10
{
"code": 0,
"unitResults": {

},
"ipInfo": "新加坡##未知#",
"extra": {
"ip": "43.134.99.64"
}
}

网易邮箱大师

1
https://dashi.163.com/fgw/mailsrv-ipdetail/detail

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"code": 200,
"desc": "DONE",
"success": "false",
"result": {
"country": "新加坡",
"province": "新加坡",
"provinceEn": "Nordrhein-Westfalen",
"city": "新加坡",
"org": "6 COLLYER QUAY",
"isp": "腾讯",
"latitude": "1.3667",
"longitude": "103.8",
"timezone": "Asia/Singapore",
"countryCode": "SG",
"continentCode": "AS",
"provinceCode": "UNKNOWN",
"continent": "亚洲",
"county": "UNKNOWN",
"ispId": "0",
"ip": "43.134.99.64",
"zone": "gz"
}
}

央视网

1
https://ip.apps.cntv.cn/whereis?client=json

返回格式

1
2
3
4
5
6
7
{
"isp_code": "10",
"city_code": "",
"province_code": "",
"country_code": "SG",
"ip": "43.134.99.64"
}

美图设计室

1
https://webapi.designkit.com/common/ip_location

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"reqid": "b9b36cc1-4838-4c0b-9efe-4dd058a57087",
"code": 0,
"data": {
"43.134.99.64": {
"area_code": "*",
"city": "Singapore",
"city_id": 160024281,
"continent": "*",
"continent_code": "AP",
"country_id": 17020000,
"isp": "腾讯",
"latitude": 1.286529,
"longitude": 103.853519,
"nation": "Singapore",
"nation_code": "SG",
"province": "Singapore",
"province_id": 160024280,
"subdivision_1_iso_code": "*",
"subdivision_1_name": "Singapore",
"subdivision_2_iso_code": "*",
"subdivision_2_name": "Singapore",
"time_zone": "UTC+8"
}
}
}

12306

1
https://exservice.12306.cn/excater/bonree/grip

返回格式

1
2
3
{
"di": "43.134.99.64"
}

获取指定IP

ipinfo

1
https://ipinfo.io/${ip}/json

返回格式

1
2
3
4
5
6
7
8
9
10
11
{
"ip": "156.238.233.37",
"city": "Tseung Kwan O",
"region": "Sai Kung",
"country": "HK",
"loc": "22.3279,114.2499",
"org": "AS137899 I LAYER LIMITED",
"postal": "999077",
"timezone": "Asia/Hong_Kong",
"readme": "https://ipinfo.io/missingauth"
}

淘宝

1
https://ip.taobao.com/outGetIpInfo?accessKey=alibaba-inc&ip=${ip}

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"data": {
"area": "",
"country": "中国",
"isp_id": "xx",
"queryIp": "114.114.114.114",
"city": "南京",
"ip": "114.114.114.114",
"isp": "XX",
"county": "",
"region_id": "320000",
"area_id": "",
"county_id": null,
"region": "江苏",
"country_id": "CN",
"city_id": "320100"
},
"msg": "query success",
"code": 0
}

美团

1
https://apimobile.meituan.com/locate/v2/ip/loc?client_source=yourAppKey&rgeo=true&ip=${ip}

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"data": {
"lng": 113.42,
"fromwhere": "mars-mt",
"ip": "1.1.11.1",
"rgeo": {
"country": "中国",
"province": "广东省",
"adcode": "440115",
"city": "广州",
"district": "南沙区"
},
"lat": 22.86
}
}

Baidu

1
https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query=${ip}&resource_id=5809

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"Srcid": "5809",
"ResultCode": "0",
"status": "0",
"QueryID": "1838400662",
"Result": [
{
"DisplayData": {
"strategy": {
"tempName": "ip",
"precharge": "0",
"ctplOrPhp": "1"
},
"resultData": {
"tplData": {
"arrData": [],
"intStatus": "1",
"errmsg": "",
"data_source": "AE"
},
"extData": {
"tplt": "ip",
"resourceid": "5809",
"OriginQuery": "1.1.1.1"
}
}
},
"ResultURL": "http://www.ip138.com/",
"Weight": "2",
"Sort": "1",
"SrcID": "5809",
"ClickNeed": "0",
"SubResult": [],
"SubResNum": "0",
"ar_passthrough": [],
"RecoverCacheTime": "0"
}
],
"data": [
{
"arrData": [],
"intStatus": "1",
"errmsg": ""
}
],
"ResultNum": "1"
}

哔哩哔哩

1
https://api.live.bilibili.com/ip_service/v1/ip_service/get_ip_addr?ip=${ip}
1
https://api.live.bilibili.com/client/v1/Ip/getInfoNew?ip=${ip}

上方接口等效

返回格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"code": 0,
"msg": "",
"message": "",
"data": {
"addr": "121.229.130.184",
"country": "中国",
"province": "江苏",
"city": "苏州",
"isp": "电信",
"latitude": "31.3092",
"longitude": "120.613121"
}
}