Warning
DEPRECATED / УСТАРЕЛО
This repository is no longer maintained. Please use our new, official Node.js / TypeScript SDK repository:
👉 CapMonsterCloud/capmonster-nodejs-captcha-solver
Official JS client library for capmonster.cloud captcha recognition service
Via NPM:
npm i @zennolab_com/capmonstercloud-client
const{ CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request }=require('@zennolab_com/capmonstercloud-client');asyncfunctionrun(){constcmcClient=CapMonsterCloudClientFactory.Create(newClientOptions({clientKey: '<your capmonster.cloud API key>'}));console.log(awaitcmcClient.getBalance());constrecaptchaV2Request=newRecaptchaV2Request({websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',});console.log(awaitcmcClient.Solve(recaptchaV2Request));}run().then(()=>{console.log('DONE');process.exit(0);}).catch((err)=>{console.error(err);process.exit(1);});Use CommonCaptcha when you want to pass a full task payload directly, for example when a new captcha type is not yet covered by a dedicated request class.
const{ CapMonsterCloudClientFactory, ClientOptions, CommonCaptcha }=require('@zennolab_com/capmonstercloud-client');asyncfunctionrun(){constcmcClient=CapMonsterCloudClientFactory.Create(newClientOptions({clientKey: '<your capmonster.cloud API key>'}));constcommonCaptcha=newCommonCaptcha({task: {type: 'RecaptchaV2Task',websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',},});console.log(awaitcmcClient.Solve(commonCaptcha));}run();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()=>{constcmcClient=CapMonsterCloudClientFactory.Create(newClientOptions({clientKey: '<your capmonster.cloud API key>'}));console.log(awaitcmcClient.getBalance());constrecaptchaV2Request=newRecaptchaV2Request({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(awaitcmcClient.Solve(recaptchaV2Request));});For debugging set DEBUG environmental variable to one of possible values (see debug module)
DEBUG=cmc-* node app.js- AlibabaRequest
- AltchaRequest
- AmazonRequest
- BasiliskRequest
- BinanceRequest
- CastleRequest
- ComplexImageFunCaptchaRequest
- ComplexImageHCaptchaRequest
- ComplexImageRecaptchaRequest
- ComplexImageTaskRecognitionRequest
- DataDomeRequest
- FriendlyRequest
- FunCaptchaRequest
- GeeTestRequest
- HCaptchaRequest
- HuntRequest
- ImageToTextRequest
- ImpervaRequest
- MTCaptchaRequest
- ProsopoRequest
- RecaptchaV2EnterpriseRequest
- RecaptchaV2Request
- RecaptchaV3EnterpriseRequest
- RecaptchaV3ProxylessRequest
- TemuRequest
- TenDIRequest
- TSPDRequest
- TurnstileRequest
- YidunRequest