Friendly Captcha
Token-based method to bypass Friendly Captcha.
The token received must be set as the value attribute of the input element with name frc-captcha-solution and/or passed to the callback function defined in data-callback attribute of the captcha div.
Important: To successfully use the received token, the captcha widget must not be loaded on the page. To do this, you need to abort request to
/friendlycaptcha/...module.min.json the page. When the captcha widget is already loaded on the page, there is a high probability that the received token will not work.
Task types
- FriendlyCaptchaTaskProxyless - we use our own pool of proxies
- FriendlyCaptchaTask - we use your proxies
FriendlyCaptchaTaskProxyless task type specification
| Property | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | Task type: FriendlyCaptchaTaskProxyless FriendlyCaptchaTask |
| websiteURL | String | Yes | The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users |
| websiteKey | String | Yes | The value of data-sitekey attribute of captcha's div element on page. |
| version | String | No | Friendly Captcha version.v1 — Friendly Captcha V1.v2 — Friendly Captcha V2.Default: v1.See the official Friendly Captcha documentation for more details on the differences between v1 and v2. |
| moduleScript | String | No | URL of the Friendly Captcha script with type="module" attribute, found on the captcha page. |
| nomoduleScript | String | No | URL of the Friendly Captcha script with nomodule attribute, found on the captcha page. |
FriendlyCaptchaTask task type specification
FriendlyCaptchaTask extends FriendlyCaptchaTaskProxyless adding a set of proxy-related parameters listed below
| Property | Type | Required | Description |
|---|---|---|---|
| proxyType | String | Yes | Proxy type: http socks4 socks5 |
| proxyAddress | String | Yes | Proxy IP address or hostname |
| proxyPort | Integer | Yes | Proxy port |
| proxyLogin | String | No | Login for basic authentication on the proxy |
| proxyPassword | String | No | Password for basic authentication on the proxy |
Request examples
Method: createTask
API endpoint: https://api.2captcha.com/createTask
FriendlyCaptchaTaskProxyless
Friendly Captcha V1:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "FriendlyCaptchaTaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "2FZFEVS1FZCGQ9",
"version": "v1",
"moduleScript": "https://cdn.example.com/static/js/friendly-challenge/@0.9.1/widget.module.min.js",
"nomoduleScript": "https://cdn.example.com/static/js/friendly-challenge/@0.9.1/widget.js"
}
}
Friendly Captcha V2:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "FriendlyCaptchaTaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "2FZFEVS1FZCGQ9",
"version": "v2",
"moduleScript": "https://cdn.example.com/v2/widget.module.min.js",
"nomoduleScript": "https://cdn.example.com/v2/widget.js"
}
}
FriendlyCaptchaTask
Friendly Captcha V1:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "FriendlyCaptchaTask",
"websiteURL": "https://example.com",
"websiteKey": "2FZFEVS1FZCGQ9",
"version": "v1",
"proxyType": "http",
"proxyAddress": "1.2.3.4",
"proxyPort": "8080",
"proxyLogin": "user23",
"proxyPassword": "p4$w0rd",
"moduleScript": "https://cdn.example.com/static/js/friendly-challenge/@0.9.1/widget.module.min.js",
"nomoduleScript": "https://cdn.example.com/static/js/friendly-challenge/@0.9.1/widget.js"
}
}
Friendly Captcha V2:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "FriendlyCaptchaTask",
"websiteURL": "https://example.com",
"websiteKey": "2FZFEVS1FZCGQ9",
"version": "v2",
"proxyType": "http",
"proxyAddress": "1.2.3.4",
"proxyPort": "8080",
"proxyLogin": "user23",
"proxyPassword": "p4$w0rd",
"moduleScript": "https://cdn.example.com/v2/widget.module.min.js",
"nomoduleScript": "https://cdn.example.com/v2/widget.js"
}
}
Response example
Method: getTaskResult
API endpoint: https://api.2captcha.com/getTaskResult
json
{
"errorId": 0,
"status": "ready",
"solution": {
"token": "f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD" },
"cost": "0.00299",
"ip": "1.2.3.4",
"createTime": 1692863536,
"endTime": 1692863556,
"solveCount": 1
}
Using the token
Use the returned token as a value for input with name = frc-captcha-solution, then submit it's parent form, for example:
js
document.querySelector('input.frc-captcha-solution').value='f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD'
document.querySelector('form').submit()
Please note, that form name can be customized with data-solution-field-name attribute, then you need to use the name set as the attribute's value.
If there's a callback function defined, you can call it passing the token as argument. For example, if data-callback="doneCallback" you should run it as:
js
doneCallback('f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD')