跳转到主要内容
获取令牌时遇到问题吗
联系支持

TenDI - 腾讯验证码

更多相关内容,请访问我们的博客
注意!

此任务将使用我们的代理服务器执行。

请求参数

type<string>required

CustomTask


class<string>required

TenDI


websiteURL<string>required

解决验证码的主页地址。


websiteKey<string>required

captchaAppId。例如 "websiteKey": "189123456" - 是您网站的唯一参数。您可以从带有验证码的HTML页面或流量中获取它(参见下面的描述)。


userAgent<string>optional

浏览器用户代理。只传递 Windows 操作系统的实际 UA。现在是版本userAgentPlaceholder


proxyType<string>optional

http - 普通的 http/https 代理;
https - 仅在 "http" 不起作用时尝试(某些自定义代理服务器要求);
socks4 - socks4 代理;
socks5 - socks5 代理。


proxyAddress<string>optional

代理 IP 地址 IPv4/IPv6。不允许:

  • 使用主机名;
  • 使用透明代理(其中客户端 IP 可见);
  • 使用来自本地网络的代理。


proxyPort<integer>optional

代理端口。


proxyLogin<string>optional

代理登录。


proxyPassword<string>optional

代理密码。

如何获取网站密钥(captchaAppId)

打开开发者工具,转到网络标签,激活验证码并查看请求。其中一些将包含您需要的参数值。在这种情况下,websiteKey=aid

创建任务方法

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

要求

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

回应

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

获取任务结果方法

使用getTaskResult方法获取TenDI的解决方案。

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

要求

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

回应

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

使用 SDK 库

// 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));
});