@zennolab_com/capmonstercloud-client
v2.9.1
Published
Official JS client library for https://capmonster.cloud/ captcha recognition service
Downloads
13,874
Readme
CapMonster Cloud Node.js SDK: TypeScript CAPTCHA Solver & Anti-Bot API Client
Official JavaScript and TypeScript client library for CapMonster Cloud. Add automated CAPTCHA-solving tasks to Node.js, TypeScript, Puppeteer, Playwright, Cypress, and HTTP-based workflows.
Use the SDK with supported CAPTCHA and anti-bot task types, including reCAPTCHA v2/v3/Enterprise, Cloudflare Turnstile, GeeTest, DataDome, Amazon WAF, Imperva, and image-to-text tasks.
👉 Get your Free API Key & Free Trial Balance on CapMonster Cloud
⚡ Highlights
- ⚡ Node.js & TypeScript: Typed request models for supported task types.
- 🧩 Modern CAPTCHA coverage: Work with reCAPTCHA, Turnstile, GeeTest, Amazon WAF, DataDome, Imperva, and more.
- 🌐 Automation-ready: Use with Playwright, Puppeteer, Cypress, scraping tools, and custom HTTP clients.
- 🛠️ Dedicated or custom payloads: Use request classes or
CommonCaptchato submit a full task payload. - 📖 Official docs: Current task parameters and API methods are maintained in CapMonster Cloud documentation.
📦 Installation
Install the package from npm:
npm install @zennolab_com/capmonstercloud-clientThe package published on npm already includes the compiled files and is ready to use after installation.
Build from this repository
Git does not contain the compiled dist output. The examples below import @zennolab_com/capmonstercloud-client, and inside this repository that name points at dist. After cloning, install dependencies and build before running an example or a test:
npm install
npm run buildRun npm run build again after changing the source.
🚀 Quick Start
Create an API key in the CapMonster Cloud Dashboard, install the package, then use one of the examples below.
1. Solve reCAPTCHA v2 (TypeScript)
import {
CapMonsterCloudClientFactory,
ClientOptions,
RecaptchaV2Request,
} from '@zennolab_com/capmonstercloud-client';
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: 'YOUR_API_KEY' }),
);
const result = await client.Solve(
new RecaptchaV2Request({
websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
}),
);
console.log(result.solution);2. Solve Cloudflare Turnstile (TypeScript)
import {
CapMonsterCloudClientFactory,
ClientOptions,
TurnstileRequest,
} from '@zennolab_com/capmonstercloud-client';
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: 'YOUR_API_KEY' }),
);
const result = await client.Solve(
new TurnstileRequest({
websiteURL: 'https://tsinvisble.zlsupport.com',
websiteKey: '0x4AAAAAAABUY0VLtOUMAHxE',
}),
);
console.log(result.solution);3. CommonJS Example and Balance Check
const {
CapMonsterCloudClientFactory,
ClientOptions,
RecaptchaV2Request,
} = require('@zennolab_com/capmonstercloud-client');
async function run() {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: 'YOUR_API_KEY' }),
);
console.log('Balance:', await client.getBalance());
const task = new RecaptchaV2Request({
websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
});
const result = await client.Solve(task);
console.log(result.solution);
}
run().catch(console.error);4. Submit a Custom Payload with CommonCaptcha
Use CommonCaptcha when you need to provide a complete task payload directly.
const {
CapMonsterCloudClientFactory,
ClientOptions,
CommonCaptcha,
} = require('@zennolab_com/capmonstercloud-client');
async function run() {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: 'YOUR_API_KEY' }),
);
const task = new CommonCaptcha({
task: {
type: 'RecaptchaV2Task',
websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
},
});
console.log(await client.Solve(task));
}
run().catch(console.error);🛡️ Supported Task Families
Refer to the official Supported CAPTCHA Types for current task parameters, response formats, and examples.
| Task family | Example request classes in this SDK |
| :--- | :--- |
| reCAPTCHA | RecaptchaV2Request, RecaptchaV2EnterpriseRequest, RecaptchaV3ProxylessRequest |
| Cloudflare Turnstile | TurnstileRequest |
| GeeTest | GeeTestRequest |
| Amazon WAF | AmazonRequest, AmazonProxylessRequest |
| Image-to-Text | ImageToTextRequest |
| Complex image tasks | ComplexImageRecaptchaRequest, ComplexImageTaskRecognitionRequest |
| Custom anti-bot tasks | DataDomeRequest, ImpervaRequest, TenDIRequest, ProsopoRequest, BasiliskRequest |
🌐 Browser Use
The package can also be bundled for browser use. Browser implementations use native fetch, so use a compatible module bundler such as Webpack when integrating it into a frontend build.
Keep API keys private. Do not expose production CapMonster Cloud API keys in public frontend code.
🐛 Debugging
Set the DEBUG environment variable to enable the package logger:
DEBUG=cmc-* node app.js🛠️ How It Works
[ Node.js Script / Browser Automation ]
│
▼
[ Create task request with target data ]
│
▼
[ CapMonster Cloud Node.js SDK ] ──► createTask API request
│
▼
[ SDK waits for the task result ]
│
▼
[ Receive token / solution ] ──► Use it in your workflow⚙️ Best Practices
- Use the right task model: Choose a request type that matches the target protection; validate all required fields against the official documentation.
- Keep session context consistent: For tasks that use a proxy, align the proxy settings with the associated browser or scraping session.
- Use tokens promptly: CAPTCHA tokens can expire, so submit or inject the returned solution immediately.
- Monitor balance and API responses: See the API methods reference for
createTask,getTaskResult, andgetBalance.
📚 Documentation & Support
- 📖 Getting Started
- 🧩 Supported CAPTCHA Types
- ⚙️ API Methods: createTask, getTaskResult, getBalance
- 🌐 Browser Extension Guides
- 💬 CapMonster Cloud
