タスクタイプ
reCAPTCHA v3 Enterprise
RecaptchaV3EnterpriseTaskProxylessプロキシ不要
reCAPTCHA v3にはウィジェットがありません。サイトはすべてのアクションを0.0〜1.0でスコア化します。APIは指定したpageActionのトークンを返し、必要なスコアはminScoreで指定します。
Enterprise版:サイトはenterprise.jsを読み込み、enterprisePayloadで追加データを渡すことがあります。その内容はそのまま送信してください。
プロキシ不要:当社のインフラから解決します。対象サイトがトークンをIPに紐付けていない場合に最適です。
リアルタイムメトリクス(24時間)
このタイプのリアルタイムメトリクスは、ローンチ後にステータスページに表示されます。
タスクパラメータ
| パラメータ | 型 | 必須 | タスクパラメータ |
|---|---|---|---|
type | string | 必須 | RecaptchaV3EnterpriseTaskProxyless |
websiteURL | string | 必須 | CAPTCHAが表示されるページの完全な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。トークンを送信する際も同じものを使ってください。 |
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