FlashProxy API 参考
检查余额和计划、读取使用情况、生成代理和从你的脚本中延长计划。每个端点返回 JSON,仅读取你自己账户中的数据。
基础 URL:https://www.flashproxy.com
在你的仪表板 https://www.flashproxy.com/dashboard/api 中创建 API 密钥。完整密钥仅显示一次,请妥善保管。
使用 AI 代理?请将此完整参考作为一个 Markdown 文件提供给它:https://www.flashproxy.com/api-reference.md。OpenAPI 3.1 规范位于 https://www.flashproxy.com/openapi.json。
快速入门
列出你的计划,然后在其他端点中使用答案中的 plan_id。
cURL
curl "https://www.flashproxy.com/api/v1/plans?status=active&limit=10" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"Python
import requests
response = requests.get(
"https://www.flashproxy.com/api/v1/plans?status=active&limit=10",
headers={
"Authorization": "Bearer fpk_live_YOUR_KEY",
},
timeout=30,
)
print(response.json())Node.js
const response = await fetch("https://www.flashproxy.com/api/v1/plans?status=active&limit=10", {
headers: {
"Authorization": "Bearer fpk_live_YOUR_KEY",
},
});
console.log(await response.json());身份验证
在 Authorization 标头中以 Bearer fpk_live_… 的形式发送您的密钥,或在 X-API-Key 标头中发送。
每个密钥都可以读取使用情况。生成代理和延期计划各需要自己的权限,您在创建密钥时选择。将密钥视为密码,如果泄露则撤销它。
密钥权限
| 权限 | 允许 |
|---|---|
| usage | 读取已用数据、剩余数据和当前速度。每个密钥都包含这些内容。 |
| proxies | 生成代理列表。响应包含您的代理用户名和密码。 |
| extend | 扩展计划。每次调用都会从您的账户余额中扣费。 |
账户
当前密钥
GET /api/v1/key
返回您正在调用的密钥:其名称、前缀和权限。当调用返回 403 FORBIDDEN 时很有用。
权限:usage
请求
curl "https://www.flashproxy.com/api/v1/key" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"key_id": "7d1c2b4e-…",
"name": "Monitoring server",
"key_prefix": "fpk_live_k3x9q2ma",
"permissions": [
"usage",
"proxies",
"extend"
],
"created_at": "2026-09-29T12:00:00.000Z",
"last_used_at": "2026-10-13T12:00:00.000Z"
}
}账户余额
GET /api/v1/balance
返回您的可用账户余额,延期所需的费用从中支付。
权限:usage
请求
curl "https://www.flashproxy.com/api/v1/balance" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"balance_usd": 42.18,
"balance_cents": 4218,
"currency": "USD"
}
}列出计划
GET /api/v1/plans
按最新优先顺序返回您的计划,包含其状态、到期日期、数据上限以及是否按 GB 或天数延期。永不返回代理凭证。
权限:usage
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| status | query | all(默认)、active 或 expired。 | |
| limit | query | 返回多少个方案,最多 100。默认为 50。 | |
| offset | query | 跳过多少个方案,用于分页。默认为 0。 |
请求
curl "https://www.flashproxy.com/api/v1/plans?status=active&limit=10" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plans": [
{
"plan_id": "YOUR_PLAN_ID",
"product": "residential",
"name": "Residential Proxies",
"status": "active",
"billed_by": "data",
"created_at": "2026-09-13T12:00:00.000Z",
"expires_at": "2027-03-12T12:00:00.000Z",
"max_bytes": 10737418240,
"bytes_used": 4294967296,
"speed_mbps": null,
"extend_with": "gb"
}
],
"total": 1,
"limit": 10,
"offset": 0
}
}列表交易
GET /api/v1/transactions
按最新优先顺序返回您的付款、充值和余额购买,用于记账。
权限:usage
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| limit | query | 返回多少笔交易,最多 100。默认为 50。 | |
| offset | query | 跳过多少笔交易,用于分页。默认为 0。 |
请求
curl "https://www.flashproxy.com/api/v1/transactions?limit=10" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"transactions": [
{
"transaction_id": "FP-1791900000000-a1b2c3d4e",
"type": "PURCHASE",
"status": "COMPLETED",
"amount_usd": 29.8,
"payment_method": "BALANCE",
"description": "Purchase of 1 item",
"created_at": "2026-10-11T12:00:00.000Z",
"completed_at": "2026-10-11T12:00:00.000Z"
}
],
"total": 1,
"limit": 10,
"offset": 0,
"currency": "USD"
}
}
```,## 使用情况
### 所有活跃计划的使用情况
`GET /api/v1/usage`
为您账户中的每个活跃计划返回一条使用情况记录。
权限:`usage`
**请求**
```bash
curl "https://www.flashproxy.com/api/v1/usage" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plans": [
{
"plan_id": "YOUR_PLAN_ID",
"product": "ipv6-datacenter",
"name": "IPv6 Datacenter Proxies",
"status": "active",
"expires_at": "2026-11-01T12:00:00.000Z",
"usage": {
"bytes_used": 2639963,
"max_bytes": null,
"remaining_bytes": null,
"percentage_used": null
},
"throughput_status": "ok",
"throughput": {
"source": "per_minute",
"current_mbps": 412.5,
"avg_mbps_5m": 380.1,
"peak_mbps_1h": 955,
"sampled_at": "2026-10-13T11:59:15.000Z",
"data_delay_seconds": 45,
"limit_mbps": 1000,
"utilization_pct": 41.25
},
"generated_at": "2026-10-13T12:00:00.000Z"
}
]
}
}一个计划的使用情况
GET /api/v1/plans/{plan_id}/usage
返回您的一个计划的使用情况记录,无论其状态如何。
权限:usage
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
请求
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/usage" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"product": "ipv6-datacenter",
"name": "IPv6 Datacenter Proxies",
"status": "active",
"expires_at": "2026-11-01T12:00:00.000Z",
"usage": {
"bytes_used": 2639963,
"max_bytes": null,
"remaining_bytes": null,
"percentage_used": null
},
"throughput_status": "ok",
"throughput": {
"source": "per_minute",
"current_mbps": 412.5,
"avg_mbps_5m": 380.1,
"peak_mbps_1h": 955,
"sampled_at": "2026-10-13T11:59:15.000Z",
"data_delay_seconds": 45,
"limit_mbps": 1000,
"utilization_pct": 41.25
},
"generated_at": "2026-10-13T12:00:00.000Z"
}
}使用历史
GET /api/v1/plans/{plan_id}/usage/history
按固定时间桶(1 小时内 1 分钟,最长 30 天内 4 小时)返回计划的流量和速度,包括总计、成功率和峰值。时间戳为 UTC。适用于 ISP、ISP EU、Datacenter、IPv6 和 Premium Unlimited 计划。
权限:usage
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| range | query | 时间窗口:1h, 24h, 7d, 30d。默认为 24h。 |
请求
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/usage/history?range=24h" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"range": "24h",
"bucket_seconds": 900,
"generated_at": "2026-10-13T12:00:00.000Z",
"totals": {
"bytes": 3221225472,
"bytes_up": 214748364.8,
"bytes_down": 3006477107.2,
"connections": 48210,
"success_pct": 99.2,
"peak_mbps": 412.5,
"peak_concurrent": 37
},
"series": [
{
"t": "2026-10-13T11:30:00.000Z",
"bytes": 41943040,
"bytes_up": 2097152,
"bytes_down": 39845888,
"mbps": 0.37,
"connections_per_sec": 0.62,
"concurrent": 12
},
{
"t": "2026-10-13T11:45:00.000Z",
"bytes": 52428800,
"bytes_up": 3145728,
"bytes_down": 49283072,
"mbps": 0.47,
"connections_per_sec": 0.71,
"concurrent": 15
}
]
}
}热门目的地
GET /api/v1/plans/{plan_id}/destinations
返回计划在时间范围内连接最多的网站,包含每个主机的流量、连接数和成功率(前 100 名)。
权限:usage
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| range | query | 时间窗口:1h, 24h, 7d, 30d。默认为 24h。 |
请求
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/destinations?range=24h" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"range": "24h",
"generated_at": "2026-10-13T12:00:00.000Z",
"destinations": [
{
"host": "example.com",
"bytes_down": 1288490188.8,
"bytes_up": 107374182.4,
"connections": 18240,
"failed": 96,
"success_pct": 99.5
}
]
}
}错误分类
GET /api/v1/plans/{plan_id}/errors
返回时间范围内出错的内容,按类别分组,每个都有可读标签和检查内容的提示。
权限:usage
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| range | query | 时间窗口:1h, 24h, 7d, 30d。默认为 24h。 |
请求
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/errors?range=24h" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"range": "24h",
"generated_at": "2026-10-13T12:00:00.000Z",
"errors": [
{
"category": "timeout",
"label": "Connection timed out",
"hint": "The destination did not answer in time. Usually a slow or overloaded target site; retry with a longer client timeout, and check whether one destination dominates.",
"count": 214
}
]
}
}
```,## 代理
### 计划位置
`GET /api/v1/plans/{plan_id}/locations`
返回计划在生成代理时可以用 country 字段定位的国家。当 any_country 为 true 时,接受任何两字母代码,没有列表。
权限:`usage`
**参数**
| 名称 | 位置 | 必需 | 描述 |
| --- | --- | --- | --- |
| `plan_id` | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
**请求**
```bash
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/locations" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"product": "ipv6-datacenter",
"any_country": false,
"countries": [
{
"code": "CA",
"name": "Canada"
},
{
"code": "FR",
"name": "France"
},
{
"code": "US",
"name": "United States"
}
]
}
}生成代理
POST /api/v1/plans/{plan_id}/proxies
为您的某个活跃方案生成即用型代理行,与仪表板生成器的方式相同。
权限:proxies
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| count | body | 返回多少行,1 到 1000。默认为 10。 | |
| country | body | 要定位的两字母国家代码,例如 US。省略则为任何国家。 | |
| session | body | rotating 表示每个请求都获得新 IP(默认),或 sticky 表示保持相同 IP。 | |
| sticky_minutes | body | 粘性 IP 保持的时长,1 到 1000 分钟。住宅和移动方案的上限为 120。默认为 30。 | |
| protocol | body | http(默认)或 socks5。 | |
| format | body | hostport 表示 host:port:user:pass(默认),或 url 表示 scheme://user:pass@host:port。 |
请求
curl -X POST "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/proxies" \
-H "Authorization: Bearer fpk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"count":2,"country":"US","session":"sticky","sticky_minutes":30,"protocol":"http","format":"hostport"}'响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"count": 2,
"protocol": "http",
"format": "hostport",
"proxies": [
"adam.flashproxy.io:8080:USERNAME-country-US-session-k3x9q2ma-time-30:PASSWORD",
"adam.flashproxy.io:8080:USERNAME-country-US-session-p7d1v8tc-time-30:PASSWORD"
]
}
}固定 IP 列表
GET /api/v1/plans/{plan_id}/ips
返回方案的固定 IP 及其登录信息:Datacenter 方案的实时出口 IP,或 Dedicated ISP 方案的租赁 IP。轮换网关方案请改用"生成代理"。
权限:proxies
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| protocol | query | http(默认)或 socks5。Dedicated ISP v2 方案仅支持 http。 | |
| format | query | hostport 表示 host:port:user:pass(默认),或 url 表示 scheme://user:pass@host:port。 | |
| limit | query | 返回多少个 IP,最多 10000。默认为 1000。total 始终显示完整计数。 |
请求
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/ips?protocol=http&limit=2" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"product": "datacenter",
"source": "live",
"protocol": "http",
"format": "hostport",
"total": 2048,
"count": 2,
"proxies": [
"203.0.113.10:777:USERNAME:PASSWORD",
"203.0.113.11:777:USERNAME:PASSWORD"
]
}
}
```,## 扩展
### 报价延期
`GET /api/v1/plans/{plan_id}/extend/quote`
返回延期的成本,运行与"延期方案"相同的检查,但不购买任何内容。
权限:`usage`
**参数**
| 名称 | 位置 | 必需 | 描述 |
| --- | --- | --- | --- |
| `plan_id` | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| `gb` | query | | 要报价的 GB 数,适用于按数据计费的方案。 |
| `days` | query | | 要报价的天数,适用于按时间计费的方案。发送 gb 或 days,不能同时发送两者。 |
**请求**
```bash
curl "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/extend/quote?gb=10" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"added": {
"gb": 10
},
"price_usd": 35,
"currency": "USD"
}
}延期方案
POST /api/v1/plans/{plan_id}/extend
向您的某个方案添加数据 (GB) 或时间 (天数),从账户余额中支付,价格与仪表板相同。
权限:extend
参数
| 名称 | 位置 | 必需 | 描述 |
|---|---|---|---|
| plan_id | path | 必需 | 方案 ID,由"列出方案"中的 plan_id 返回。 |
| Idempotency-Key | header | 必需 | 此延期的唯一字符串。参见下方的幂等性。 |
| gb | body | 要添加的 GB 数,适用于按数据计费的方案。从 1 到 2,000,000 的整数。 | |
| days | body | 要添加的天数,适用于按时间计费的方案:1 到 365,或 1, 7, 30, 60 表示 Premium Unlimited Residential。发送 gb 或 days,不能同时发送两者。 |
请求
curl -X POST "https://www.flashproxy.com/api/v1/plans/YOUR_PLAN_ID/extend" \
-H "Authorization: Bearer fpk_live_YOUR_KEY" \
-H "Idempotency-Key: extend-2026-10-13-001" \
-H "Content-Type: application/json" \
-d '{"gb":10}'响应 · 200
{
"success": true,
"data": {
"plan_id": "YOUR_PLAN_ID",
"charged_usd": 35,
"added": {
"gb": 10
},
"plan": {
"status": "active",
"expires_at": "2027-04-11T12:00:00.000Z",
"max_bytes": 21474836480
},
"replayed": false
}
}
```,## 产品和价格
### 产品和价格
`GET /api/v1/products`
返回每个产品及其按 GB 计费的等级(总金额按其所属等级的价格计费)和速度与天数的价格。有关特定方案的确切价格,请使用"报价延期"。
权限:`usage`
**请求**
```bash
curl "https://www.flashproxy.com/api/v1/products" \
-H "Authorization: Bearer fpk_live_YOUR_KEY"响应 · 200
{
"success": true,
"data": {
"products": [
{
"product": "datacenter",
"name": "Datacenter Proxies",
"billed_by": [
"data",
"time"
],
"data_pricing": [
{
"up_to_gb": 1,
"per_gb_usd": 0.7
},
{
"up_to_gb": 5,
"per_gb_usd": 0.65
}
],
"time_pricing": [
{
"mbps": 10,
"days": 1,
"price_usd": 1
},
{
"mbps": 10,
"days": 30,
"price_usd": 18
}
]
}
],
"currency": "USD"
}
}幂等性
延期计划会消耗您的余额,因此每个延期调用都需要 Idempotency-Key 标头。
- 为您要购买的每个扩展使用新密钥:8 到 128 个字母、数字、- 或 _。
- 如果调用超时或返回 5xx 错误,请用同一密钥重新发送。您最多被收费一次,完成的扩展会返回 replayed: true。
- 相同密钥用于不同的计划或金额时,会返回 409 IDEMPOTENCY_KEY_REUSED。
- 当第一个调用仍在运行时,使用相同密钥的第二个调用返回 409 REQUEST_IN_PROGRESS。
响应字段
使用情况响应中的每个计划都包含相同的记录。
| 字段 | 含义 |
|---|---|
| usage.* | bytes_used、max_bytes、remaining_bytes 和 percentage_used。无数据上限的方案上,max_bytes 和 remaining_bytes 为 null。Unlimited Residential 上 bytes_used 为 null,因为它按时间和速度计费。 |
| throughput.current_mbps | 最新速度测量:大多数产品为最后完整的一分钟,无近期流量时为 0。 |
| throughput.avg_mbps_5m / peak_mbps_1h | 5 分钟平均速度和 1 小时峰值速度。 |
| throughput.limit_mbps | 您的套餐速度限制。utilization_pct 是当前速度除以此限制。 |
| throughput.sampled_at | 最新测量的时间。data_delay_seconds 告诉您它的年龄。 |
throughput_status 的值
| 值 | 含义 |
|---|---|
| ok | throughput 已填充。 |
| pending | 速度仍在收集中。对于 Unlimited Residential,首次读数最多需要 10 分钟;请继续定期轮询。 |
| unavailable | 速度暂时不可用。请稍后重试。 |
| not_supported | 此产品暂无速度指标。使用计数器仍可正常工作。 |
限制
- 每个密钥每分钟 60 次请求
- 一个账户的所有密钥每分钟共享 120 个请求的限制。
- 超过限制时,您会获得 429 和 Retry-After: 60 标头。
- 扩展调用也计入每个账户每分钟 6 次余额购买的限制,与仪表板共享。
- 速度按分钟测量,因此每 15 到 30 秒轮询一次就足够了。
- 使用情况答案可能最多延迟 15 秒,产品价格最多延迟 5 分钟。
错误
错误共享一种形式:success 为 false,error 包含代码和可读消息。
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | INVALID_REQUEST | 请求体或参数无效。消息会指出具体内容。 |
| 400 | IDEMPOTENCY_KEY_REQUIRED | 扩展调用缺少有效的 Idempotency-Key 标头。 |
| 400 | PAYMENT_REFUSED | 余额支付被拒绝。请联系支持。 |
| 401 | UNAUTHORIZED | 缺少、无效或已撤销的密钥。 |
| 402 | INSUFFICIENT_BALANCE | 余额不足以进行此扩展。请充值后重试。 |
| 403 | FORBIDDEN | 该密钥没有此端点所需的权限。 |
| 404 | NOT_FOUND | 您的账户上没有这样的套餐。 |
| 409 | PLAN_NOT_ACTIVE | 只能为活跃套餐生成代理。 |
| 409 | PLAN_NOT_READY | 该套餐还没有代理凭据。请稍后再试。 |
| 409 | IDEMPOTENCY_KEY_REUSED | 此 Idempotency-Key 已用于不同的扩展。 |
| 409 | REQUEST_IN_PROGRESS | 使用此 Idempotency-Key 的扩展仍在运行。请稍后重试。 |
| 409 | PRICE_MISMATCH | 处理过程中价格发生变化。请使用新的 Idempotency-Key 重试。 |
| 422 | EXTENSION_NOT_SUPPORTED | 此套餐无法通过 API 扩展。请在仪表板中扩展。 |
| 422 | PROXIES_NOT_SUPPORTED | Dedicated 套餐有固定的 IP 列表。请从仪表板下载。 |
| 422 | USAGE_HISTORY_NOT_SUPPORTED | 此产品没有使用历史。使用使用端点获取其计数器。 |
| 422 | IPS_NOT_SUPPORTED | 此套餐使用轮转网关,而不是固定 IP 列表。请使用生成代理。 |
| 422 | CUSTOM_PLAN_EXTEND_VIA_SUPPORT | 自定义套餐仅由支持部门扩展。 |
| 429 | RATE_LIMITED | 请求过多。等待 Retry-After,然后重试。 |
| 500 | INTERNAL_ERROR | 暂时错误。请重试。 |
| 502 | EXTENSION_FAILED | 扩展未完成。仅当消息说明未扣费时,才使用相同的 Idempotency-Key 重试;否则请联系客服。 |
| 503 | IPS_UNAVAILABLE | 无法立即加载 IP 列表。请在一分钟后重试。 |