Skip to content

Repository files navigation

CapMonster Cloud Node.js SDK: TypeScript CAPTCHA Solver & Anti-Bot API Client

CapMonster Cloud Node.js SDK

Official Node.js and TypeScript SDK for automated CAPTCHA solving in web scraping, browser automation, and testing workflows.

npm version npm downloads GitHub Stars GitHub Forks License: MIT


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 CommonCaptcha to 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-client

πŸš€ 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
Image-to-Text ImageToTextRequest
Complex image tasks ComplexImageRecaptchaRequest, ComplexImageTaskRecognitionRequest
Custom anti-bot tasks DataDomeRequest, ImpervaRequest, TSPDRequest, and other supported custom-task classes

🌐 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, and getBalance.

πŸ“š Documentation & Support


⭐ Star History

If this SDK helps your automation or testing workflow, please consider giving the repository a star.

Star History Chart


πŸ“„ License

MIT Β© ZennoLab / CapMonster Cloud

About

Official Node.js / TypeScript SDK for CapMonster Cloud. Bypass reCAPTCHA, Cloudflare Turnstile, DataDome in Puppeteer and Playwright scripts.

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages