海外套餐API文档

更新时间:2026-07-09

本文档介绍如何通过 API 提取海外地区的代理 IP,支持按大洲、国家、地区、城市、运营商进行筛选,并提供完整的请求参数、响应字段及错误码说明。

一、请求地址

http://api.fanproxy.com/?key=abc123&cnt=AS&cty=JP&count=2&pattern=json&rcnt=true&rcty=true&rreg=true&risp=true&rexp=true

二、请求参数

参数名 类型 必填 默认值 说明
key string - 提取 Key(客户授权凭证)
cnt string - 大洲代码,如 AS(亚洲)、EU(欧洲)、NA(北美)
cty string - 国家代码,如 US、JP、GB
reg string - 地区代码
city string - 城市代码
count int 1 提取数量
ttl int - IP 时效(分钟),指定 IP 的使用时长
pattern string txt 返回格式:txt(纯文本)或 json
txtSplit string \r\n 返回格式为 txt 时的分隔符,支持转义字符 \r、\n、\t
ipv int - IP 版本:4 或 6
rcnt bool false 是否在响应中返回大洲信息(仅 pattern=json 时有效)
rcty bool false 是否在响应中返回国家信息(仅 pattern=json 时有效)
rreg bool false 是否在响应中返回地区信息(仅 pattern=json 时有效)
rcity bool false 是否在响应中返回城市信息(仅 pattern=json 时有效)
risp bool false 是否在响应中返回运营商信息(仅 pattern=json 时有效)
rexp bool false 是否在响应中返回 IP 过期时间(仅 pattern=json 时有效)

三、响应字段

字段名 类型 说明 适用接口
ip string IP 地址 国内 / 海外
port int 端口号 国内 / 海外
continent string 大洲代码(如 AS) 海外(rcnt=true 时返回)
country string 国家代码(如 JP) 海外(rcty=true 时返回)
region string 省份名称(国内)/ 地区代码(海外) 国内 / 海外(rreg=true 时返回)
city string 城市名称(国内)/ 城市代码(海外) 国内 / 海外(rcity=true 时返回)
isp string 运营商名称 国内 / 海外(risp=true 时返回)
expire string IP 过期时间,格式 2006-01-02 15:04:05 国内 / 海外(rexp=true 时返回)

四、响应示例

JSON 格式(成功)

//pattern=json(成功)
{
  "code": 0,
  "message": "success",
  "data": [
    {
      "ip": "1.2.3.4",
      "port": 8080,
      "continent": "AS",
      "country": "JP",
      "region": "TK",
      "isp": "NTT",
      "expire": "2026-03-05 12:00:00"
    },
    {
      "ip": "5.6.7.8",
      "port": 9090,
      "continent": "AS",
      "country": "JP",
      "region": "OS",
      "isp": "SoftBank",
      "expire": "2026-03-05 12:00:00"
    }
  ]
}

//pattern=txt(成功,默认格式)
1.2.3.4:8080
5.6.7.8:9090

失败响应

{
  "code": 1303,
  "message": "no ip"
}

五、错误码

错误码 说明
0 成功
500 服务器内部错误
1000 无效参数
1001 客户不存在
1002 客户状态异常
1003 客户身份认证失败
1004 请求来源 IP 不在允许范围内
1005 地区校验失败
1006 客户认证类型错误
1101 套餐不存在
1102 套餐状态异常
1103 套餐已过期
1104 提取间隔限制
1105 超出单次提取数量限制
1106 流量已耗尽
1107 超出最大分配上限
1108 超出每日分配上限
1251 自动替换白名单 IP 失败
1252 校验白名单 IP 失败
1301 无可用 IP 池
1302 提取数量受限
1303 无可用 IP
1304 资源异常
1401 IP 分配异常