What is Tencent Captcha (TenDI) and how do I solve it?
Tencent Captcha is an automation protection system developed by Tencent. It is widely used on various online platforms such as online shopping, social media and financial services to protect against spam, fraud and other types of abuse.
The main type of Tencent Captcha checker is a slider, it prompts the user to move the slider so that the puzzle elements come together:

There are also graphical captchas, where you need to click on the desired elements in sequence:

Alternatively, the user is prompted to decrypt the audio captcha:

Tencent also offers intelligent verification (or “smart verification”), similar to what many other systems offer, such as Google's reCAPTCHA. This smart verification uses machine learning algorithms and user behavior analysis to determine whether an action on a web resource is genuine or an automated attack.
CapMonster Cloud helps to overcome most different types of captchas, including Tencent Captcha. To do this, you need to send a request to the server in JSON format using POST method, it should look like this:
{
"clientKey": "dce6bcbb1a728ea8d871de6d169a2057",
"task": {
"type": "CustomTask",
"class": "TenDI",
"websiteURL": "https://domain.com",
"websiteKey": "189123456",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
}
}
Parameters used in the query:
The sample response in case of a successful solution should be something like this (also in JSON format):
{
"errorId":0,
"taskId":407533072
}
An example of obtaining the result of a solution:
The getTaskResult is used:
{
"errorId":0,
"status":"ready",
"solution": {
"data": {
"randstr": "@EcL",
"ticket": "tr03lHU nuW3neJZu.....7LrIbs*"
},
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
}
}
}
randstr is a random string that is part of the Tencent Captcha solution, used to identify and validate the captcha solution.
ticket is a unique identifier, which is also part of the captcha solution, used to validate the correctness of the captcha solution and gain access to protected content or functionality.
To send a request to the server for automatic solution, you need to know the unique captcha identifier in advance. It is quite easy to find it: load the necessary page with the captcha in your browser, call the captcha itself and open the Developer Tools. In the Network tab, among the queries you should find a line containing the keyword “aid” - this is the captcha identifier on the given page. It looks like this:

Here are some sample scripts for solving this type of captcha on the CapMonster Cloud server in JavaScript and Python.
// Creating a task to be sent to the server
async function solveTencentCaptcha(apiKey, pageUrl, captchaKey) {
const solveUrl = 'https://api.capmonster.cloud/createTask';
// Preparing data for the task
const taskData = {
clientKey: apiKey,
task: {
type: 'CustomTask',
class: 'TenDI',
websiteURL: pageUrl,
websiteKey: captchaKey,
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
}
};
try {
// Sending a POST request to create a task
const responseData = await postJson(solveUrl, taskData);
// Captcha id extraction
return responseData.taskId;
} catch (error) {
// Error handling when sending a request
console.error('Error when sending a request:', error.message);
return null;
}
}
async function getCaptchaSolution(apiKey, taskId) {
// URL for requesting task results
const resultUrl = 'https://api.capmonster.cloud/getTaskResult';
// Preparing data for requesting results
const resultData = { clientKey: apiKey, taskId: taskId };
// Cycle for querying task results with a limit of 15 attempts
for (let i = 0; i < 15; i++) {
try {
// Sending a POST request to get task results
const responseData = await postJson(resultUrl, resultData);
// Checking the task status
if (responseData.status === 'ready') return responseData;
} catch (error) {
// Handling errors in obtaining results
console.error('Error when receiving a result:', error.message);
}
// Waiting 1 second before the next attempt
await sleep(1000);
}
// Displaying an error message if the result could not be obtained in 15 attempts
console.error('Failed to get a result in 15 attempts');
return null;
}
// Function for sending POST requests with JSON data
async function postJson(url, data) {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
return response.json();
}
// Function for pausing execution for a specified time
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
// The main function that launches the captcha solving process
async function main() {
const apiKey = 'YOUR_CAPMONSTER_API';
const pageUrl = 'https://example.com';
const captchaKey = '189939991';
// CAPTCHA solving
const taskId = await solveTencentCaptcha(apiKey, pageUrl, captchaKey);
console.log("Task ID:", taskId);
if (taskId) {
// Obtaining task results
const resultData = await getCaptchaSolution(apiKey, taskId);
if (resultData) console.log("REsult:", resultData);
}
}
main();
# Import of essential libraries
import requests
import time
# Function for sending a request to create a captcha solving task
def solve_tencent_captcha(api_key, page_url, captcha_key):
#URL for sending a request to create a task
solve_url = 'https://api.capmonster.cloud/createTask'
# Preparation of data for the task
task_data = {
"clientKey": api_key,
"task": {
"type": "CustomTask",
"class": "TenDI",
"websiteURL": page_url,
"websiteKey": captcha_key,
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
}
}
# Sending a POST request
response = requests.post(solve_url, json=task_data)
# Retrieving data from the response and returning the task identifier
response_data = response.json()
task_id = response_data.get('taskId')
return task_id
# Function for getting the captcha solution
def get_captcha_solution(api_key, task_id):
# URL of task result retrieval
result_url = 'https://api.capmonster.cloud/getTaskResult'
# Preparing data for result request
result_data = {
"clientKey": api_key,
"taskId": task_id
}
# Parameters for limiting the number of attempts to obtain a result
attempts = 0
max_attempts = 15
# Cycle for the repeated result requests
while attempts < max_attempts:
# Sending a POST request to get the result
response = requests.post(result_url, json=result_data)
response_data = response.json()
# Checking the status of a response
if response_data['status'] == 'ready':
return response_data
# Waiting for 1 second before the next request
time.sleep(1)
attempts += 1
# Display a message if the maximum number of attempts has been exceeded
print("The number of attempts to obtain a result has been exceeded")
return None
# Main function
def main():
api_key = 'YOUR_CAPMONSTER_API'
page_url = 'https://example.com'
captcha_key = '189939991'
# Solving captcha and getting task ID
task_id = solve_tencent_captcha(api_key, page_url, captcha_key)
print("Task ID:", task_id)
# If the task is successfully created, repeat the queries to obtain the result
if task_id:
result_data = get_captcha_solution(api_key, task_id)
print("Result:", result_data)
# Launching the main function when the script is started
if __name__ == "__main__":
main()
Check out our tools and solutions to easily solve Tencent Captcha and other types of CAPTCHAs:
CapMonster Cloud browser extension Chrome / Firefox
Note: We'd like to remind you that the product is used to automate testing on your own websites and on websites to which you have legal access.