Skip to content

CapMonsterCloud/capmonstercloud-client-js

Repository files navigation

✅ CapMonster.Cloud — Fast, Reliable CAPTCHA Solving for Automation & Scraping

CapMonster Cloud

CapMonster Cloud JavaScript SDK

npm version

Official JavaScript and Node.js SDK for the CapMonster Cloud API. Use this package when you want to create tasks, poll for results, and integrate CapMonster Cloud from Node.js or browser-based apps.

Links

Installation

npm i @zennolab_com/capmonstercloud-client

Need to test before depositing? Contact support and we’ll add trial credits to your account.

Minimal example (Node.js / TypeScript)

const { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request } = require('@zennolab_com/capmonstercloud-client');

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

  const recaptchaV2Request = new RecaptchaV2Request({
    websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
    websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
  });

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

run()
  .then(() => {
    console.log('DONE');
    process.exit(0);
  })
  .catch((err) => {
    console.error(err);
    process.exit(1);
  });

Supported task families include reCAPTCHA, GeeTest, Turnstile, image-to-text, and additional task types documented in the public docs.

Usage with Browser (with or without Typescript)

Browser implementation use fetch instead of http(s). For browser usage you need some Module Bundler (e.g. Webpack).

import { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request } 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 recaptchaV2Request = new RecaptchaV2Request({
    websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
    websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
    proxy: {
      proxyType: 'http',
      proxyAddress: '8.8.8.8',
      proxyPort: 8080,
      proxyLogin: 'proxyLoginHere',
      proxyPassword: 'proxyPasswordHere',
    },
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.132 Safari/537.36',
  });

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

Debug

For debugging set DEBUG environmental variable to one of possible values (see debug module)

DEBUG=cmc-* node app.js

Supported request classes

⭐️ If you find this project useful, please give it a star on GitHub!

About

Official JS/TS SDK for CapMonster Cloud API. Solves captchas (reCAPTCHA, GeeTest, Turnstile, ImageToText, and others) from Node.js or browser. Includes TypeScript types, supports proxies and user-agent customization. Works with Webpack and other bundlers.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors