Appearance
IP信息查询
查询任意IP地址的详细信息,包括地理位置、ISP信息、IP类型和质量评分。支持查询当前请求IP或指定IP地址。
接口列表
| 接口 | 方法 | 描述 |
|---|---|---|
| 获取IP基本信息 | GET | 查询IP的地理位置和基本信息 |
| 获取IP质量评分 | GET | 查询IP的质量得分和详细分析 |
获取IP基本信息
查询IP地址的基本信息,包括地理位置、ISP、时区等。
接口信息
| 项目 | 说明 |
|---|---|
| 接口地址 | https://api.ipflex.ink/token/check/ip |
| 请求方法 | GET |
| 认证方式 | 无需认证 |
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
ip | string | 否 | 要查询的IP地址,不传则查询当前请求IP | 203.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"
}
}响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 状态码,0表示成功 |
msg | string | 响应消息 |
data.ip | string | IP地址 |
data.country | string | 国家名称 |
data.country_code | string | 国家代码(ISO 3166-1 alpha-2) |
data.city | string | 城市名称 |
data.state | string | 州/省名称(可能为null) |
data.autonomous_system_number | integer | ASN(自治系统编号) |
data.autonomous_system_organization | string | AS组织名称 |
data.network_type | string | 网络类型(如 Cloud Provider) |
data.is_isp | boolean | 是否为ISP |
data.network | string | 网络地址段 |
获取IP质量评分
查询IP地址的质量评分和详细分析,包括多维度评分和风险评估。
接口信息
| 项目 | 说明 |
|---|---|
| 接口地址 | https://api.ipflex.ink/api/v1/ip-quality/{ip} |
| 请求方法 | GET |
| 认证方式 | Bearer Token(从后台获取) |
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
ip | string | 是 | 要查询的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"
}响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
ip | string | IP地址 |
scores | object | 各维度评分(0-100) |
scores.reputation | integer | 信誉评分 |
scores.anonymity | integer | 匿名性评分 |
scores.speed | integer | 速度评分 |
scores.stability | integer | 稳定性评分 |
scores.security | integer | 安全性评分 |
details | object | 详细信息 |
details.blacklist_count | integer | 黑名单数量 |
details.abuse_reports | integer | 滥用报告数量 |
details.spam_score | integer | 垃圾邮件评分(0-100) |
details.threat_level | string | 威胁等级:low、medium、high |
details.last_seen | string | 最后活跃时间 |
average_score | float | 平均评分 |
grade | string | 综合评级:A、B、C、D、F |
location | object | 地理位置信息 |
is_datacenter | boolean | 是否为数据中心IP |
is_proxy | boolean | 是否为代理IP |
is_residential | boolean | 是否为住宅IP |
isp | string | ISP名称 |
asn | string | ASN编号 |
评分等级说明
综合评级
| 评级 | 平均分 | 说明 | 适用场景 |
|---|---|---|---|
| A | 85-100 | 优秀 | 所有场景 |
| B | 70-84 | 良好 | 大多数场景 |
| C | 55-69 | 一般 | 低风险场景 |
| D | 40-54 | 较差 | 谨慎使用 |
| F | 0-39 | 不推荐 | 不建议使用 |
威胁等级
| 等级 | 说明 | 建议 |
|---|---|---|
low | 低风险,安全可靠 | 可以正常使用 |
medium | 中等风险,需要注意 | 谨慎使用,监控异常 |
high | 高风险,存在威胁 | 不建议使用 |