接口地址
…
📖 完整使用文档
一份 Markdown 格式的完整 API 使用文档(认证 · 9 种网盘 · 端点详解 · SSE · 结果字段 · 错误码 · 最佳实践 · 每个网盘注意事项 · 环境变量 · FAQ)。 点下方按钮即可 一键复制 到剪贴板,随处粘贴。
👀 展开预览(全文约 — 字符)
加载中…
🔑 API 密钥
输入一次,下方 3 个“在这里试一下”都会自动带上它。勾选“记住 30 天”会存在
localStorage,仅本浏览器可见,不会发送给第三方。
没密钥?🔐 去密钥管理创建。
快速开始
1 · 提交检测任务
curl -X POST $BASE/jobs \
-H "Content-Type: application/json" \
-H "X-API-Key: $YOUR_API_KEY" \
-d '{
"items": [
{"url": "https://pan.quark.cn/s/xxxx"},
{"url": "https://pan.baidu.com/s/yyyy?pwd=8888"},
{"url": "https://www.alipan.com/s/zzzz"}
]
}'
▶ 在这里试一下
2 · 订阅结果流(SSE)
curl -N $BASE/jobs/$JOB_ID/events \
-H "X-API-Key: $YOUR_API_KEY"
▶ 在这里试一下
| 时间 | id | event | provider | 结果 |
|---|
3 · 加急(批量 URL 插队)
curl -X POST $BASE/jobs/$JOB_ID/urgent \
-H "Content-Type: application/json" \
-H "X-API-Key: $YOUR_API_KEY" \
-d '{"urls": ["https://pan.quark.cn/s/xxxx", "https://www.alipan.com/s/zzzz"]}'
▶ 在这里试一下
端点清单 · 本服务提供两个公开 API
① 检测 API (需密钥)
| 方法 | 路径 | 说明 | 密钥 |
|---|---|---|---|
| POST | /jobs | 创建检测 job(混合 URL) | ✅ |
| GET | /jobs/{id}/events | SSE 结果流(支持 Last-Event-ID 重连) | ✅ |
| POST | /jobs/{id}/urgent | 批量加急(软抢占) | ✅ |
| GET | /jobs/{id} | 查 job 概况 / 各网盘进度 | ✅ |
| DELETE | /jobs/{id} | 取消 job | ✅ |
② 处理池查询 API (公开,无需密钥)
只返回计数与静态元数据,不暴露任何 URL / 用户数据,可安全给仪表盘 / Prometheus / 告警脚本用。
| 方法 | 路径 | 说明 | 密钥 |
|---|---|---|---|
| GET | /pool | 全网盘处理池快照 + 每盘元数据 + 聚合 totals | — |
| GET | /pool/{provider} | 单个网盘的处理池快照(quark/baidu/ali/…) | — |
元信息与管理
| 方法 | 路径 | 说明 | 密钥 |
|---|---|---|---|
| GET | /health | 健康检查(兼容旧客户端;字段同 /pool) | — |
| GET | /admin | 密钥管理 Web 界面 | — |
| GET | /docs, /redoc | 自动文档(Swagger / ReDoc) | — |
代码示例
# 一次性跑完:创建 job → 订阅流
JOB=$(curl -sX POST $BASE/jobs \
-H "Content-Type: application/json" \
-H "X-API-Key: $YOUR_API_KEY" \
-d '{"items":[{"url":"https://pan.quark.cn/s/xxx"}]}' | python -c "import sys,json;print(json.load(sys.stdin)['job_id'])")
curl -N $BASE/jobs/$JOB/events \
-H "X-API-Key: $YOUR_API_KEY"
import asyncio, httpx, json
BASE = "$BASE"
KEY = "$YOUR_API_KEY"
async def main():
async with httpx.AsyncClient(headers={"X-API-Key": KEY}, timeout=None) as cli:
# 1. 提交
r = await cli.post(f"{BASE}/jobs", json={"items": [
{"url": "https://pan.quark.cn/s/xxxx"},
{"url": "https://pan.baidu.com/s/yyyy?pwd=8888"},
]})
job = r.json()
print("job_id:", job["job_id"])
# 2. 订阅 SSE
async with cli.stream("GET", f"{BASE}{job['stream_url']}") as resp:
async for line in resp.aiter_lines():
if line.startswith("data:"):
print(json.loads(line[5:].strip()))
# 3. (可选)中途加急
# await cli.post(f"{BASE}/jobs/{job['job_id']}/urgent",
# json={"urls": ["https://pan.quark.cn/s/xxxx"]})
asyncio.run(main())
// Node 18+(原生 fetch + ReadableStream)
const BASE = "$BASE";
const KEY = "$YOUR_API_KEY";
const r = await fetch(`${BASE}/jobs`, {
method: "POST",
headers: {"Content-Type": "application/json", "X-API-Key": KEY},
body: JSON.stringify({items: [{url: "https://pan.quark.cn/s/xxxx"}]}),
});
const job = await r.json();
console.log("job_id:", job.job_id);
const sse = await fetch(`${BASE}${job.stream_url}`, {
headers: {"X-API-Key": KEY},
});
const reader = sse.body.getReader();
const decoder = new TextDecoder();
let buf = "";
while (true) {
const {value, done} = await reader.read();
if (done) break;
buf += decoder.decode(value, {stream: true});
let idx;
while ((idx = buf.indexOf("\n\n")) >= 0) {
const frame = buf.slice(0, idx); buf = buf.slice(idx + 2);
const data = frame.split("\n").find(l => l.startsWith("data:"));
if (data) console.log(JSON.parse(data.slice(5).trim()));
}
}
<?php
$base = "$BASE";
$key = "$YOUR_API_KEY";
$ch = curl_init("$base/jobs");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "X-API-Key: $key"],
CURLOPT_POSTFIELDS => json_encode(["items" => [
["url" => "https://pan.quark.cn/s/xxxx"]
]]),
CURLOPT_RETURNTRANSFER => true,
]);
$job = json_decode(curl_exec($ch), true);
curl_close($ch);
$ch = curl_init("$base{$job['stream_url']}");
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ["X-API-Key: $key"],
CURLOPT_WRITEFUNCTION => function ($ch, $data) { echo $data; return strlen($data); },
]);
curl_exec($ch);
结果字段速查
| 字段 | 含义 |
|---|---|
item_id | 创建 job 时分配的唯一 ID(用于关联原始 URL) |
url | 原始链接 |
provider | 识别到的网盘类型(quark / baidu / ali / …) |
valid | 是否有效(布尔) |
reason | 结论细分码:all_checks_passed / empty_share / share_cancelled / unsupported_provider … |
share_name | 分享名(若能解析到) |
expiration_label | "永久有效" / "剩余 7 天" / "已过期" 等人类可读文本 |
elapsed_seconds | 该条检测耗时 |
priority_used | normal / urgent(实际跑的时候的优先级) |
meta | 创建时透传进来的客户端自定义字段,原样返回 |
系统状态
加载中…