# Fun Captcha

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

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

<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":"FunCaptchaTask",
    "websiteURL": "WEBSITE_URL",
    "websitePublicKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "data": "{\"blob\": \"nlVR57VYAtn8ca6L.l38uVCjL43Pdb...\"}",
    "proxyType": "http",
    "proxyAddress": "1.1.1.1",
    "proxyPort": "9999",
    "proxyLogin": "username",
    "proxyPassword": "password",
    }
}
</code></pre>

### 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><em><strong>FunCaptchaTask</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>websitePublicKey</td><td>true</td><td>The websites static key. It can typically be found in the page source or network activity.</td></tr><tr><td>data</td><td>false</td><td>A value called <code>blob</code> which is used in certain implementations of Fun Captcha.</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

```json
{
  "errorId":0,
  "status":"ready",
  "solution": {
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X ...",
      "token": "3AHJ_q25SxXT-pmSeBXjzScW-EiocHwwpwqtk1QXlJnGnU......"
  }
}
```

<table><thead><tr><th width="246">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>userAgent</td><td>The user agent in which the solution was solved with.</td></tr><tr><td>token</td><td>The successfully solved solution token.</td></tr></tbody></table>
