> For the complete documentation index, see [llms.txt](https://docx.mrccaptcha.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docx.mrccaptcha.com/funcaptcha.md).

# Funcaptcha

## 1. Create task

<mark style="color:blue;">`GET`</mark> | <mark style="color:purple;">`POST`</mark> `https://api.mrccaptcha.com/captcha/FunCaptchaTokenTask?apikey=YOUR_API_KEY&sitekey=SITE_KEY`

**Body or Query param**

<table><thead><tr><th width="144">Name</th><th width="88">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>apikey</code></td><td>string<mark style="color:red;">*</mark></td><td>Your Package API-Key, you can get it <a href="https://mrccaptcha.com/member/packages">here</a></td></tr><tr><td><code>sitekey</code></td><td>string<mark style="color:red;">*</mark></td><td>The Funcaptcha public key of website</td></tr><tr><td><code>proxy</code></td><td>string<mark style="color:red;">*</mark></td><td>Format <code>host:port:login:password</code> or <code>host:port</code>  or <code>protocol://host:port</code> or <code>protocol://login:password@host:port</code> or <code>login:password:host:port</code>  or <code>login:password@host:port</code> or ... . Some websites will verify that the submit IP and the resolution IP match, so in some cases, you need to pass an additional proxy.<br>Note: For rotating proxies, you must use ones that support session or sticky session.<br>Using proxies also consumes a lot of data for downloading captcha images, so you should consider the costs.<br>We recommend using proxies in the EU/US regions to ensure connection speed.</td></tr><tr><td><code>datablob</code></td><td>string<mark style="color:red;">*</mark></td><td>Blob of Funcaptcha challenge generated by your userAgent.</td></tr><tr><td><code>userAgent</code></td><td>string<mark style="color:red;">*</mark></td><td>UserAgent of your browser (or app). See type of supported browsers in below to set your userAgent</td></tr></tbody></table>

**Type of supported browsers**

<table><thead><tr><th width="192">Device</th><th>Browsers</th><th>Support sitekey</th></tr></thead><tbody><tr><td>android</td><td>["chrome", "edge"]</td><td>*</td></tr><tr><td>iphone</td><td>["chrome", "safari"]</td><td>*</td></tr><tr><td>ipad</td><td>["chrome", "safari"]</td><td>*</td></tr><tr><td>windows</td><td>["chrome", "edge"]</td><td>*</td></tr><tr><td>macos</td><td>["chrome", "edge", "safari"]</td><td>*</td></tr><tr><td>x-app-android</td><td></td><td>Only X (Twitter) sitekeys</td></tr></tbody></table>

**API for get random userAgent (recommend to use)**

<mark style="color:blue;">`GET`</mark>`https://api.mrccaptcha.com/captcha/random-useragent?device={device}&browser={browser}`

**Example:** `https://api.mrccaptcha.com/captcha/random-useragent?device=iphone&browser=safari`

**Response of create task api**

{% tabs %}
{% tab title="200" %}

```json
{
  "Code": 0,
  "TaskId": 1234,
  "Message": "OK"
}
```

{% endtab %}
{% endtabs %}

**Code examples**

{% tabs %}
{% tab title="NodeJS" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "apikey": "PKG.bjhfweb7rf236rfg7237rg4273uh3br273rg47",
  "sitekey": "00000000-0000-0000-0000-000000000000",
  "proxy": "27.26.25.24:1234:user:pass"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.mrccaptcha.com/captcha/FunCaptchaTokenTask',
  headers: { 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.mrccaptcha.com/captcha/FunCaptchaTokenTask"

payload = json.dumps({
  "apikey": "PKG.bjhfweb7rf236rfg7237rg4273uh3br273rg47",
  "sitekey": "00000000-0000-0000-0000-000000000000",
  "proxy": "27.26.25.24:1234:user:pass"
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

class Program
{
    static async Task Main(string[] args)
    {
        var client = new HttpClient();

        var data = new
        {
            apikey = "PKG.bjhfweb7rf236rfg7237rg4273uh3br273rg47",
            sitekey = "00000000-0000-0000-0000-000000000000",
            proxy = "27.26.25.24:1234:user:pass"
        };

        var json = JsonConvert.SerializeObject(data);
        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri("https://api.mrccaptcha.com/captcha/FunCaptchaTokenTask"),
            Content = content
        };

        try
        {
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();

            var responseBody = await response.Content.ReadAsStringAsync();
            Console.WriteLine(responseBody);
        }
        catch (HttpRequestException e)
        {
            Console.WriteLine($"Request error: {e.Message}");
        }
    }
}
```

{% endtab %}
{% endtabs %}

## 2. Get task result

<mark style="color:blue;">`GET`</mark> `https://api.mrccaptcha.com/captcha/getresult?apikey=YOUR_API_KEY&taskId=TASK_ID`

**Query params**

<table><thead><tr><th width="123">Name</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>apikey</code></td><td>string<mark style="color:red;">*</mark></td><td>Your Package API-Key, you can get it <a href="https://mrccaptcha.com/member/packages">here</a></td></tr><tr><td><code>taskId</code></td><td>string<mark style="color:red;">*</mark></td><td>The task id from step 1</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="SUCCESS" %}

```json
{
  "Code": 0,
  "Status": "SUCCESS",
  "Data": {
      "Token": "4AHK_HuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3"
      "metadata": {
          "captchaId": "05878906-9abb-4d5a-9a45-27ec161286aa" || undefined
      }
  }
}
```

{% endtab %}

{% tab title="ERROR" %}

```json
{
  "Code": 0,
  "Status": "ERROR",
  "Message": "Error description",
  "Data": null
}
```

{% endtab %}

{% tab title="PENDING" %}

```json
{
  "Code": 0,
  "Status": "PENDING",
  "Data": null
}
```

{% endtab %}

{% tab title="PROCESSING" %}

```json
{
  "Code": 0,
  "Status": "PROCESSING",
  "Data": null
}
```

{% endtab %}
{% endtabs %}
