Skip to main content
Are you experiencing issues obtaining the token?
Contact support

TenDI - Tencent captcha

More on the topic in our blog
Attention!

This task will be performed using our proxy servers.

Request parameters

type<string>required

CustomTask


class<string>required

TenDI


websiteURL<string>required

The address of the main page where the captcha is solved.


websiteKey<string>required

captchaAppId. For example "websiteKey": "189123456" - is a unique parameter for your site. You can take it from an html page with a captcha or from traffic (see description below).


metadata.captchaUrl<string>optional

Link to the captcha script. It usually ends with TCaptcha.js or TCaptcha-global.js. You can find it in the list of requests (see example below).


userAgent<string>optional

Browser User-Agent. Pass only the actual UA from Windows OS. Now this is version: userAgentPlaceholder


proxyType<string>optional

http - regular http/https proxy;
https - try this option only if "http" doesn't work (required for some custom proxies);
socks4 - socks4 proxy;
socks5 - socks5 proxy.


proxyAddress<string>optional

IPv4/IPv6 proxy IP address. Not allowed:

  • using of hostnames;
  • using transparent proxies (where you can see the client's IP);
  • using proxies on local machines.


proxyPort<integer>optional

Proxy port.


proxyLogin<string>optional

Proxy-server login.


proxyPassword<string>optional

Proxy-server password.

How to get websiteKey (captchaAppId)

Turn on the Developer Tools, go to the Network tab, activate the captcha and look at the requests. Some of them will contain the parameter value you need. In this case websiteKey=aid

How to get captchaUrl

Open Developer Tools, go to the Network tab, trigger the captcha, and inspect the network requests. Among them, you will find TCaptcha.js or TCaptcha-global.js, where you can find a link like this:

Create task method

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task": {
"type": "CustomTask",
"class": "TenDI",
"websiteURL": "https://example.com",
"websiteKey": "189123456",
"userAgent": "userAgentPlaceholder"
}
}

Response

{
"errorId":0,
"taskId":407533072
}

Get task result method

Use the getTaskResult method to get the TenDI solution.

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 407533072
}

Response

{
"errorId":0,
"status":"ready",
"solution": {
"data": {
"randstr": "@EcL",
"ticket": "tr03lHUhdnuW3neJZu.....7LrIbs*"
},
"headers": {
"User-Agent": "userAgentPlaceholder"
}
}
}

How to Find All Required Parameters for Task Creation

Automatically

A convenient way to automate the search for all necessary parameters. Some parameters are regenerated every time the page loads, so you'll need to extract them through a browser — either regular or headless (e.g., using Playwright). Since the values of dynamic parameters are short-lived, the captcha must be solved immediately after retrieving them.

Important!

The code snippets provided are basic examples for familiarization with extracting the required parameters. The exact implementation will depend on your captcha page, its structure, and the HTML elements/selectors it uses.

Show code (Node.js)
import { chromium } from "playwright";

(async () => {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();

// Intercept requests
page.on("request", (request) => {
const url = request.url();
if (
url.startsWith("https://sg.captcha.qcloud.com/cap_union_prehandle?aid=")
) {
const parsedUrl = new URL(url);
const aid = parsedUrl.searchParams.get("aid");
console.log("Extracted aid:", aid);
}
});

await page.goto("https://www.example.com/", { waitUntil: "load" });

await page.waitForTimeout(5000);

await browser.close();
})();

Use SDK Library

// https://github.com/ZennoLab/capmonstercloud-client-js

import { CapMonsterCloudClientFactory, ClientOptions, TenDIRequest } from '@zennolab_com/capmonstercloud-client';

document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '<your capmonster.cloud API key>' }));
console.log(await cmcClient.getBalance());

const tenDIRequest = new TenDIRequest({
websiteURL: 'https://example.com',
websiteKey: 'websiteKey',
});

console.log(await cmcClient.Solve(tenDIRequest));
});