API接口文档
一、基础信息接口
1. 获取当前用户信息
请求方式: GET
请求路径: /api/users/me/info
请求参数 无
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"username": "socks5", // 用户名
"email": "user@example.com", // 邮箱
"api_key": "string", // api key
"set_password_status": 0 // 是否设置密码,0:未设置,1:已设置 默认1
},
"message": "success" // 返回结果, str类型
}
2. 获取钱包信息
请求方式: GET
请求路径: /api/users/wallet/info
请求参数 无
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"dc_price": 200, // 机房流量单价(美分)
"res_price": 533, // 住宅流量单价(美分)
"mobile_price": 1104, // 移动流量单价(美分)
"total_recharge": 136300, // 总充值(美分)
"total_consume": 131300, // 总消费(美分)
"balance": 5000 // 余额(美分)
},
"message": "success" // 返回结果, str类型
}
二、子账号管理接口
1. 创建子账号
请求方式: POST
请求路径: /api/users/subuser/create
请求参数
json
{
"username": "string", // 子账号名
"password": "string", // 子账号密码
"remark": "", // 备注
"status": "active", // 子账号状态 active:激活 inactive:未激活
"res_traffic_limit": 0, // 使用住宅流量限制(GB),0表示不限制
"dc_traffic_limit": 0, // 使用机房流量限制(GB),0表示不限制
"mobile_traffic_limit": 0 // 使用移动流量限制(GB),0表示不限制
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
2. 获取子账号列表
请求方式: GET
请求路径: /api/users/subuser/list
请求参数
json
{
"page": 1, // 分页索引, int类型, 非必传, 默认1
"page_size": 10, // 分页条数, int类型, 非必传, 默认10
"user_name": "", // 用户名
"status":"active" // 子账号状态 active:激活 inactive:未激活
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"records": [
{
"id": 0, // 子账号ID
"username": "string", // 子账号名
"password": "string", // 子账号密码
"remark": "", // 备注
"status": "active", // 子账号状态 active:激活 inactive:未激活
"res_traffic_limit": 0, // 使用住宅流量限制(GB),0表示不限制
"dc_traffic_limit": 0, // 使用机房流量限制(GB),0表示不限制
"mobile_traffic_limit": 0, // 使用移动流量限制(GB),0表示不限制
"used_res_traffic": 0, // 已使用住宅流量(Byte)
"used_dc_traffic": 0, // 已使用机房流量(Byte)
"used_mobile_traffic": 0, // 已使用移动流量(Byte)
"create_time": "2025-09-14 06:22:26", // 创建时间
"update_time": "2025-09-14 06:22:26" // 修改时间
}
],
"total": 0 // 总条数
},
"message": "success" // 返回结果, str类型
}
3. 更新子账号
请求方式: POST
请求路径: /api/users/subuser/update
请求参数
json
{
"id": 0, // 子账号ID,必填
"remark": "string", // 备注,非必填
"password": "string", // 子账号密码,非必填
"status": "active", // 子账号状态 active:激活 inactive:未激活,非必填
"res_traffic_limit": 0, // 使用住宅流量限制(GB),0表示不限制,非必填
"dc_traffic_limit": 0, // 使用机房流量限制(GB),0表示不限制,非必填
"mobile_traffic_limit": 0 // 使用移动流量限制(GB),0表示不限制,非必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
4. 获取子账号信息
请求方式: GET
请求路径: /api/users/subuser/{subuser id}
请求参数
json
{
"subuser_id": 0 // 子账号ID,必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"id": 0, // 子账号ID
"username": "string", // 子账号名
"password": "string", // 子账号密码
"remark": "", // 备注
"status": "active", // 子账号状态 active:激活 inactive:未激活
"res_traffic_limit": 0, // 使用住宅流量限制(GB),0表示不限制
"dc_traffic_limit": 0, // 使用机房流量限制(GB),0表示不限制
"mobile_traffic_limit": 0, // 使用移动流量限制(GB),0表示不限制
"used_res_traffic": 0, // 已使用住宅流量(Byte)
"used_dc_traffic": 0, // 已使用机房流量(Byte)
"used_mobile_traffic": 0, // 已使用移动流量(Byte)
"create_time": "2025-09-14 06:22:26", // 创建时间
"update_time": "2025-09-14 06:22:26" // 修改时间
},
"message": "success" // 返回结果, str类型
}
三、白名单管理接口
1. 获取白名单
请求方式: GET
请求路径: /api/users/proxy/whitelist
请求参数
json
{
"page": 1, // 分页索引, int类型, 非必传, 默认1
"page_size": 10, // 分页条数, int类型, 非必传, 默认10
"ip": "127.0.0.1" // ip地址
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"records": [
{
"id": 0, // 白名单id
"ip": "127.0.0.1", // ip地址
"remark": "string", // 备注
"create_time": "2025-09-14 06:49:12" // 创建时间
}
],
"total": 0 // 总条数
},
"message": "success" // 返回结果, str类型
}
2. 添加白名单
请求方式: POST
请求路径: /api/users/proxy/add-whitelist
请求参数
json
{
"ip": "127.0.0.1", // ip地址,必填
"remark": "string" // 备注
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
3. 删除白名单
请求方式: GET
请求路径: /api/users/proxy/delete-whitelist
请求参数
json
{
"id":1, // 白名单id, 必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
四、流量管理接口
1. 获取系统流量包列表
请求方式: GET
请求路径: /api/users/traffic/packages
请求参数
json
{
"proxy_type":"residential", // 流量类型,residential:住宅,datacenter:机房,mobile:移动
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"additionalProp1": [
{
"id": 0, // 流量包ID
"traffic_gb": 0, // 流量(GB)
"price": 0, // 单价(美分)
"duration": 0, // 购买时长(天)
"plan_type": "personal", // 流量包类型,personal:个人,enterprise:企业,custom:自定义
"is_hot": false, // 是否热门,false:否,true:是
"extra_add_traffic": 0, // 额外赠送流量(GB)
"plan_desc": "string", // 流量包描述
"create_time": "2025-09-14 07:00:23", // 创建时间
"update_time": "2025-09-14 07:00:23" // 更新时间
}
],
},
"message": "success" // 返回结果, str类型
}
2. 购买系统流量包
注:仅支持钱包扣款,请保证余额充足!
请求方式: GET
请求路径: /api/users/traffic/packages/purchase
请求参数
json
{
"traffic_package_id":100, // 流量包ID,必填
"payment_type":"wallet_only" // 支付方式,wallet_only:钱包支付 必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
3. 获取已购流量包
请求方式: GET
请求路径: /api/users/traffic/packages/current
请求参数 无
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"additionalProp1": {
"total_traffic": 0, // 流量包总流量(Byte)
"cost_traffic": 0, // 流量包消耗流量(Byte)
"status": "active", // 流量包状态,active:启用,inactive:禁用
"expire_time": "2025-09-14:32:33", // 流量包过期时间
"remark": "string", // 备注
"strategy": {
"auto_remind": "inactive", // 是否开启提醒,inactive:关闭,active:开启
"remind_gb": 1, // 提醒剩余额度(GB)
"remind_days": 1, // 提醒剩余天数
"auto_rebuy": "inactive", // 是否开启自动续订,inactive:关闭,active:开启
"rebuy_gb": 1, // 续订剩余(GB)
"rebuy_days": 1, // 续订剩余天数
"rebuy_package_id": 0, // 续订流量包ID
"rebuy_traffic_gb": 0, // 续订流量包流量(GB)
"rebuy_plan_type": "personal", // 续订流量包类型,personal:个人,enterprise:企业,custom:自定义
"rebuy_status": "normal" // 续订状态,normal:正常,insufficient:余额不足,failed:续费失败
}
}
},
"message": "success" // 返回结果, str类型
}
4. 获取主账号近30天流量趋势
注:只取最近30天数据
请求方式: GET
请求路径: /api/users/traffic/trend
请求参数
json
{
"start_date":"2025-09-14", // 开始时间,必填
"end_date":"2025-09-14", // 结束时间,必填
"proxy_type":"residential" // 流量类型,residential:住宅,datacenter:机房,mobile:移动,非必填,不填则获取所有
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"residential": [
{
"proxy_type": "residential", // 流量类型,residential:住宅,datacenter:机房,mobile:移动
"package_traffic": 0, // 流量包消耗流量(Byte)
"wallet_traffic": 0, // 钱包消耗流量(Byte)
"total_traffic": 0, // 总消耗流量(Byte)
"day": "2025-09-07", // 日期
"remark": "" // 备注
}
]
},
"message": "success" // 返回结果, str类型
}
5. 获取子用户近30天流量趋势
注:只取最近30天数据
请求方式: GET
请求路径: /api/users/traffic/{subuser id}/trend
请求参数
json
{
"subuser_id": 100, // 子用户ID,必填
"start_date":"2025-09-14", // 开始时间,必填
"end_date":"2025-09-14", // 结束时间,必填
"proxy_type":"residential" // 流量类型,residential:住宅,datacenter:机房,mobile:移动,非必填,不填则获取所有
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"residential": [
{
"proxy_type": "residential", // 流量类型,residential:住宅,datacenter:机房,mobile:移动
"package_traffic": 0, // 流量包消耗流量(Byte)
"wallet_traffic": 0, // 钱包消耗流量(Byte)
"total_traffic": 0, // 总消耗流量(Byte)
"day": "2025-09-07", // 日期
"remark": "" // 备注
}
]
},
"message": "success" // 返回结果, str类型
}
五、静态代理接口
1. 获取静态住宅国家列表
请求方式: GET
请求路径: /api/users/static/res/country
请求参数 无
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": [
{
"country_code": "hk", // 国家编码
"country_name": "香港" // 国家
}
],
"message": "success" // 返回结果, str类型
}
2. 获取静态机房&IPv6国家列表
请求方式: GET
请求路径: /api/users/static/dc/country
请求参数
json
{
"ip_type": "ipv4" // ip类型:ipv4/ipv6,默认ipv4,必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": [
{
"country_code": "hk", // 国家编码
"country_name": "香港" // 国家
}
],
"message": "success" // 返回结果, str类型
}
3. 获取价格列表
请求方式: GET
请求路径: /api/users/static/price/package
请求参数
json
{
"proxy_type": "res" // 代理类型:res:静态住宅IP,dc:静态机房IP,ipv6
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": [
{
"id": 0, // 代理ID
"proxy_type": "res", // 代理类型
"count": 0, // 数量
"discount": 0, // 折扣(0-100)长
"period": 0, // 有效期(单位:天)
"price": 0, // 价格(单位:美分)
"amount": 0 // 金额(单位:美分)
}
],
"message": "success" // 返回结果, str类型
}
4. 创建静态订单
注:仅支持钱包扣款,请保证余额充足!
请求方式: POST
请求路径: /api/users/static/order/create
请求参数
json
{
"proxy_type": "res", // 代理类型,res:住宅,dc:机房,ipv6:IPV6,必填
"country": "us", // 国家编码,必填
"protocol": "http", // 协议,http,socks5,http/socks5,必填
"price_package_id": 0, // 价格套餐ID,必填
"payment_type": "wallet_only" // 支付类型,wallet_only:钱包支付,必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
5. 续费静态订单
注:仅支持钱包扣款,请保证余额充足!
请求方式: POST
请求路径: /api/users/static/order/rebuy
请求参数
json
{
"proxy_type": "res", // 代理类型,res:住宅,dc:机房,ipv6:IPV6,必填
"proxy_ids": "10000,10001", // 续费代理id,必填
"payment_type": "wallet_only" // 支付类型,wallet_only:钱包支付,必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
6. 获取静态住宅IP列表
请求方式: POST
请求路径: /api/users/static/res/list
请求参数
json
{
"page": 1, // 分页索引, int类型, 非必传, 默认1
"page_size": 10, // 分页条数, int类型, 非必传, 默认10
"protocol": "http", // 协议,http,socks5,http/socks5
"proxy_address": "127.0.0.1", // IP地址
"order_no": "16987AE6182", // 订单号
"expire_start": "2025-09-1412:50:06.43", // 过期开始时间
"expire_end": "2025-09-14 12:50:06.43" // 过期结束时间
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"records": [
{
"order_no": "16987AE6182", // 订单号
"order_status": "16987AE6182", // 订单状态,pending:配置中,completed:已完成,refunding:退款中,changing:更换中
"proxy_address": "127.0.0.1", // IP地址
"proxy_port": "8080", // 端口号
"proxy_user": "socks5", // 代理用户名
"proxy_password": "socks5", // 代理密码
"protocol": "http", // 协议,http,socks5,http/socks5
"country": "us", // 国家编码
"remark": "string", // 备注
"auto_rebuy": "inactive", // 自动续费,inactive:否,active:是:
"rebuy_status": "normal", // 续费状态,normal:正常,insufficient:余额不足,failed:续费失败
"expire_time": "2025-09-14 12:57:38.42", // 过期时间
"create_time": "2025-09-14 12:57:38.42" // 创建时间
}
],
"total": 0 // 总条数
},
"message": "success" // 返回结果, str类型
}
7. 获取静态机房&IPv6代理列表
请求方式: POST
请求路径: /api/users/static/dc/list
请求参数
json
{
"page": 1, // 分页索引, int类型, 非必传, 默认1
"page_size": 10, // 分页条数, int类型, 非必传, 默认10
"protocol": "http", // 协议,http,socks5,http/socks5
"proxy_address": "127.0.0.1", // IP地址
"order_no": "16987AE6182", // 订单号
"expire_start": "2025-09-14 12:50:06", // 过期开始时间
"expire_end": "2025-09-14 12:50:06" // 过期结束时间
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"data": {
"records": [
{
"order_no": "16987AE6182", // 订单号
"order_status": "16987AE6182", // 订单状态,pending:配置中,completed:已完成,refunding:退款中,changing:更换中
"proxy_address": "127.0.0.1", // IP地址
"proxy_port": "8080", // 端口号
"proxy_user": "socks5", // 代理用户名
"proxy_password": "socks5", // 代理密码
"protocol": "http", // 协议,http,socks5,http/socks5
"country": "us", // 国家编码
"remark": "string", // 备注
"auto_rebuy": "inactive", // 自动续费,inactive:否,active:是:
"rebuy_status": "normal", // 续费状态,normal:正常,insufficient:余额不足,failed:续费失败
"expire_time": "2025-09-14 12:57:38.42", // 过期时间
"create_time": "2025-09-14 12:57:38.42" // 创建时间
}
],
"total": 0 // 总条数
},
"message": "success" // 返回结果, str类型
}
8. 修改自动续费开关
请求方式: POST
请求路径: /api/users/static/auto-rebuy
请求参数
json
{
"id": 0, // 自动续费ID,必填
"proxy_type": "res", // 代理类型,res:住宅,dc:机房,ipv6:IPV6,必填
"auto_rebuy": "inactive" // 自动续费开关,inactive:否,active:是
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}
9. 修改IP备注
请求方式: POST
请求路径: /api/users/static/remark
请求参数
json
{
"id": 0, // ID,必填
"proxy_type": "res", // 代理类型,res:住宅,dc:机房,ipv6:IPV6,必填
"remark": "string" // 备注,必填
}
返回结果
json
{
"code": 0, // 状态码, 0:成功,其他数字:失败,int类型
"message": "success" // 返回结果, str类型
}