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

Yidun - NECaptcha

Examples of tasks

Attention!

CapMonster Cloud uses built-in proxies by default — their cost is already included in the service. You only need to specify your own proxies in cases where the website does not accept the token or access to the built-in services is restricted.

If you are using a proxy with IP authorization, make sure to whitelist the address 65.21.190.34.

Request parameters

type<string>required

YidunTask


websiteURL<string>required

Full URL of the page with the captcha.


websiteKey<string>required

The siteKey value found on the page (see example below on how to find it).


userAgent<string>optional

Browser User-Agent.
Pass only a valid UA from Windows OS. Currently it is: userAgentPlaceholder


yidunGetLib<string>optional

Path to the JavaScript file responsible for loading the captcha on the page.
Important: specify the full URL (https://...).
Recommended if fields like challenge, hcg, or hct are present on the site.


yidunApiServerSubdomain<string>optional

Subdomain of the Yidun API server.
Important: must differ from the standard domains c.dun.163.com and c-v6.dun.163.com.
You can include or omit https://.
Required when using a custom server (often in Enterprise versions).


challenge<string>optional

Unique identifier of the current captcha.
Typically passed in network requests during initialization or rendering of the captcha.
Indicates Enterprise captcha.


hcg<string>optional

Captcha hash used in the request.
Can be obtained together with challenge.


hct<integer>optional

Numeric timestamp used in Enterprise version validation.


proxyType<string>optional

http - standard http/https proxy;
https - try this if "http" doesn't work (needed for some custom proxies);
socks4 - socks4 proxy;
socks5 - socks5 proxy.


proxyAddress<string>optional

IP address of the proxy (IPv4/IPv6). Not allowed:

  • using transparent proxies (those exposing the client IP);
  • using local machine proxies.


proxyPort<integer>optional

Proxy port.


proxyLogin<string>optional

Proxy login.


proxyPassword<string>optional

Proxy password.


Create task method

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

Request

{
"clientKey": "API_KEY",
"task":
{
"type": "YidunTask",
"websiteURL": "https://www.example.com",
"websiteKey": "6cw0f0485d5d46auacf9b735d20218a5",
"userAgent": "userAgentPlaceholder"
}
}

Response

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

Get task result method

Use the getTaskResult method to retrieve the Yidun captcha solution.

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

Request

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

Response

{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"solution": {
"token": "CN31_9AwsPmaYcJameP_09rA0vkVMQsPij...RXTlFJFc3"
},
"status": "ready"
}

When are yidunGetLib and yidunApiServerSubdomain needed?

If you find the challenge, hcg, and hct parameters in network requests on the page (Network tab), this means the Enterprise (or Business) version of Yidun is in use. You should also provide yidunGetLib and yidunApiServerSubdomain to solve it correctly.

Example task
{
"type": "YidunTask",
"websiteURL": "https://id7.cloud.example.com/IframeLogin.html",
"websiteKey": "0f123r2a6am56431yg17n8rz6grz0ym6",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
"yidunGetLib": "https://example.com/captcha/b/v3//static/load.min.js",
"yidunApiServerSubdomain": "csc-captcha-example.com",
"challenge": "abc55382321547556267884cc3ba57c3d8a7c14f541fd9c6a7f1ce3173d3b9a1",
"hcg": "9a217825f3dcfac3d34e551e93819d610dec931e5e2a2236edf0e1f3f320c191",
"hct": 1751469954806
}

How to find websiteURL and websiteKey

Open Developer Tools, activate the captcha, go to the Network tab, and find a request that starts with get?referer= or check?referer=. The value of referer is your websiteURL.

Sometimes, the referer is URL-encoded, such as: https%3A%2F%2Fid.example.com%2F. To decode it into a readable address, you can use the browser console:

The value of id is the websiteKey.


For Yidun Enterprise:

websiteURL, websiteKey, and yidunApiServerSubdomain can be found the same way as regular Yidun captcha - in requests starting with get?referer= or check?referer=


yidunGetLib

This is the path to the JavaScript file responsible for loading the captcha on the page. You can find it in the network tab - it’s usually named something like load.min.js.


challenge, hcg, hct

All these parameters can be found in network requests. Typically, the relevant request starts with cscPreprocess?reflushCode=.

Use the SDK library

Show code (for browser)
// https://github.com/ZennoLab/capmonstercloud-client-js

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

const API_KEY = "YOUR_API_KEY"; // Specify your CapMonster Cloud API key

document.addEventListener("DOMContentLoaded", async () => {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);

// Basic example without proxy
// CapMonster Cloud automatically uses its own proxies
let yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com", // URL of the page with captcha
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5",
userAgent: "userAgentPlaceholder"
});

// Example of using your own proxy
// Uncomment this block if you want to use your own proxy
/*
const proxy = {
proxyType: "http",
proxyAddress: "123.45.67.89",
proxyPort: 8080,
proxyLogin: "username",
proxyPassword: "password"
};

yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com",
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5",
userAgent: "userAgentPlaceholder",
proxy
});
*/

// Optionally, you can check the balance
const balance = await client.getBalance();
console.log("Balance:", balance);

const result = await client.Solve(yidunRequest);
console.log("Solution:", result);
});
Show code (Node.js)
// https://github.com/ZennoLab/capmonstercloud-client-js

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

const API_KEY = "YOUR_API_KEY"; // Specify your CapMonster Cloud API key

async function solveYidun() {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);

// Basic example without proxy
// CapMonster Cloud automatically uses its own proxies
let yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com", // URL of the page with captcha
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5",
userAgent: "userAgentPlaceholder"
});

// Example of using your own proxy
// Uncomment this block if you want to use your own proxy

/*
const proxy = {
proxyType: "http",
proxyAddress: "123.45.67.89",
proxyPort: 8080,
proxyLogin: "username",
proxyPassword: "password"
};

yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com", // URL of the page with captcha
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5",
userAgent: "userAgentPlaceholder",
proxy
});
*/

// Optionally, you can check the balance
const balance = await client.getBalance();
console.log("Balance:", balance);

const result = await client.Solve(yidunRequest);
console.log("Solution:", result);
}

solveYidun().catch(err => console.error("Error:", err));