UNLOCK API
DataDome

DataDome

createTaskまたはin.phpでUNLOCK APIにDataDomeタスクを送信する方法です。タスクの種類名、すべてのパラメータ、solutionオブジェクト、プロキシフィールド、7言語のコードサンプルを掲載しています。
料金
$0.725 1タスク $0.000725
送信するもの
ページURL、ブロック時の応答に含まれるcaptchaアドレス、ユーザーエージェント、プロキシ
受け取るもの
datadome Cookie

概要と料金

タスクの種類名

この種類は常にご自身のプロキシ経由で実行されるため、プロキシフィールドは必須です。
DataDomeSliderTask自分のプロキシを使用

taskオブジェクト

type
String必須
タスクの種類名です。大文字と小文字は区別しません。 DataDomeSliderTask
websiteURL
String必須
CAPTCHAが表示されるページの完全なアドレスです。http://またはhttps://で始まります。
captchaUrl
String必須
DataDome CAPTCHAフレームの完全なアドレスです(geo.captcha-delivery.com/...)。
userAgent
String必須
解決時に使うブラウザのUser-Agentです。答えを送信するときも同じものを使ってください。

ここにないフィールドは、送信されたままソルバーに渡されます。

プロキシフィールド

この種類は常にご自身のプロキシ経由で実行されるため、プロキシフィールドは必須です。
proxyType
String必須
http、https、socks4、socks5のいずれかです。
proxyAddress
String必須
プロキシのIPアドレスまたはホスト名です。
proxyPort
Integer必須
プロキシのポートです。
proxyLogin
String任意
プロキシのユーザー名です(プロキシで必要な場合)。
proxyPassword
String任意
プロキシのパスワードです(プロキシで必要な場合)。
proxy
String
すべてのプロキシフィールドを1つの文字列にしたものです。例: http://user:pass@1.2.3.4:8080。

プロキシの使用

リクエスト

POST /createTask
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "DataDomeSliderTask",
    "websiteURL": "https://example.com/login",
    "captchaUrl": "https://geo.captcha-delivery.com/captcha/?initialCid=...",
    "userAgent": "Mozilla/5.0 ...",
    "proxyType": "http",
    "proxyAddress": "1.2.3.4",
    "proxyPort": 8080
  }
}

solutionオブジェクト

statusがreadyのとき、solutionに入って返されます。
cookie
String
ページを再読み込みする前に設定するCookieです。
POST /getTaskResult
{
  "errorId": 0,
  "taskId": 1001,
  "status": "ready",
  "solution": {
    "cookie": "datadome=6BvxqELMoorFNoo7GT1...; Path=/; Secure; SameSite=Lax"
  },
  "cost": "0.000725",
  "createTime": 1791640000,
  "endTime": 1791640014,
  "solveCount": 1
}

コードサンプル

import time, requests

API = "https://unlock-api.com"
KEY = "YOUR_API_KEY"

task = requests.post(f"{API}/createTask", json={
    "clientKey": KEY,
    "task": {
      "type": "DataDomeSliderTask",
      "websiteURL": "https://example.com/login",
      "captchaUrl": "https://geo.captcha-delivery.com/captcha/?initialCid=...",
      "userAgent": "Mozilla/5.0 ...",
      "proxyType": "http",
      "proxyAddress": "1.2.3.4",
      "proxyPort": 8080
    }
}).json()
if task["errorId"]:
    raise SystemExit(task["errorCode"])

for _ in range(60):   # 60 x 5 s = the 5 minute task limit
    time.sleep(5)
    r = requests.post(f"{API}/getTaskResult", json={"clientKey": KEY, "taskId": task["taskId"]}).json()
    if r["errorId"]:
        raise SystemExit(f"{r['errorCode']}: {r.get('errorDescription', '')}")   # failed tasks are refunded
    if r["status"] == "ready":
        print(r["solution"]["cookie"])
        break
else:
    raise SystemExit("timed out")

in.phpフォームメソッド

同じタスクを従来のフォームリクエストで送る方法です。res.phpが答えをテキストで返します。
in.php, res.php
curl -s "https://unlock-api.com/in.php" -d "key=YOUR_API_KEY&method=datadome&captcha_url=CAPTCHA_URL&pageurl=https://example.com/login&userAgent=UA&proxy=login:pass@1.2.3.4:8080&proxytype=HTTP&json=1"
# {"status":1,"request":"1001"}

curl -s "https://unlock-api.com/res.php?key=YOUR_API_KEY&action=get&id=1001&json=1"
# {"status":0,"request":"CAPCHA_NOT_READY"}  then  {"status":1,"request":"ANSWER"}

フォームAPI: in.phpとres.php