# ReCaptcha V2 Enterprise

Rest API Endpoint: `https://captcha.datalabs.net/createTask`

## Creating The Task

<pre class="language-json"><code class="lang-json"><strong>POST https://captcha.datalabs.net/createTask
</strong>Host: captcha.datalabs.net
Content-Type: application/json

{
    "clientKey": "DATALABS_API_KEY",
    "task": {
        "type": "RecaptchaV2EnterpriseTask",
        "websiteURL": "https://google.com/recaptcha/api2/demo",
        "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
        "enterprisePayload": {
            "s": "S_DATA_VALUE"
        },
        "proxyType": "http",
        "proxyAddress": "1.1.1.1",
        "proxyPort": "9999",
        "proxyLogin": "username",
        "proxyPassword": "password"
    },
    "callbackUrl": "https://example.com/callback"
}
</code></pre>

### Task Parameter Table <a href="#task-parameter-table" id="task-parameter-table"></a>

<table><thead><tr><th width="221">Parameters</th><th width="162.66666666666666">Required</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>true</td><td><em><strong>RecaptchaV2EnterpriseTask</strong></em></td></tr><tr><td>websiteURL</td><td>true</td><td>The website address in which you're solving the captcha for.</td></tr><tr><td>websiteKey</td><td>true</td><td>The websites static recaptcha sitekey. This can be found as the value of the attribute <code>data-sitekey</code> of the element with the class <code>g-recaptcha</code>.</td></tr><tr><td>enterprisePayload</td><td>false</td><td>Contains the parameter <code>s</code>, for custom implementations of Recaptcha that require the s data. This can be found either in the page source or in the recaptcha network activity. This value alternates therefor must be scraped and used anew on each solve.</td></tr><tr><td>pageAction</td><td>false</td><td>Can be found as value of <code>sa</code> parameter in the anchor endpoint or found in recaptcha widget as the <code>action</code> value. Typically a static value.</td></tr><tr><td>userAgent</td><td>false</td><td>Browser user-agent used in emulation. Must use modern browser user-agent to avoid google prompting to "Update your browser".</td></tr><tr><td>cookies</td><td>false</td><td>Cookies to be passed to the solver.<br><strong>Format:</strong> <code>cookie1=value; cookie2=value2;</code></td></tr><tr><td>isInvisible <mark style="color:blue;">(Bool)</mark></td><td>false</td><td>If the captcha field is visible set to <code>true</code>, if the captcha field is NOT visible or has a hidden field for confirmation this value must be set to <code>false</code></td></tr><tr><td>proxyType</td><td>true</td><td>The type of proxy, accepts values: <code>http</code>, <code>https</code>, <code>socks4</code>, and <code>socks5</code>.</td></tr><tr><td>proxyAddress</td><td>true</td><td>The IPv4/IPv6 IP for your proxy (Host names, non-transparent, and local network proxies are not allowed)</td></tr><tr><td>proxyPort</td><td>true</td><td>The proxy port</td></tr><tr><td>proxyLogin</td><td>false</td><td>The proxy username</td></tr><tr><td>proxyPassword</td><td>false</td><td>The proxy password</td></tr></tbody></table>

### Task Created Response <a href="#task-created-response" id="task-created-response"></a>

```json
{
  "errorId":0,
  "taskId":997993082
}
```

<table><thead><tr><th width="184">Parameters</th><th width="370">Description</th></tr></thead><tbody><tr><td>errorId</td><td>0: Without error.<br>1: Error with request.</td></tr><tr><td>errorCode</td><td>Short code for error type.</td></tr><tr><td>errorDescription</td><td>More detailed description of the error that occurred.</td></tr><tr><td>taskId</td><td>Task ID, provided for synchronous tasks to be pushed to /getTaskResult</td></tr></tbody></table>

## Retrieving the Solution <a href="#retrieving-the-solution" id="retrieving-the-solution"></a>

```json
POST https://captcha.datalabs.net/getTaskResult
Host: captcha.datalabs.net
Content-Type: application/json

{
  "clientKey": "DATALABS_API_KEY",
  "taskId": "997993082"
}
```

### Successful Solution Response <a href="#retrieved-solution-response-structure" id="retrieved-solution-response-structure"></a>

```json
{
  "errorId":0,
  "status":"ready",
  "solution": {
    "gRecaptchaResponse":"03AFcWeA6P_W0urJnFwK-f2psFTXp..."
  }
}
```

<table><thead><tr><th width="246">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>gRecaptchaResponse</td><td>The successfully solved solution token.</td></tr></tbody></table>
