Skip to main content
Are you experiencing issues obtaining the token?
Contact support

Friendly Captcha

Attention!

CapMonster Cloud uses built-in proxies by default — their cost is already included in the service. You only need to specify your own proxies in cases where the website does not accept the token or access to the built-in services is restricted.

If you are using a proxy with IP authorization, make sure to whitelist the address 65.21.190.34.

Request parameters

type<string>required

CustomTask


class<string>required

friendly


websiteURL<string>required

Full URL of the page with the captcha.


websiteKey<string>required

Friendly Captcha key (see section How to find the sitekey value).


apiGetLib (inside metadata)<string>required

URL of the JS file. Specify the URL depending on the captcha version:

  • V1: apiGetLib = https://cdn.jsdelivr.net/npm/[email protected]/widget.module.min.js, where X.Y.Z is the client version from the x-frc-client header.

  • V2: apiGetLib = URL of the site.min.js file loaded on the page. Example: https://cdn.jsdelivr.net/npm/@friendlycaptcha/[email protected]/site.min.js, where X.Y.Z is the client version.

See also sections Create task method and How to determine Friendly Captcha version.


userAgent<string>optional

Browser User-Agent.
Provide only the current Windows UA: userAgentPlaceholder


proxyType<string>optional

http - regular HTTP/HTTPS proxy;
https - use if http doesn’t work (required for some custom proxies);
socks4 - SOCKS4 proxy;
socks5 - SOCKS5 proxy.


proxyAddress<string>optional

Proxy IP address (IPv4/IPv6). Not allowed:

  • Transparent proxies
  • Local machine proxies


proxyPort<integer>optional

Proxy port.


proxyLogin<string>optional

Proxy login.


proxyPassword<string>optional

Proxy password.

Create task method

Use the apiGetLib parameter value in metadata according to the Friendly Captcha version.

Example:

For V1

"apiGetLib": "https://cdn.jsdelivr.net/npm/[email protected]/widget.module.min.js"

For V2

"apiGetLib": "https://cdn.jsdelivr.net/npm/@friendlycaptcha/[email protected]/site.min.js"

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task": {
"type": "CustomTask",
"class": "friendly",
"websiteKey": "FFMGEMAD2K3JJ35P",
"websiteURL": "https://example.com",
"userAgent": "userAgentPlaceholder",
"metadata": {
"apiGetLib":"https://cdn.jsdelivr.net/npm/[email protected]/widget.module.min.js"
}
}

Response

{
"errorId": 0,
"taskId": 407533077
}

Get task result method

Use the getTaskResult method to obtain the Friendly Captcha solution.
The token format in the response depends on the captcha version used on the website:

V1: "56a3727f1f9ae4f339c8e512913cd6f8.ac7W...MAKgAAAN+MAQArAAAAjxMBACwAAAB5QgAA.AgAB"

V2: "AQQA.8Q2TbgK_..._pknXDweJjKT2qwmroOhHcZsU4dHyu-jaGIPx9k7432p_num13buuTu6n4lVA=="

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey": "API_KEY",
"taskId": 407533077
}

Response

{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"status": "ready",
"solution": {
"data": {
"token": "56a3727f1f9ae4f339c8e512913cd6f8.ac7W...MAKgAAAN+MAQArAAAAjxMBACwAAAB5QgAA.AgAB"
}
}
}

The obtained token value should be inserted into the corresponding field:

VersionToken field
V1input.frc-captcha-solution
V2input.frc-captcha-response

How to find the sitekey value

  • For V1, this parameter can be found in network requests by filtering them with the keywords sitekey or puzzle?sitekey=:


  • For V2, use search with the keywords sitekey or data-sitekey in network requests or in the page source elements:

How to determine Friendly Captcha version

Friendly Captcha can be used in two main versions: V1 and V2.
The version can be identified by loaded scripts or network requests.

Friendly Captcha V1

Used if the following scripts are present on the page:

widget.min.js
widget.module.min.js

or if puzzle?sitekey= appears in network requests:

To determine the client version, you need to:

  1. Open the found puzzle?sitekey=... request and go to Headers → Request Headers

  2. Find the x-frc-client header:

The header contains the Friendly Captcha client version used on the site:

x-frc-client: <version>

Example values: 0.9.14, 0.9.19, etc.

  1. After determining the version from x-frc-client, insert it into the CDN link:
https://cdn.jsdelivr.net/npm/friendly-challenge@<VERSION>/widget.module.min.js

For example, if x-frc-client = 0.9.14, use:

https://cdn.jsdelivr.net/npm/[email protected]/widget.module.min.js

This link must be passed into the apiGetLib parameter when creating a task.


Friendly Captcha V2

If site.min.js is loaded on the site, it means Friendly Captcha V2 is used.

Pass the site.min.js URL into the apiGetLib parameter when creating a task:

Automatic detection of Friendly Captcha version

You can automate the process of detecting the Friendly Captcha version in the browser using the following solution:

Show code
(async function detectFriendlyCaptcha() {
const result = {
version: null,
clientVersion: null,
indicators: [],
siteMinJsLinks: [],
detectedCdn: null
};

const scripts = Array.from(document.scripts).map(s => s.src);

for (const src of scripts) {
if (!src) continue;

if (src.includes("widget.min.js") || src.includes("widget.module.min.js")) {
result.version = "V1";
result.detectedCdn = src;
result.indicators.push("Found widget script");
}

const match = src.match(/friendly-challenge@(\d+\.\d+\.\d+)/);
if (match) {
result.clientVersion = match[1];
result.version = "V1";
result.detectedCdn = src;
result.indicators.push("Detected CDN version");
}
}

const puzzleElements = document.querySelectorAll(
'[id*="friendly"], [class*="frc"], iframe[src*="friendly"]'
);

if (puzzleElements.length > 0) {
result.indicators.push("Found captcha DOM elements");
if (!result.version) result.version = "V1";
}

const resources = performance.getEntriesByType("resource");

for (const r of resources) {
if (r.name.includes("puzzle?sitekey")) {
result.version = "V1";
result.indicators.push("Found puzzle?sitekey request");
}
}

for (const src of scripts) {
if (!src) continue;

if (src.includes("site.min.js")) {
result.version = "V2";
result.detectedCdn = src;
result.indicators.push("Found site.min.js");
result.siteMinJsLinks.push(src);
}
}

if (!result.version) {
result.version = "Unknown (not detected)";
}

console.log("FriendlyCaptcha Detection Result:");
console.log(result);

return result;
})();