Tencent
Token-based method to bypass Tencent captcha.
Task types
- TencentTaskProxyless - we use our own pool of proxies
- TencentTask - we use your proxies
TencentTaskProxyless task type specification
Property | Type | Required | Description |
---|---|---|---|
type | String | Yes | Task type: TencentTaskProxyless TencentTask |
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 |
appId | String | Yes | The value of appId parameter in the website source code. |
captchaScript | String | No | Captcha script URL from the page source code. Default: https://turing.captcha.qcloud.com/TCaptcha.js |
TencentTask task type specification
TencentTask
extends TencentTaskProxyless
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
TencentTaskProxyless
{
"clientKey": "YOUR_API_KEY",
"task": {
"type":"TencentTaskProxyless",
"appId":"190014885",
"websiteURL":"https://www.example.com/"
}
}
TencentTask
{
"clientKey": "YOUR_API_KEY",
"task": {
"type":"TencentTask",
"appId":"190014885",
"websiteURL":"https://www.example.com/",
"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": {
"appid": "190014885",
"ret": 0,
"ticket": "tr0344YjJASGmJGtohyWS_y6tJKiqVPIdFgl87vWlVaQoueR8D6DH28go-i-VjeassM31SXO7D0*",
"randstr": "@KVN"
},
"cost": "0.00299",
"ip": "1.2.3.4",
"createTime": 1692863536,
"endTime": 1692863556,
"solveCount": 1
}
Using the token
The token is passed to a callback function defined in 2nd argument of TencentCaptcha
constructor call during the captcha initialization.
new TencentCaptcha(CaptchaAppId, callback, options);
This function is usually used to make a request to the website backend where the token is verified. You can execute the callback function passing the token as an argument or build a request to the backend using passing the token.
For example, if the captcha is initialized like this:
const myCallbackFunction = (token) {
// verify the token
}
var captcha = new TencentCaptcha('190014885', myCallbackFunction, {});
captcha.show();
You need to call:
let data = JSON.parse(res)
myCallbackFunction(res.solution)
Where res
is the JSON response from the API.