一些免费IP查询API

下文中所有本机IP均为代理IP地址或阿里云DNS地址,并非本人真实IP
没有特殊说明,返回格式均为json
未完待续

1. https://webapi-pc.meitu.com/common/ip_location

可选参数:ip

特点:

  • 支持查询指定IP地址
  • 支持查询本机IP地址
  • 支持ipv4和ipv6
  • 查询中国大陆ip返回中文,海外ip英文
  • 数据较为详细

示例

1
2
3
4
## 查询本机ip
https://webapi-pc.meitu.com/common/ip_location
## 查询指定ip
https://webapi-pc.meitu.com/common/ip_location?ip=223.5.5.5

返回结果示例

境内ip

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": "b40dad76-0770-4a9c-8f95-d6973b30f15e",
"code": 0,
"data": {
"223.5.5.5": {
"area_code": "86",
"city": "*",
"city_id": 0,
"continent": "亚洲",
"continent_code": "AP",
"country_id": 100000,
"isp": "阿里云",
"latitude": 39.902798,
"longitude": 116.401159,
"nation": "中国",
"nation_code": "CN",
"province": "*",
"province_id": 0,
"subdivision_1_iso_code": "*",
"subdivision_1_name": "*",
"subdivision_2_iso_code": "*",
"subdivision_2_name": "*",
"time_zone": "UTC+8"
}
}
}

境外ip

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": "345ae1cf-7eef-4bd5-8de9-c760b43af655",
"code": 0,
"data": {
"205.178.182.66": {
"area_code": "*",
"city": "New York City",
"city_id": 18404833,
"continent": "*",
"continent_code": "NA",
"country_id": 18400000,
"isp": "Tempest Hosting, LLC",
"latitude": 40.71455,
"longitude": -74.007141,
"nation": "United States",
"nation_code": "US",
"province": "New York",
"province_id": 18404800,
"subdivision_1_iso_code": "*",
"subdivision_1_name": "New York",
"subdivision_2_iso_code": "*",
"subdivision_2_name": "New York City",
"time_zone": "UTC-5"
}
}
}

2. https://api.mir6.com/api/ip_json

可选参数:ip

特点:

  • 支持查询指定IP地址
  • 支持查询本机IP地址
  • 支持ipv4和ipv6(ipv6支持精确到区级)
  • 境内IP数据都较为详细
  • 支持多种返回格式

缺点:

  • 自动查询ip时存在识别不准的情况
  • 查询境外ip时返回数据不完整

示例

1
2
3
4
5
6
## 查询本机ip
https://api.mir6.com/api/ip_json
## 查询指定ip
https://api.mir6.com/api/ip_json?ip=223.5.5.5
## 查询本机ip(ini格式)
https://api.mir6.com/api/ip?type=ini

返回结果示例(json格式)

境外ip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"code": 200,
"msg": "success",
"data": {
"ip": "205.178.182.66",
"dec": "3451041346",
"country": "美国",
"countryCode": "US",
"province": "",
"city": "",
"districts": "",
"idc": "",
"isp": "",
"net": "",
"zipcode": "",
"areacode": "",
"protocol": "IPv4",
"location": "美国[US]",
"myip": "205.178.182.66",
"time": "2024-05-27 00:53:50"
}
}

境内ip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"code": 200,
"msg": "success",
"data": {
"ip": "223.5.5.5",
"dec": "3741648133",
"country": "中国",
"countryCode": "CN",
"province": "浙江省",
"city": "杭州市",
"districts": "",
"idc": "阿里云DNS",
"isp": "阿里云",
"net": "数据中心",
"zipcode": "310000",
"areacode": "0571",
"protocol": "IPv4",
"location": "中国[CN] 浙江省 杭州市",
"myip": "205.178.182.66",
"time": "2024-05-27 00:55:55"
}
}

3. https://api.ip.sb/zh-cn/geoip

可选参数:ip

特点:

  • 支持查询指定IP地址
  • 支持查询本机IP地址
  • 支持ipv4和ipv6自识别
  • ipv4和ipv6都有独立接口

缺点:

  • ipv6数据不完整
  • 返回数据仅英语
  • 大陆访问速度相对慢

示例

1
2
3
4
5
6
7
8
## 查询本机ip
https://api.ip.sb/geoip
## 查询指定ip
https://api.ip.sb/geoip/223.5.5.5
## 指定ipv4接口
https://api-ipv4.ip.sb/geoip
## 指定ipv6接口
https://api-ipv6.ip.sb/geoip

返回结果示例(json格式)

境外ip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"organization": "Path Network, Inc",
"longitude": -118.2707,
"city": "Los Angeles",
"timezone": "America/Los_Angeles",
"isp": "Path Network, Inc",
"offset": -28800,
"region": "California",
"asn": 36231,
"asn_organization": "TEMPEST-HOSTING",
"country": "United States",
"ip": "205.178.182.66",
"latitude": 34.0515,
"postal_code": "90017",
"continent_code": "NA",
"country_code": "US",
"region_code": "CA"
}

境内ip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"organization": "Hangzhou Alibaba Advertising Co.",
"longitude": 120.1612,
"city": "Hangzhou",
"timezone": "Asia/Shanghai",
"isp": "Hangzhou Alibaba Advertising Co.",
"offset": 28800,
"region": "Zhejiang",
"asn": 37963,
"asn_organization": "Hangzhou Alibaba Advertising Co.,Ltd.",
"country": "China",
"ip": "223.5.5.5",
"latitude": 30.2994,
"continent_code": "AS",
"country_code": "CN",
"region_code": "ZJ"
}

参考:https://github.com/ihmily/ip-info-api