Skip to content

IP信息查询

查询任意IP地址的详细信息,包括地理位置、ISP信息、IP类型和质量评分。支持查询当前请求IP或指定IP地址。

接口列表

接口方法描述
获取IP基本信息GET查询IP的地理位置和基本信息
获取IP质量评分GET查询IP的质量得分和详细分析

获取IP基本信息

查询IP地址的基本信息,包括地理位置、ISP、时区等。

接口信息

项目说明
接口地址https://api.ipflex.ink/token/check/ip
请求方法GET
认证方式无需认证

请求参数

参数名类型必填说明示例
ipstring要查询的IP地址,不传则查询当前请求IP203.0.113.42

提示

不传 ip 参数时,接口会自动返回当前请求的IP信息,可用于验证代理是否生效。

请求示例

bash
curl "https://api.ipflex.ink/token/check/ip?ip=203.0.113.42"
bash
curl "https://api.ipflex.ink/token/check/ip"
python
import requests

# 查询指定IP
response = requests.get(
    'https://api.ipflex.ink/token/check/ip',
    params={'ip': '203.0.113.42'}
)

print(response.json())

# 查询当前IP
response = requests.get('https://api.ipflex.ink/token/check/ip')
print(response.json())

响应示例

json
{
  "code": 0,
  "msg": "success",
  "data": {
    "ip": "20.205.22.225",
    "country": "Hong Kong",
    "country_code": "HK",
    "city": "Hong Kong",
    "state": null,
    "autonomous_system_number": 8075,
    "autonomous_system_organization": "MICROSOFT-CORP-MSN-AS-BLOCK",
    "network_type": "Cloud Provider",
    "is_isp": false,
    "network": "20.192.0.0/10"
  }
}

响应字段说明

字段类型说明
codeinteger状态码,0表示成功
msgstring响应消息
data.ipstringIP地址
data.countrystring国家名称
data.country_codestring国家代码(ISO 3166-1 alpha-2)
data.citystring城市名称
data.statestring州/省名称(可能为null)
data.autonomous_system_numberintegerASN(自治系统编号)
data.autonomous_system_organizationstringAS组织名称
data.network_typestring网络类型(如 Cloud Provider)
data.is_ispboolean是否为ISP
data.networkstring网络地址段

获取IP质量评分

查询IP地址的质量评分和详细分析,包括多维度评分和风险评估。

接口信息

项目说明
接口地址https://api.ipflex.ink/api/v1/ip-quality/{ip}
请求方法GET
认证方式Bearer Token(从后台获取)

请求参数

参数名类型必填说明示例
ipstring要查询的IP地址(路径参数)203.0.113.42

请求示例

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.ipflex.ink/api/v1/ip-quality/203.0.113.42"
python
import requests

headers = {'Authorization': 'Bearer YOUR_TOKEN'}
ip_address = '203.0.113.42'
response = requests.get(
    f'https://api.ipflex.ink/api/v1/ip-quality/{ip_address}',
    headers=headers
)

print(response.json())

响应示例

json
{
  "ip": "203.0.113.42",
  "scores": {
    "reputation": 85,
    "anonymity": 90,
    "speed": 78,
    "stability": 92,
    "security": 88
  },
  "details": {
    "blacklist_count": 0,
    "abuse_reports": 0,
    "spam_score": 5,
    "threat_level": "low",
    "last_seen": "2024-01-08T12:00:00Z"
  },
  "average_score": 86.6,
  "grade": "A",
  "location": {
    "country": "US",
    "country_name": "United States",
    "city": "Los Angeles",
    "latitude": 34.0522,
    "longitude": -118.2437
  },
  "is_datacenter": false,
  "is_proxy": false,
  "is_residential": true,
  "isp": "Example ISP",
  "asn": "AS15169"
}

响应字段说明

字段类型说明
ipstringIP地址
scoresobject各维度评分(0-100)
scores.reputationinteger信誉评分
scores.anonymityinteger匿名性评分
scores.speedinteger速度评分
scores.stabilityinteger稳定性评分
scores.securityinteger安全性评分
detailsobject详细信息
details.blacklist_countinteger黑名单数量
details.abuse_reportsinteger滥用报告数量
details.spam_scoreinteger垃圾邮件评分(0-100)
details.threat_levelstring威胁等级:lowmediumhigh
details.last_seenstring最后活跃时间
average_scorefloat平均评分
gradestring综合评级:ABCDF
locationobject地理位置信息
is_datacenterboolean是否为数据中心IP
is_proxyboolean是否为代理IP
is_residentialboolean是否为住宅IP
ispstringISP名称
asnstringASN编号

评分等级说明

综合评级

评级平均分说明适用场景
A85-100优秀所有场景
B70-84良好大多数场景
C55-69一般低风险场景
D40-54较差谨慎使用
F0-39不推荐不建议使用

威胁等级

等级说明建议
low低风险,安全可靠可以正常使用
medium中等风险,需要注意谨慎使用,监控异常
high高风险,存在威胁不建议使用


相关文档

基于 MIT 许可发布