NeuroCaptcha

RecaptchaV2EnterpriseTask

Parameters, request and response for reCAPTCHA v2 Enterprise solved through your proxy: the RecaptchaV2EnterpriseTask task type.

이 섹션은 영어로 표시됩니다.

이 페이지의 내용

reCAPTCHA v2 Enterprise: the checkbox or invisible widget loaded from recaptcha/enterprise.js. The task is solved through your proxy, so the token is issued for your IP address.

PriceUS$1.50 per 1000 tasks (US$0.0015 per task), only for solved tasks — pricing
Proxyrequired — your proxy
Queue in getQueueStats5
Also accepted as—

Parameters#

Fields of the task object in createTask:

type
string필수
RecaptchaV2EnterpriseTask
websiteURL
string필수
Full address of the page where the reCAPTCHA is shown: http(s), up to 2048 characters. The page, not the address of the reCAPTCHA iframe.
websiteKey
string필수
Site key: the data-sitekey attribute of the widget or the k parameter of the anchor request in DevTools → Network. Up to 256 characters, no spaces.
isInvisible
boolean
true for invisible reCAPTCHA v2 (the widget has data-size="invisible" and shows only a badge). Default false.
recaptchaDataSValue
string
The data-s value if the page passes one (some Google services do). Up to 4096 characters.
enterprisePayload
object
Extra parameters of grecaptcha.enterprise.render / execute, e.g. {"s": "…"}, up to 8 KiB of JSON. If recaptchaDataSValue or pageAction is empty, the s and action keys are used instead.
apiDomain
string
Domain the widget is loaded from: www.google.com (default) or www.recaptcha.net.
userAgent
string
User-Agent of the browser that will submit the token, up to 512 characters. It is returned in solution.userAgent.
cookies
string
Cookies of the target site for the solving browser: name=value; name2=value2, up to 8192 characters. Stored encrypted.
proxyType
string
http (default), https, socks4 or socks5.
proxyAddress
string필수
IP address or host name of the proxy. Private and local addresses are rejected.
proxyPort
integer필수
Proxy port, 1–65535.
proxyLogin
string
Proxy login, up to 256 characters. Stored encrypted.
proxyPassword
string
Proxy password, up to 256 characters. Stored encrypted.

Request#

POST /createTask
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "RecaptchaV2EnterpriseTask",
    "websiteURL": "https://example.com/login",
    "websiteKey": "YOUR_SITE_KEY",
    "enterprisePayload": {
      "s": "ENTERPRISE_S_VALUE"
    },
    "proxyType": "http",
    "proxyAddress": "proxy.example.com",
    "proxyPort": 8080,
    "proxyLogin": "user",
    "proxyPassword": "pass"
  }
}

Complete example#

Create the task, poll every 2 seconds, print the token:

import os
import time

import requests

API = "https://neurocaptcha.com"
KEY = os.environ["API_KEY"]


def call(method, payload):
    data = requests.post(f"{API}/{method}", json={"clientKey": KEY, **payload}, timeout=30).json()
    if data.get("errorId"):
        raise RuntimeError(f'{data["errorCode"]}: {data.get("errorDescription", "")}')
    return data


task = {
    "type": "RecaptchaV2EnterpriseTask",
    "websiteURL": "https://example.com/login",
    "websiteKey": "YOUR_SITE_KEY",
    "enterprisePayload": {
        "s": "ENTERPRISE_S_VALUE",
    },
    "proxyType": "http",
    "proxyAddress": "proxy.example.com",
    "proxyPort": 8080,
    "proxyLogin": "user",
    "proxyPassword": "pass",
}

# 1. create the task: its price is held, not charged
task_id = call("createTask", {"task": task})["taskId"]

# 2. poll every 2 s; a failed task raises with its error code and costs nothing
deadline = time.time() + 300
while time.time() < deadline:
    time.sleep(2)
    result = call("getTaskResult", {"taskId": task_id})
    if result["status"] == "ready":
        print(result["solution"]["gRecaptchaResponse"])
        break
else:
    raise TimeoutError("the task was not solved in time")

Response#

getTaskResult once the task is solved:

getTaskResult
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "gRecaptchaResponse": "03AFcWeA6Z3vq0VhGm1oS8r0bAxKk4…",
    "userAgent": ""
  },
  "cost": "0.001500",
  "ip": "198.51.100.7",
  "createTime": 1793370000,
  "endTime": 1793370007,
  "solveCount": 1
}

Tips#

  • Find websiteKey in the data-sitekey attribute, or in the k= parameter of the anchor request (DevTools → Network).
  • No checkbox, only a badge in the corner? Set isInvisible: true.
  • Put the token into textarea#g-recaptcha-response (or g-recaptcha-response form field) and call the widget callback if the page has data-callback.
  • Enterprise pages load recaptcha/enterprise.js and call grecaptcha.enterprise.*. Copy the s value into enterprisePayload if the page passes it.
  • Submit the token through the same proxy and with the same userAgent as in the task. See Proxies.