任務類型
reCAPTCHA v3 Enterprise
RecaptchaV3EnterpriseTaskProxyless無需代理
reCAPTCHA v3 沒有可見元件:網站會為每個動作給出 0.0 到 1.0 的分數。API 會針對指定的 pageAction 回傳 token;minScore 用來設定所需分數。
Enterprise 版本:網站會載入 enterprise.js,並可能在 enterprisePayload 中傳遞額外資料——請原封不動送出。
無需代理:我們使用自有基礎設施解決。適合目標網站不會將 token 綁定 IP 的情況。
即時指標(24 小時)
此類型的即時指標將於上線後顯示在狀態頁面上。
任務參數
| 參數 | 類型 | 必填 | 任務參數 |
|---|---|---|---|
type | string | 必填 | RecaptchaV3EnterpriseTaskProxyless |
websiteURL | string | 必填 | 含有驗證碼之頁面的完整 URL。 |
websiteKey | string | 必填 | 網站金鑰(data-sitekey 或 anchor 請求中的 k 參數)。 |
minScore | number | 選填 | 所需分數,範圍 0.1 至 0.9。分數越高,所需時間越長。 |
pageAction | string | 選填 | 頁面傳給 grecaptcha.execute 的動作名稱。 |
enterprisePayload | object | 選填 | 額外的 Enterprise 參數(例如 s),以物件形式傳入。 |
apiDomain | string | 選填 | 載入元件的網域:google.com 或 recaptcha.net。 |
userAgent | string | 選填 | 解決時使用的 User-Agent;送出 token 時請使用相同的值。 |
cookies | string | 選填 | 目標網站的 Cookie,格式為 key1=value1; key2=value2。 |
範例
import time
import requests
API = "https://"
KEY = "YOUR_API_KEY"
# 1. create a task: the price is held, not charged
task = requests.post(f"{API}/createTask", json={
"clientKey": KEY,
"task": {
"type": "RecaptchaV3EnterpriseTaskProxyless",
"websiteURL": "https://example.com/login",
"websiteKey": "6Le-SITE-KEY",
"minScore": 0.7,
"pageAction": "login",
},
}).json()
if task["errorId"]:
raise RuntimeError(task["errorCode"])
# 2. poll the result (or pass "callbackUrl" and get a signed webhook)
while True:
time.sleep(3)
res = requests.post(f"{API}/getTaskResult",
json={"clientKey": KEY, "taskId": task["taskId"]}).json()
if res["errorId"]:
raise RuntimeError(res["errorCode"])
if res["status"] == "ready":
print(res["solution"]["gRecaptchaResponse"])
break