Captcha bypass tutorials

How to bypass Tencent captcha

Introduction

Tencent Captcha (TCaptcha) is a modern bot protection system developed by Tencent. Unlike traditional text-input captchas, TCaptcha analyzes user behavior and uses tokens for verification. In this guide, we will thoroughly explain how to automate bypassing this captcha using captcha-solving API services.

Important: The use of automated captcha bypass must comply with the target website's terms of service and the legislation of your jurisdiction.


What is Tencent captcha

Tencent Captcha is a behavioral captcha that evaluates user interaction with a page to determine whether they are human. Key features:

Characteristic Description
Type Token-based behavioral captcha
Visualization Slider, click patterns, puzzles, or invisible verification
Integration Via TCaptcha.js JavaScript library
Identifier appId (CaptchaAppId) — unique application ID in Tencent Cloud

The captcha is initialized on the page as follows:

js Copy
new TencentCaptcha(CaptchaAppId, callback, options);

After successful completion, the captcha calls the callback function with a solution object containing ticket and randstr — these values must be sent to the website's backend for verification.


Preparation: required parameters

To submit a solving task via API, you will need:

Parameter Required Description
type Yes Task type: TencentTaskProxyless or TencentTask
websiteURL Yes Full URL of the page where the captcha loads
appId Yes Value of the appId parameter from the page source code
captchaScript No* URL of the captcha script (default: https://turing.captcha.qcloud.com/TCaptcha.js)
proxyType For TencentTask Proxy type: http, https, socks5
proxyAddress For TencentTask IP or hostname of the proxy server
proxyPort For TencentTask Proxy port
proxyLogin / proxyPassword No Proxy authentication credentials

Important note: Different websites may use different values for captchaScript. Therefore, before sending a captcha solving request, verify whether it matches the "default" value specified in our documentation. In most cases, websites currently use the following captchaScript: https://ca.turing.captcha.qcloud.com/TCaptcha-global.js

How to Find appId on the Page

  1. Open DevTools (F12) → Sources or Network tab
  2. Locate the TCaptcha.js script inclusion or the new TencentCaptcha(...) call
  3. Copy the value of the first argument — this is the appId

Example from source code:

html Copy
<script>
  var captcha = new TencentCaptcha('190014885', function(res) {
    // callback
  });
</script>

Here, appId = '190014885'.


Task Types

The service uses its own proxy pool to solve the captcha. You do not need to configure proxies manually.

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "TencentTaskProxyless",
    "appId": "190014885",
    "websiteURL": "https://www.example.com/"
  }
}

TencentTask (with your proxy)

Use this if the target website blocks requests without a proxy or requires a specific geographic source.

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "TencentTask",
    "appId": "190014885",
    "websiteURL": "https://www.example.com/",
    "proxyType": "http",
    "proxyAddress": "1.2.3.4",
    "proxyPort": 8080,
    "proxyLogin": "user",
    "proxyPassword": "pass"
  }
}

Step by step instructions

Step 1: Create a Task

Endpoint: https://api.2captcha.com/createTask

Send a POST request with the task body (see examples above).

Response:

json Copy
{
  "errorId": 0,
  "taskId": "1234567890"
}

Save the taskId to poll for results.

Step 2: Poll Task Status

Endpoint: https://api.2captcha.com/getTaskResult

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "taskId": "1234567890"
}

Poll every 5–10 seconds until status becomes "ready".

Step 3: Receive the Solution

A successful response contains the token:

json Copy
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "appid": "190014885",
    "ret": 0,
    "ticket": "tr0344YjJASGmJGtohyWS_y6tJKiqVPIdFgl87vWlVaQoueR8D6DH28go-i-VjeassM31SXO7D0*",
    "randstr": "@KVN"
  },
  "cost": "0.00299"
}

Step 4: Using the Token

The received solution object must be passed to the callback function specified during captcha initialization:

js Copy
// Original initialization on the page
const myCallback = (token) => {
  // token contains { appid, ret, ticket, randstr }
  fetch('/api/verify', {
    method: 'POST',
    body: JSON.stringify(token)
  });
};

var captcha = new TencentCaptcha('190014885', myCallback, {});
captcha.show();

// After receiving the solution from the API:
let solution = JSON.parse(apiResponse);
myCallback(solution.solution); // ← pass the solution

The token is valid for a limited time (usually 1–5 minutes). Use it immediately after receiving it.


Python Example

python Copy
import time
import requests
from twocaptcha import TwoCaptcha

# Initialize client
solver = TwoCaptcha('YOUR_API_KEY', server='rucaptcha.com')

try:
    # Submit task
    result = solver.tencent(
        app_id='190014885',
        url='https://www.example.com/',
        # proxy={
        #     'type': 'HTTP',
        #     'uri': 'login:pass@1.2.3.4:8080'
        # }
    )
    
    print("Solution received:")
    print(result)
    
    # Use the token in your script
    ticket = result['ticket']
    randstr = result['randstr']
    
    # Example: send to target website
    response = requests.post(
        'https://www.example.com/api/verify',
        json={
            'appid': result['appid'],
            'ticket': ticket,
            'randstr': randstr
        }
    )
    print(response.json())

except Exception as e:
    print(f"Error: {e}")

The 2captcha-python library automatically polls the task status and returns the ready solution.


Integration Tips

  1. Logging: Save taskId, request time, and response for debugging.
  2. Retries: Implement exponential backoff for errors.
  3. Proxies: For TencentTask, use residential proxies — they are blocked less frequently.
  4. User-Agent: If the website checks headers, pass an up-to-date User-Agent through the proxy.
  5. Caching: Do not attempt to solve the same captcha twice — tokens are single-use.


Conclusion

Tencent Captcha is a modern behavioral protection system where server-side token verification (ticket and randstr) plays a key role. For proper integration, it is essential to correctly extract the appId, pass the parameters, and handle the verification result on the backend side.

When implementing, consider the token's lifespan, request security requirements, and specific captcha configuration features on the target website. A properly configured integration helps balance protection against automated requests with user convenience.