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.js
on 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. |
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
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "FriendlyCaptchaTaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "2FZFEVS1FZCGQ9"
}
}
FriendlyCaptchaTask
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "FriendlyCaptchaTask",
"websiteURL": "https://example.com",
"websiteKey": "2FZFEVS1FZCGQ9",
"proxyType": "http",
"proxyAddress": "1.2.3.4",
"proxyPort": "8080",
"proxyLogin": "user23",
"proxyPassword": "p4$w0rd"
}
}
Response example
Method: getTaskResult
API endpoint: https://api.2captcha.com/getTaskResult
{
"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:
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:
doneCallback('f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD')