说明
本存储库收集了各种免费的IP查询API,无需配置任何密钥即可直接访问,使大家能够快速获取IP信息,如地理位置、ISP详细信息和网络类型。请根据自己的需求选择合适的API,持续更新中,欢迎star
API列表
1.可查询本机IP和通过IP查询信息
https://webapi-pc.meitu.com/common/ip_location
https://www.ip.cn/api/index?ip=&type=0
https://whois.pconline.com.cn/ipJson.jsp?ip=&json=true
https://api.vore.top/api/IPdata?ip=
http://demo.ip-api.com/json/?lang=zh-CN
2.只可查询本机(访客)IP信息
https://ip.useragentinfo.com/json
https://cdid.c-ctrip.com/model-poc2/h
https://vv.video.qq.com/checktime?otype=ojson
https://api.uomg.com/api/visitor.info?skey=1
https://test.ipw.cn/api/ip/myip?json
https://ipv4.my.ipinfo.app/api/ipDetails.php
https://g3.letv.com/r?format=1
3.只可通过IP查询信息
http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8&query=
https://get.geojs.io/v1/ip/geo/121.8.215.106.json
https://ipinfo.io/widget/demo/121.8.215.106
https://ipapi.com/ip_api.php?ip=121.8.215.106
https://db-ip.com/demo/home.php?s=121.8.215.106
https://mesh.if.iqiyi.com/aid/ip/info?version=1.1.1&ip=121.8.215.106
4.只需要获取IP
1.可查询本机IP和通过IP查询
地址①:https://webapi-pc.meitu.com/common/ip_location?ip=
请求类型:GET
请求参数:ip(可选)
请求示例:
# 查询本机ip
https://webapi-pc.meitu.com/common/ip_location
# 通过ip查询信息
https://webapi-pc.meitu.com/common/ip_location?ip=121.8.215.106
示例结果:
{
"reqid": "40b7cf49-ad3f-4184-acd3-9f5a574dc7c4",
"code": 0,
"data": {
"121.8.215.106": {
"area_code": "86",
"city": "广州市",
"city_id": 160063402,
"continent": "亚洲",
"continent_code": "AP",
"country_id": 100000,
"isp": "电信",
"latitude": 23.3283,
"longitude": 113.75837,
"nation": "中国",
"nation_code": "CN",
"province": "广东",
"province_id": 440000,
"subdivision_1_iso_code": "*",
"subdivision_1_name": "广东",
"subdivision_2_iso_code": "*",
"subdivision_2_name": "广州市",
"time_zone": "UTC+8"
}
}
}
地址②:https://www.ip.cn/api/index?ip=&type=0
请求类型:GET
请求参数:ip(可选)、type
请求示例:
# 查询本机ip(type=0)
https://www.ip.cn/api/index?ip=&type=0
# 通过ip查询信息(type=1)
https://www.ip.cn/api/index?ip=121.8.215.106&type=1
对于国外ip的位置信息不太准确
示例结果:
{
"rs": 1,
"code": 0,
"address": "中国 广东省 广州市 电信",
"ip": "121.8.215.106",
"isDomain": 0
}
地址③:https://whois.pconline.com.cn/ipJson.jsp?ip=&json=true
请求类型:GET
请求参数(可选):ip、json
请求示例:
# 查询本机ip
https://whois.pconline.com.cn/ipJson.jsp?ip=&json=true
# 通过ip查询信息
https://whois.pconline.com.cn/ipJson.jsp?ip=121.8.215.106&json=true
对于国外ip的位置信息不太准确
示例结果:
{
"ip": "121.8.215.106",
"pro": "广东省",
"proCode": "440000",
"city": "广州市",
"cityCode": "440100",
"region": "",
"regionCode": "0",
"addr": "广东省广州市 电信",
"regionNames": "",
"err": ""
}
地址④:https://api.vore.top/api/IPdata?ip=
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机ip
https://api.vore.top/api/IPdata?ip=
# 通过ip查询信息
https://api.vore.top/api/IPdata?ip=121.8.215.106
示例结果:
{
"code": 200,
"msg": "成功",
"ipinfo": {
"type": "ipv4",
"text": "121.8.215.106",
"cnip": true
},
"ipdata": {
"info1": "广东省",
"info2": "广州市",
"info3": "增城",
"isp": "电信"
},
"adcode": {
"o": "广东省广州市增城 - 电信",
"p": "广东",
"c": "广州",
"n": "广东-广州",
"r": "广东-广州",
"a": "440100",
"i": true
},
"tips": "接口由VORE-API(https://api.vore.top/)免费提供",
"time": 1708576755
}
请求类型:GET
请求参数(可选):你的ip
请求示例:
# 查询本机ip
https://api.ip.sb/geoip/
# 通过ip查询信息
https://api.ip.sb/geoip/121.8.215.106
示例结果:
{
"organization": "中国电信",
"longitude": 113.2539,
"city": "广州",
"timezone": "亚洲/上海",
"isp": "中国电信",
"offset": 28800,
"region": "广东",
"asn": 4134,
"asn_organization": "中国电信",
"country": "中国",
"ip": "121.8.215.106",
"latitude": 23.1181,
"continent_code": "AS",
"country_code": "CN",
"region_code": "GD"
}
地址⑥:https://api.ip2location.io/
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机ip
https://api.ip2location.io/
# 通过ip查询信息
https://api.ip2location.io/?ip=121.8.215.106
示例结果:
{
"ip": "121.8.215.106",
"country_code": "CN",
"country_name": "中国",
"region_name": "广东",
"city_name": "广州",
"latitude": 23.127361,
"longitude": 113.26457,
"zip_code": "510140",
"time_zone": "+08:00",
"asn": "4134",
"as": "亚太网络信息中心",
"is_proxy": true,
"message": "每天限制500次查询。在https://www.ip2location.io注册免费计划可获得每月30000次查询。"
}
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机ip
curl realip.cc
https://realip.cc/
https://realip.cc/simple # 只返回ip
# 通过ip查询信息
https://realip.cc/?ip=121.8.215.106
示例结果:
{
"ip": "103.143.161.60",
"city": "香港",
"province": null,
"country": "香港",
"continent": "亚洲",
"isp": "TWOWIN CO., LIMITED",
"time_zone": "亚洲/香港",
"latitude": 22.2842,
"longitude": 114.1759,
"postal_code": null,
"iso_code": "HK",
"network": "103.143.160.0/23",
"notice": "API文档在/docs路径下,调用并发数是有限制的 ©2021-09-27->now",
"provider": "由Bboysoul提供支持",
"blog": "https://www.bboy.app",
"tg_group": "https://t.me/bboyapp",
"data_updatetime": 202403010,
"count": 10345364
}
地址⑧:http://demo.ip-api.com/json/?fields=66842623&lang=zh-CN
请求类型:GET
请求参数(可选):ip、lang ...
请求示例:
# lang 可选值
en:英语(默认)
zh-CN:中文(中国)
de:德语
es:西班牙语
fr:法语
ja:日语
ru:俄语
# 注意是http !!!
# 查询本机ip
http://demo.ip-api.com/json/?fields=66842623&lang=zh-CN
# 通过ip查询信息
http://demo.ip-api.com/json/121.8.215.106?fields=66842623&lang=zh-CN
API文档:
https://ip-api.com/docs/api:json
示例结果:
{
"status": "成功",
"continent": "亚洲",
"continentCode": "AS",
"country": "中国",
"countryCode": "CN",
"region": "GD",
"regionName": "广东",
"city": "广州市",
"district": "",
"zip": "",
"lat": 23.1181,
"lon": 113.2539,
"timezone": "亚洲/上海",
"offset": 28800,
"currency": "CNY",
"isp": "中国电信",
"org": "中国电信广东",
"as": "AS4134 中国电信骨干网",
"asname": "中国电信骨干网",
"mobile": false,
"proxy": true,
"hosting": false,
"query": "121.8.215.106"
}
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机ip
https://ip-api.io/json
# 通过ip查询信息
https://ip-api.io/json?ip=121.8.215.106
示例结果:
{
"callingCode": "86",
"city": "广州",
"countryCapital": "北京",
"country_code": "CN",
"country_name": "中国",
"currency": "CNY",
"currencySymbol": "¥",
"emojiFlag": "🇨🇳",
"flagUrl": "https://ip-api.io/images/flags/cn.svg",
"ip": "121.8.215.106",
"is_in_european_union": false,
"latitude": 23.1181,
"longitude": 113.2539,
"metro_code": 0,
"organisation": "中国电信",
"region_code": "GD",
"region_name": "广东",
"suspiciousFactors": {
"isProxy": false,
"isSpam": false,
"isSuspicious": false,
"isTorNode": false
},
"time_zone": "亚洲/上海",
"zip_code": ""
}
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机ip
https://ipapi.co/json/
# 通过IP查询信息
https://ipapi.co/121.8.215.106/json/
示例结果:
{
"ip": "121.8.215.106",
"network": "121.8.128.0/17",
"version": "IPv4",
"city": "广州",
"region": "广东",
"region_code": "GD",
"country": "CN",
"country_name": "中国",
"country_code": "CN",
"country_code_iso3": "CHN",
"country_capital": "北京",
"country_tld": ".cn",
"continent_code": "AS",
"in_eu": false,
"postal": null,
"latitude": 23.1181,
"longitude": 113.2539,
"timezone": "Asia/Shanghai",
"utc_offset": "+0800",
"country_calling_code": "+86",
"currency": "CNY",
"currency_name": "人民币",
"languages": "zh-CN,yue,wuu,dta,ug,za",
"country_area": 9596960,
"country_population": 1411778724,
"asn": "AS4134",
"org": "中国电信"
}
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机IP
https://api.ipapi.is
# 通过IP查询信息
https://api.ipapi.is/?ip=121.8.215.106
示例结果:
{
"ip": "121.8.215.106",
"rir": "APNIC",
"is_bogon": false,
"is_mobile": false,
"is_crawler": false,
"is_datacenter": false,
"is_tor": false,
"is_proxy": true,
"is_vpn": false,
"is_abuser": true,
"company": {
"name": "中国电信广东省网络",
"abuser_score": "0.0003 (非常低)",
"domain": "chinatelecom.cn",
"type": "isp",
"network": "121.8.0.0 - 121.15.255.255",
"whois": "https://api.ipapi.is/?whois=121.8.0.0"
},
"asn": {
"asn": 4134,
"abuser_score": "0.0013 (低)",
"route": "121.8.0.0/13",
"descr": "中国电信骨干网 中国北京金融街31号",
"country": "cn",
"active": true,
"org": "北京金融街31号",
"domain": "chinatelecom.cn",
"abuse": "anti-spam@chinatelecom.cn",
"type": "商业",
"updated": "2021-06-15",
"rir": "APNIC",
"whois": "https://api.ipapi.is/?whois=AS4134"
},
"location": {
"continent": "AS",
"country": "中国",
"country_code": "CN",
"state": "广东",
"city": "广州",
"latitude": 23.117,
"longitude": 113.25,
"zip": "510800",
"timezone": "Asia/Shanghai",
"local_time": "2024-03-16T13:50:41+08:00",
"local_time_unix": 1710568241,
"is_dst": false
},
"elapsed_ms": 0.81
}
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机IP
https://api.ip.sb/geoip
# 通过IP查询信息
https://api.ip.sb/geoip/121.8.215.106
示例结果:
{
"organization": "中国电信",
"longitude": 113.2539,
"city": "广州",
"timezone": "Asia/Shanghai",
"isp": "中国电信",
"offset": 28800,
"region": "广东",
"asn": 4134,
"asn_organization": "中国电信",
"country": "中国",
"ip": "121.8.215.106",
"latitude": 23.1181,
"continent_code": "AS",
"country_code": "CN",
"region_code": "GD"
}
地址13:https://api.qjqq.cn/api/Local
请求类型:GET
请求参数(可选):ip
请求示例:
# 查询本机IP
https://api.qjqq.cn/api/Local
# 通过IP查询信息
https://api.qjqq.cn/api/district?ip=121.8.215.106
示例结果:
{
"code": 200,
"data": {
"ip": "222.79.44.74",
"continent": "亚洲",
"country_english": "",
"country": "中国",
"prov": "福建",
"city": "福州",
"district": "",
"isp": "电信",
"lat": "26.075302",
"lng": "119.306239",
"area_code": "350100",
"city_code": "0591",
"elevation": "29",
"time_zone": "Asia/Shanghai",
"weather_station": "CHXX0031",
"zip_code": "350000"
},
"msg": "success",
"ip": "222.79.44.74",
"time": "2024-04-07 18:38:08",
"source": "青桔API:api.qjqq.cn"
}
2.只可查询本机IP
地址①:https://ip.useragentinfo.com/json
请求类型:GET
请求参数:无
请求示例:
https://ip.useragentinfo.com/json
示例结果:
{
"country": "韩国",
"short_name": "KR",
"province": "首尔",
"city": "",
"area": "",
"isp": "微软云",
"net": "数据中心",
"ip": "20.249.16.173",
"code": 200,
"desc": "success"
}
请求类型:GET
请求参数:无
请求示例:
http://httpbin.org/ip
示例结果:
{
"origin": "20.249.16.173"
}
地址③:https://cdid.c-ctrip.com/model-poc2/h
请求类型:GET
请求参数:无
请求示例:
https://cdid.c-ctrip.com/model-poc2/h
示例结果:
20.249.16.173
地址④:https://vv.video.qq.com/checktime?otype=ojson
请求类型:GET
请求参数:otype
请求示例:
https://vv.video.qq.com/checktime?otype=ojson
otype=json时返回类型为jsonp
示例结果:
{
"s": "o",
"t": 1708586979,
"ip": "222.79.47.146",
"pos": "---",
"rand": "FRM_cmo206yshBHl5h4_9A=="
}
地址⑤:https://api.uomg.com/api/visitor.info?skey=1
请求类型:GET
请求参数:无
请求示例:
https://api.uomg.com/api/visitor.info?skey=1
示例结果:
{
"code": 1,
"ip": "20.249.16.173",
"system": "Windows 10 x64 版本",
"browser": "Chrome 114.0.0.0",
"time": "2024-02-22 15:37:33"
}
地址⑥:https://test.ipw.cn/api/ip/myip?json
请求类型:GET
请求参数:无
请求示例:
https://test.ipw.cn/api/ip/myip?json
示例结果:
{
"code": 1,
"ip": "20.249.16.173",
"system": "Windows 10 x64 版本",
"browser": "Chrome 114.0.0.0",
"time": "2024-02-22 15:37:33"
}
请求类型:GET
请求参数(可选):format
请求示例:
format:text, json, jsonp
# IPv4
https://api.ipify.org?format=json
# IPv6
https://api64.ipify.org/?format=json
示例结果:
{
"ip": "185.151.146.112"
}
地址⑧:https://ipv4.my.ipinfo.app/api/ipDetails.php
请求类型:GET
请求参数:无
请求示例:
https://ipv4.my.ipinfo.app/api/ipDetails.php
示例结果:
{
"ip": "8.210.218.24",
"asn": "AS45102 ALIBABA-CN-NET 阿里巴巴美国科技有限公司, CN",
"continent": "AS",
"continentLong": "亚洲",
"flag": "https://my.ipinfo.app/imgs/flags/4x3/sg.svg",
"country": "新加坡"
}
地址⑨:https://g3.letv.com/r?format=1
请求类型:GET
请求参数:format
请求示例:
# format=1 返回json
https://g3.letv.com/r?format=1
# format=2 返回XML
https://g3.letv.com/r?format=2
示例结果:
{
"ipint": "1957453184",
"host": "116.172.93.128",
"remote": "116.172.93.128",
"ipstart": "1957445632",
"ipend": "1957455871",
"geo": "CN.30.722.2",
"desc": "中国-宁夏-中卫市-联通",
"buss": "bussid=6,alv=80,orgqos=5,host=2,port=80",
"curtime": 1722063761,
"identify": "1731505687:8140",
"fixlist": "",
"qosfix": "",
"prior": "",
"manual": "",
"perfect": "0",
"recommend": "3345,50041,50042,50057,50058,50072,50073,50074,50075,50076",
"nodelist": [
{
"gone": 50041,
"name": "中国-北京市-第三方保留ISP-1",
"pid": 1,
"aid": 5,
"isp": 888,
"detail": "",
"location": "http://play4.cp21.ott.cibntv.net/letvabcdeasktf512K"
}
]
}
3.只可通过IP查询
地址①:http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8&query=
请求类型:GET
请求参数:query
请求示例:
https://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8&query=121.8.215.106
示例结果:
{
"status": "0",
"t": "",
"set_cache_time": "",
"data": [
{
"ExtendedLocation": "",
"OriginQuery": "121.8.215.106",
"appinfo": "",
"disp_type": 0,
"fetchkey": "121.8.215.106",
"location": "广东省广州市 电信",
"origip": "121.8.215.106",
"origipquery": "121.8.215.106",
"resourceid": "6006",
"role_id": 0,
"shareImage": 1,
"showLikeShare": 1,
"showlamp": "1",
"titlecont": "IP地址查询",
"tplt": "ip"
}
]
}
地址②:https://get.geojs.io/v1/ip/geo/121.8.215.106.json
请求类型:GET
请求参数:你的ip
请求示例:
https://get.geojs.io/v1/ip/geo/121.8.215.106.json
示例结果:
{
"country": "中国",
"timezone": "亚洲/上海",
"ip": "121.8.215.106",
"organization": "AS4134 中国电信",
"asn": 4134,
"area_code": "0",
"organization_name": "中国电信",
"country_code": "CN",
"country_code3": "CHN",
"continent_code": "AS",
"latitude": "23.1181",
"region": "广东",
"city": "广州",
"longitude": "113.2539",
"accuracy": 1000
}
地址③:https://ipinfo.io/widget/demo/121.8.215.106
请求类型:GET
请求参数:你的ip
请求示例:
https://ipinfo.io/widget/demo/121.8.215.106
示例结果:
{
"input": "121.8.215.106",
"data": {
"ip": "121.8.215.106",
"city": "深圳",
"region": "广东",
"country": "CN",
"loc": "22.5455,114.0683",
"org": "AS4134 中国电信骨干网",
"timezone": "亚洲/上海",
"asn": {
"asn": "AS4134",
"name": "中国电信骨干网",
"domain": "chinatelecom.com.cn",
"route": "121.8.0.0/13",
"type": "isp"
},
"company": {
"name": "中国电信广东省网络",
"domain": "chinatelecom.cn",
"type": "isp"
},
"privacy": {
"vpn": false,
"proxy": false,
"tor": false,
"relay": false,
"hosting": false,
"service": ""
},
"abuse": {
"address": "北京市金融街31号,邮编100032",
"country": "CN",
"email": "anti-spam@chinatelecom.cn",
"name": "中国电信滥用投诉",
"network": "121.8.0.0/13",
"phone": "+000000000"
}
}
}
地址④:https://ipapi.com/ip_api.php?ip=121.8.215.106
请求类型:GET
请求参数:ip
请求示例:
https://ipapi.com/ip_api.php?ip=121.8.215.106
示例结果:
{
"ip": "121.8.215.106",
"hostname": "121.8.215.106",
"type": "ipv4",
"continent_code": "AS",
"continent_name": "亚洲",
"country_code": "CN",
"country_name": "中国",
"region_code": "GD",
"region_name": "广东",
"city": "广州",
"zip": "510000",
"latitude": 23.124719619750977,
"longitude": 113.23860931396484,
"location": {
"geoname_id": 1809858,
"capital": "北京",
"languages": [
{
"code": "zh",
"name": "中文",
"native": "中文"
}
],
"country_flag": "https://assets.ipstack.com/flags/cn.svg",
"country_flag_emoji": "🇨🇳",
"country_flag_emoji_unicode": "U+1F1E8 U+1F1F3",
"calling_code": "86",
"is_eu": false
},
"time_zone": {
"id": "Asia/Shanghai",
"current_time": "2024-03-15T15:14:15+08:00",
"gmt_offset": 28800,
"code": "CST",
"is_daylight_saving": false
},
"currency": {
"code": "CNY",
"name": "人民币",
"plural": "人民币",
"symbol": "CN¥",
"symbol_native": "CN¥"
},
"connection": {
"asn": 4134,
"isp": "中国电信"
},
"security": {
"is_proxy": false,
"proxy_type": null,
"is_crawler": false,
"crawler_name": null,
"crawler_type": null,
"is_tor": false,
"threat_level": "低",
"threat_types": null
}
}
地址⑤:https://db-ip.com/demo/home.php?s=121.8.215.106
请求类型:GET
请求参数:s=你的ip
请求示例:
https://db-ip.com/demo/home.php?s=121.8.215.106
示例结果:
{
"status": "ok",
"demoInfo": {
"ipAddress": "121.8.215.106",
"continentCode": "AS",
"continentName": "亚洲",
"countryCode": "CN",
"countryName": "中国",
"isEuMember": false,
"currencyCode": "CNY",
"currencyName": "人民币",
"phonePrefix": "86",
"languages": [
"zh-CN",
"yue",
"wuu",
"dta",
"ug",
"za"
],
"stateProvCode": "GD",
"stateProv": "广东",
"district": "广州",
"city": "小楼",
"geonameId": 1790085,
"latitude": 23.379,
"longitude": 113.763,
"gmtOffset": 8,
"timeZone": "Asia/Shanghai",
"weatherCode": "CHXX5497",
"asNumber": 4134,
"asName": "中国电信骨干网",
"isp": "中国电信",
"usageType": "企业",
"organization": "中国电信广东",
"isCrawler": false,
"isProxy": false,
"threatLevel": "高",
"threatDetails": [
"攻击源",
"攻击目标:网络"
]
}
}
地址⑥:https://mesh.if.iqiyi.com/aid/ip/info?version=1.1.1&ip=21.8.215.106
请求类型:GET
请求参数:ip=查询的ip地址
请求示例:
https://mesh.if.iqiyi.com/aid/ip/info?version=1.1.1&ip=121.8.215.106
示例结果:
{
"code": "0",
"msg": "成功",
"data": {
"continentCN": "亚洲",
"countryCN": "中国",
"zoneCN": "华南",
"provinceCN": "广东",
"cityCN": "广州",
"countyCN": "增城区",
"townCN": "*",
"ispCN": "电信",
"continentID": 1,
"countryID": 48,
"zoneID": 5,
"provinceID": 3,
"cityID": 3001,
"countyID": 3001012,
"ispID": 26,
"townID": 0,
"latitude": "23.328300",
"longitude": "113.758370",
"overseasRegion": false
}
}
当ip参数值为空时,查询的是请求者的地址信息。
4.更多
1.只返回本机(访客)IP地址,通过curl访问测试
- 请求类型:GET
curl ifconfig.me
curl ifconfig.es
curl icanhazip.com
curl ipinfo.io/ip
curl ipecho.net/ip
curl ident.me
curl eth0.me
curl ipaddr.site
curl ipaddress.sh
curl l2.io/ip
curl tnx.nl/ip
curl wgetip.com
curl ip.tyk.nu
curl curlmyip.net
curl ipcalf.com
curl checkip.amazonaws.com
示例结果:
121.8.215.106