# HCaptcha Proxyless

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

## Creating The Task <a href="#creating-the-task" id="creating-the-task"></a>

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

{
  "clientKey": "DATALABS_API_KEY",
  "task": {
    "type": "HCaptchaTaskProxyless",
    "websiteURL": "https://accounts.hcaptcha.com/demo",
    "websiteKey": "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
    "data":"custom_data" // Optional custom data
    },
  "callbackUrl": "https://example.com/callback"
}
```

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

<table><thead><tr><th width="189">Parameters</th><th width="162.66666666666666">Required</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>true</td><td><strong>HCaptchaTaskProxyless</strong></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> in the page source, and is commonly formatted as a GUID.</td></tr><tr><td>data</td><td>false</td><td>Custom data sent with custom implementations of hCaptcha, and typically coincides with an invisible captcha.</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>isInvisible</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></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

```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": "P1_eyJ0eXAiOiJKV1Q...",
    "respKey": "E0_eyJ0eXAiOiJKV1QiLCJh...",
    "userAgent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
  }
}
```

<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><tr><td>respKey</td><td>The result of <code>window.hcaptcha.getRespKey()</code>, some websites use this for additional verification.</td></tr><tr><td>userAgent</td><td>User agent used for the solution</td></tr></tbody></table>
