How to bypass Tencent captcha
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
{ "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.