🛡️ DataDome Solver 平台 · API 文档

纯协议 DataDome 打码 · REST API

本平台在 Node.js VM 沙箱里跑 DataDome 872 挑战,不启动任何浏览器进程,单次求解 4-8 秒。

全部功能通过 REST + JSON 访问 · 所有端点使用 X-API-Key 认证 · 支持自定义 SOCKS5/HTTP proxy。

基础

Base URL

http://datadome.nerver.cc

认证

所有 /api/* 端点都需要在请求头带 API Key:

X-API-Key: ddp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

或作为 query 参数(不推荐,会出现在日志里):

?api_key=ddp_xxxxxxxx

密钥从管理面板生成,含每密钥独立点数、限速、日限额。

计费:每次调用 /api/solve 成功扣 1 点,失败自动退款。可用点数不足返回 HTTP 402。

端点

POST /api/solve

核心求解端点。传入被 DataDome 拦截的目标 URL,平台自动:

  1. GET 目标 URL (可指定 proxy) 提取 DataDome interstitial iframe
  2. 加载 iframe HTML 到 Node VM 沙箱
  3. 本地跑完 872 挑战生成 POST body
  4. curl_cffi impersonate=chrome150 提交 body
  5. 解析响应, 返回 datadome cookie

请求 Body

{
  "url": "https://github.com/signup",           // 必填,被拦截的目标页
  "proxy": "socks5://user:pass@host:port",      // 可选,如不带则本机 IP 直连
  "user_agent": "Mozilla/5.0 ...",              // 可选,默认 Chrome 150
  "referer": "https://github.com/"              // 可选,默认取 url 自身
}

返回 200 成功

{
  "success": true,
  "cookies": {
    "datadome": "noegZJ_ruzIvqJpluoxcianT7j0qFj..."   // 128B, 直接放进后续请求
  },
  "cookie_len": 128,
  "view": "redirect",                          // DataDome 返回的 view
  "elapsed_ms": 4820,
  "iframe_url": "https://geo.captcha-delivery.com/interstitial/?...",
  "target_status": 200,
  "interstitial_status": 200,
  "credits_charged": 1,
  "credits_left": 999
}

返回 402 点数不足

{ "success": false, "error": "insufficient credits" }

返回 429 限速

{ "success": false, "error": "rate limit exceeded (60/min)" }

GET /api/status

查询当前 API Key 的状态和配额。

{
  "ok": true,
  "key_label": "prod-user-1",
  "credits": 950,
  "credits_used": 50,
  "quota_daily": 1000,
  "used_today": 42,
  "rate_limit_per_min": 60,
  "recent_1min": 7,
  "server_time": 1789323847.5
}

GET /api/balance

轻量端点,仅返回点数余额,可高频轮询。

{ "ok": true, "credits": 950, "credits_used": 50 }

GET /health

无需鉴权,返回 ok。用于 K8s liveness / 监控。

客户端示例

Python (requests)

import requests

BASE = "http://datadome.nerver.cc"
API_KEY = "ddp_YOUR_KEY_HERE"

r = requests.post(
    BASE + "/api/solve",
    headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
    json={
        "url": "https://github.com/signup",
        "proxy": "socks5://user:pass@host:port",
    },
    timeout=60,
)
data = r.json()
if data["success"]:
    datadome_cookie = data["cookies"]["datadome"]
    # 拿这个 cookie 继续访问目标站
    r2 = requests.get(
        "https://github.com/signup",
        cookies={"datadome": datadome_cookie},
        proxies={"http": "socks5://...", "https": "socks5://..."},
    )
else:
    print("error:", data.get("error"))

curl

curl -X POST http://datadome.nerver.cc/api/solve \
  -H "X-API-Key: ddp_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://github.com/signup","proxy":"socks5://user:pass@host:port"}'

Node.js

const res = await fetch("http://datadome.nerver.cc/api/solve", {
  method: "POST",
  headers: {
    "X-API-Key": "ddp_YOUR_KEY_HERE",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://github.com/signup" }),
});
const data = await res.json();
console.log(data.cookies.datadome);

PHP

$ch = curl_init("http://datadome.nerver.cc/api/solve");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "X-API-Key: ddp_YOUR_KEY_HERE",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode(["url" => "https://github.com/signup"]),
    CURLOPT_TIMEOUT => 60,
]);
$data = json_decode(curl_exec($ch), true);
echo $data["cookies"]["datadome"];

常见场景 & 最佳实践

1. 单账号自动化

每次注册流程调 /api/solve 拿到 cookie 后,把 cookie 和 proxy 一起丢给后续 HTTP 请求。DataDome cookie 有 12-24 小时有效期,同一 session 内可复用。

2. 批量并发

本平台单节点稳定支持 8-16 并发。超过后请求会排队(ThreadPoolExecutor)。若长期 QPS > 20,建议横向扩容:多起几台平台,前面挂 nginx 轮询。

3. 代理选择

DataDome 会看 IP 地理位置 + 信誉分。推荐:

4. 错误处理

可靠调用样例:

for attempt in range(3):
    r = requests.post(...)
    if r.status_code == 200 and r.json()["success"]:
        break
    if r.status_code == 402:
        raise RuntimeError("out of credits, top up first")
    if r.status_code == 429:
        time.sleep(2)   # 触发限速, 稍等再试
        continue
    if r.status_code == 500:
        # 目标 iframe 抓不到, 换代理再试
        change_proxy()
        continue

性能 & 限制

指标数值
单次 solve 耗时4 - 8 秒 (含目标 GET + IJS + POST)
Node VM 冷启~400 ms (未来可优化到常驻)
成功率100% (offline 20/20, 前提代理 IP 合格)
plv3 输出419-440 chars, 匹配真机 Chrome 输出
datadome cookie128 B, 12-24h 有效
并发上限 (单节点)8-16 (受 Node VM 内存约束)
典型 QPS2-4 (受 solve 耗时约束, 想更高需要多节点)

联系 & 反馈

问题、需求、代金券请联系管理员。