### Install CapMonsterCloud JS Client via NPM Source: https://github.com/zennolab/capmonstercloud-client-js/blob/main/README.md Install the client library using NPM. This is the first step before using the library in your Node.js or browser projects. ```bash npm i @zennolab_com/capmonstercloud-client ``` -------------------------------- ### Node.js Usage with CapMonsterCloud Client Source: https://github.com/zennolab/capmonstercloud-client-js/blob/main/README.md Demonstrates how to use the CapMonsterCloud client in a Node.js environment. Requires your capmonster.cloud API key. This example shows how to get the balance and solve a reCAPTCHA v2. ```javascript const { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request } = require('@zennolab_com/capmonstercloud-client'); async function run() { const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '' })); 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); }); ``` -------------------------------- ### Browser Usage with CapMonsterCloud Client Source: https://github.com/zennolab/capmonstercloud-client-js/blob/main/README.md Shows how to integrate the CapMonsterCloud client in a browser environment using ES module imports. Ensure you are using a module bundler like Webpack. This example includes proxy configuration and a user agent string. ```javascript import { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request } from '@zennolab_com/capmonstercloud-client'; document.addEventListener('DOMContentLoaded', async () => { const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '' })); 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)); }); ``` -------------------------------- ### Create CapMonsterCloudClient Instance Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Create a CapMonsterCloudClient instance using the factory method. Requires your API key and optionally accepts a custom service URL and software ID. ```typescript const { CapMonsterCloudClientFactory, ClientOptions } = require('@zennolab_com/capmonstercloud-client'); const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY', // required: your capmonster.cloud API key serviceUrl: 'https://api.capmonster.cloud', // optional: defaults to this value softId: 54, // optional: software identifier }) ); ``` -------------------------------- ### Enable Debug Logging with DEBUG Environment Variable Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Activate detailed debug output from the library by setting the `DEBUG` environment variable. Use namespaces like `cmc-*` for all logs or `cmc-task` for task-specific logs. ```bash # Enable all capmonster debug output DEBUG=cmc-* node app.js # Enable only task-level debug (task creation, polling, result) DEBUG=cmc-task node app.js ``` -------------------------------- ### client.Solve with GeeTestRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves GeeTest v3 and v4 captchas. For v3, `challenge` is required and must be fetched fresh for each solve attempt. For v4, `initParameters` are used instead. ```APIDOC ## `client.Solve` with `GeeTestRequest` — Solve GeeTest ### Description Solves GeeTest v3 and v4 captchas. For v3, `challenge` is required and must be fetched fresh for each solve attempt. For v4, `initParameters` are used instead. ### Method `client.Solve(request: GeeTestRequest)` ### Parameters #### Request Body (GeeTestRequest) - **websiteURL** (string) - Required - The URL of the website with the GeeTest captcha. - **gt** (string) - Required - The public key of the GeeTest captcha. - **challenge** (string) - Required for GeeTest v3 - The challenge value, must be fetched fresh for each solve attempt. - **version** (string) - Required - The GeeTest version, either '3' or '4'. - **userAgent** (string) - Optional - The user agent string to use for the request. - **initParameters** (object) - Required for GeeTest v4 - Initialization parameters for GeeTest v4. - **captcha_id** (string) - Required - The captcha ID for GeeTest v4. ### Request Example ```javascript const { CapMonsterCloudClientFactory, ClientOptions, GeeTestRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveGeeTest() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); // GeeTest v3 const v3Request = new GeeTestRequest({ websiteURL: 'https://example.com/geetest', gt: '81dc9bdb52d04dc20036dbd8313ed055', challenge: 'd93591bdf7860e1e4ee2fca799911215', // must be fetched fresh each time! version: '3', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', }); // GeeTest v4 const v4Request = new GeeTestRequest({ websiteURL: 'https://example.com/geetest-v4', gt: 'e392e1d7fd421dc63325744d5a2b9c73', version: '4', initParameters: { captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', }, }); const result = await client.Solve(v3Request); if (!result.error) { const { challenge, validate, seccode } = result.solution; console.log('GeeTest v3 solution:', { challenge, validate, seccode }); } } solveGeeTest(); ``` ### Response #### Success Response - **solution** (object) - Contains the solution details. - **challenge** (string) - The GeeTest challenge value (for v3). - **validate** (string) - The GeeTest validate value. - **seccode** (string) - The GeeTest seccode value. - **error** (boolean) - Indicates if an error occurred during the solving process. ``` -------------------------------- ### CapMonsterCloudClientFactory.Create Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Creates and returns a CapMonsterCloudClient configured with your API key and optional custom service URL. Internally reuses HTTP client instances per service URL. ```APIDOC ## CapMonsterCloudClientFactory.Create - Create a client instance Creates and returns a `CapMonsterCloudClient` configured with your API key and optional custom service URL. Internally reuses HTTP client instances per service URL. ```typescript const { CapMonsterCloudClientFactory, ClientOptions } = require('@zennolab_com/capmonstercloud-client'); const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY', // required: your capmonster.cloud API key serviceUrl: 'https://api.capmonster.cloud', // optional: defaults to this value softId: 54, // optional: software identifier }) ); ``` ``` -------------------------------- ### Solve GeeTest with GeeTestRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves GeeTest v3 and v4 captchas. For v3, 'challenge' must be fetched fresh for each solve. For v4, 'initParameters' are used. Ensure the 'gt' parameter is correct for the target site. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, GeeTestRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveGeeTest() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); // GeeTest v3 const v3Request = new GeeTestRequest({ websiteURL: 'https://example.com/geetest', gt: '81dc9bdb52d04dc20036dbd8313ed055', challenge: 'd93591bdf7860e1e4ee2fca799911215', // must be fetched fresh each time! version: '3', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', }); // GeeTest v4 const v4Request = new GeeTestRequest({ websiteURL: 'https://example.com/geetest-v4', gt: 'e392e1d7fd421dc63325744d5a2b9c73', version: '4', initParameters: { captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', }, }); const result = await client.Solve(v3Request); if (!result.error) { const { challenge, validate, seccode } = result.solution; console.log('GeeTest v3 solution:', { challenge, validate, seccode }); } } solveGeeTest(); ``` -------------------------------- ### client.Solve with RecaptchaV2Request Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves a standard Google reCAPTCHA v2 challenge. Supports both proxyless and proxy-based modes. Returns a `CaptchaResult` where `solution.gRecaptchaResponse` contains the token. ```APIDOC ## client.Solve with RecaptchaV2Request - Solve reCAPTCHA v2 Solves a standard Google reCAPTCHA v2 challenge. Supports both proxyless and proxy-based modes. Returns a `CaptchaResult` where `solution.gRecaptchaResponse` contains the token. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request } = require('@zennolab_com/capmonstercloud-client'); async function solveRecaptchaV2() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); // Proxyless const request = new RecaptchaV2Request({ websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high', websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd', nocache: false, // set true if the site rejects some tokens }); // With proxy const requestWithProxy = new RecaptchaV2Request({ websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high', websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd', proxy: { proxyType: 'http', // 'http' | 'https' | 'socks4' | 'socks5' proxyAddress: '8.8.8.8', proxyPort: 8080, proxyLogin: 'user', proxyPassword: 'pass', }, userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', cookies: 'session=abc123', }); const result = await client.Solve(request); if (result.error) { console.error('Error:', result.error); // e.g. 'Timeout' | 'ZERO_BALANCE' | 'CAPTCHA_UNSOLVABLE' } else { console.log('Token:', result.solution.gRecaptchaResponse); // Expected: Token: 03AGdBq24PBCbwiDRaS... } } solveRecaptchaV2(); ``` ``` -------------------------------- ### client.Solve with RecaptchaV3EnterpriseRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves reCAPTCHA v3 Enterprise with optional proxy and `enterprisePayload` support. ```APIDOC ## `client.Solve` with `RecaptchaV3EnterpriseRequest` — Solve reCAPTCHA v3 Enterprise Solves reCAPTCHA v3 Enterprise with optional proxy and `enterprisePayload` support. ### Parameters #### Request Body - **websiteURL** (string) - Required - The URL of the website where the captcha is located. - **websiteKey** (string) - Required - The public key of the website. - **minScore** (number) - Optional - The minimum score for the reCAPTCHA token (0.1 to 0.9). - **pageAction** (string) - Optional - The page action for the captcha. - **enterprisePayload** (object) - Optional - Additional parameters for enterprise implementations. - **s** (string) - Required - The 's' parameter for enterprise payload. ### Request Example ```typescript const request = new RecaptchaV3EnterpriseRequest({ websiteURL: 'https://example.com/checkout', websiteKey: '6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16', minScore: 0.6, pageAction: 'checkout', enterprisePayload: { s: 'token-value-here' }, }); ``` ### Response #### Success Response (200) - **solution.gRecaptchaResponse** (string) - The solved reCAPTCHA token. ``` -------------------------------- ### client.Solve with DataDomeRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves DataDome bot-protection challenges using either an `htmlPageBase64`-encoded captcha page or a direct `captchaUrl`. ```APIDOC ## `client.Solve` with `DataDomeRequest` — Solve DataDome Solves DataDome bot-protection challenges using either an `htmlPageBase64`-encoded captcha page or a direct `captchaUrl`. ### Parameters - **websiteURL** (string) - Required - The URL of the protected website. - **userAgent** (string) - Required - The user agent string of the browser. - **_class** (string) - Required - Must be set to `'DataDome'`. - **metadata** (object) - Required - Contains details for solving the DataDome challenge. - **captchaUrl** (string) - Required if `htmlPageBase64` is not provided - The direct URL to the DataDome captcha. - **htmlPageBase64** (string) - Required if `captchaUrl` is not provided - The base64-encoded HTML of the captcha page. - **datadomeCookie** (string) - Required - The `datadome` cookie value. ### Request Example (using captchaUrl) ```typescript const request = new DataDomeRequest({ websiteURL: 'https://example.com/protected', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', _class: 'DataDome', metadata: { captchaUrl: 'https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMA...&hash=789361B674...&cid=mY4z8GNF...&t=fe&s=20964&e=7fc4a0a...', datadomeCookie: 'datadome=...', }, }); ``` ### Request Example (using htmlPageBase64) ```typescript const requestFromHtml = new DataDomeRequest({ websiteURL: 'https://example.com/protected', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', _class: 'DataDome', metadata: { htmlPageBase64: Buffer.from('...datadome captcha page...').toString('base64'), datadomeCookie: 'datadome=AHrlqAAAAAMA...', }, }); ``` ### Response #### Success Response - **error** (string) - Description of the error if any - **solution** (object) - Contains the captcha solution - **cookie** (string) - The DataDome cookie required to bypass the protection. ### Response Example ```json { "error": null, "solution": { "cookie": "datadome=some_new_cookie_value" } } ``` ``` -------------------------------- ### client.Solve with HCaptchaRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves standard and invisible hCaptcha challenges. For invisible/custom hCaptcha implementations that pass `rqdata`, both `data` and `userAgent` must be provided together. ```APIDOC ## `client.Solve` with `HCaptchaRequest` — Solve hCaptcha Solves standard and invisible hCaptcha challenges. For invisible/custom hCaptcha implementations that pass `rqdata`, both `data` and `userAgent` must be provided together. ### Parameters #### Request Body - **websiteURL** (string) - Required - The URL of the website where the captcha is located. - **websiteKey** (string) - Required - The public key of the website. - **isInvisible** (boolean) - Optional - Whether the hCaptcha is invisible. - **data** (string) - Optional - The `rqdata` value for invisible/custom hCaptcha implementations. - **userAgent** (string) - Optional - The user agent string to use for the request. Required if `data` is provided. - **cookies** (string) - Optional - Cookies to send with the request. - **fallbackToActualUA** (boolean) - Optional - Whether to use an up-to-date user agent for better acceptance. ### Request Example (Standard) ```typescript const request = new HCaptchaRequest({ websiteURL: 'https://lessons.zennolab.com/captchas/hcaptcha/?level=easy', websiteKey: '472fc7af-86a4-4382-9a49-ca9090474471', isInvisible: false, fallbackToActualUA: true, }); ``` ### Request Example (Invisible with rqdata) ```typescript const invisibleRequest = new HCaptchaRequest({ websiteURL: 'https://example.com/protected', websiteKey: 'a5f74b19-9e45-40e0-b45d-47ff91b7a6c2', isInvisible: true, data: 'rqdata-value-from-network-request', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', cookies: 'cf_clearance=abc', }); ``` ### Response #### Success Response (200) - **solution.gRecaptchaResponse** (string) - The solved hCaptcha token. ``` -------------------------------- ### client.getBalance Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Fetches the current monetary balance of the account associated with the configured API key. Returns a `GetBalanceResponseSuccess` object with a `balance` field. ```APIDOC ## client.getBalance - Retrieve account balance Fetches the current monetary balance of the account associated with the configured API key. Returns a `GetBalanceResponseSuccess` object with a `balance` field. ```typescript const { CapMonsterCloudClientFactory, ClientOptions } = require('@zennolab_com/capmonstercloud-client'); async function checkBalance() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); try { const result = await client.getBalance(); console.log('Balance:', result.balance); // e.g. 10.5432 } catch (err) { console.error('Failed to get balance:', err.message); } } checkBalance(); // Expected output: Balance: 10.5432 ``` ``` -------------------------------- ### client.Solve with RecaptchaV3ProxylessRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves reCAPTCHA v3 (proxyless). Accepts `minScore` (0.1–0.9) and `pageAction` parameters to target the correct challenge variant. ```APIDOC ## `client.Solve` with `RecaptchaV3ProxylessRequest` — Solve reCAPTCHA v3 Solves reCAPTCHA v3 (proxyless). Accepts `minScore` (0.1–0.9) and `pageAction` parameters to target the correct challenge variant. ### Parameters #### Request Body - **websiteURL** (string) - Required - The URL of the website where the captcha is located. - **websiteKey** (string) - Required - The public key of the website. - **minScore** (number) - Optional - The minimum score for the reCAPTCHA token (0.1 to 0.9). - **pageAction** (string) - Optional - The page action for the captcha; defaults to 'verify'. ### Request Example ```typescript const request = new RecaptchaV3ProxylessRequest({ websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta', websiteKey: '6Le0xVkUAAAAAIt20XEB4rVhYOODgTl00d18oE66', minScore: 0.3, pageAction: 'login', }); ``` ### Response #### Success Response (200) - **solution.gRecaptchaResponse** (string) - The solved reCAPTCHA token. ``` -------------------------------- ### client.Solve with RecaptchaV2EnterpriseRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves Google reCAPTCHA v2 Enterprise, supporting additional `enterprisePayload` parameters required by enterprise implementations. ```APIDOC ## `client.Solve` with `RecaptchaV2EnterpriseRequest` — Solve reCAPTCHA v2 Enterprise Solves Google reCAPTCHA v2 Enterprise, supporting additional `enterprisePayload` parameters required by enterprise implementations. ### Parameters #### Request Body - **websiteURL** (string) - Required - The URL of the website where the captcha is located. - **websiteKey** (string) - Required - The public key of the website. - **enterprisePayload** (object) - Optional - Additional parameters for enterprise implementations. - **s** (string) - Required - The 's' parameter for enterprise payload. - **userAgent** (string) - Optional - The user agent string to use for the request. - **pageAction** (string) - Optional - The page action for the captcha. ### Request Example ```typescript const request = new RecaptchaV2EnterpriseRequest({ websiteURL: 'https://example.com/login', websiteKey: '6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16', enterprisePayload: { s: '2JvUXHNTnZl1Jb6WEvbDyBMzrMTR7oQ78...', }, userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', pageAction: 'login', }); ``` ### Response #### Success Response (200) - **solution.gRecaptchaResponse** (string) - The solved reCAPTCHA token. ``` -------------------------------- ### Cancellation with `AbortController` Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Enable cooperative cancellation of in-flight requests and polling loops for all methods (`getBalance`, `Solve`) by passing an `AbortController` as the last argument. ```APIDOC ## Cancellation with `AbortController` All methods (`getBalance`, `Solve`) accept an optional `AbortController` as their last argument, enabling cooperative cancellation of in-flight requests and polling loops. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2Request } = require('@zennolab_com/capmonstercloud-client'); async function solveWithCancellation() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const controller = new AbortController(); // Cancel after 30 seconds const cancelTimer = setTimeout(() => { console.log('Cancelling solve...'); controller.abort(); }, 30000); const request = new RecaptchaV2Request({ websiteURL: 'https://example.com', websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd', }); const result = await client.Solve(request, undefined, controller); clearTimeout(cancelTimer); if (result.error) { console.error('Error (possibly cancelled):', result.error); // result.error === 'Timeout' when aborted } else { console.log('Token:', result.solution.gRecaptchaResponse); } } solveWithCancellation(); ``` ``` -------------------------------- ### Enable Debug Logging Source: https://github.com/zennolab/capmonstercloud-client-js/blob/main/README.md To enable detailed debugging output for the CapMonsterCloud client, set the DEBUG environmental variable. This helps in troubleshooting by providing verbose logs. ```bash DEBUG=cmc-* node app.js ``` -------------------------------- ### client.Solve with AmazonRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves Amazon AWS WAF captchas. All parameters (`challengeScript`, `captchaScript`, `websiteKey`, `context`, `iv`) must be extracted from page source or JavaScript execution. Set `cookieSolution: true` to receive `aws-waf-token` cookie instead of `captcha_voucher`. ```APIDOC ## `client.Solve` with `AmazonRequest` — Solve Amazon WAF Solves Amazon AWS WAF captchas. All parameters (`challengeScript`, `captchaScript`, `websiteKey`, `context`, `iv`) must be extracted from page source or JavaScript execution. Set `cookieSolution: true` to receive `aws-waf-token` cookie instead of `captcha_voucher`. ### Parameters - **websiteURL** (string) - Required - The URL of the website where the WAF is active. - **challengeScript** (string) - Required - The URL of the challenge script. - **captchaScript** (string) - Required - The URL of the captcha script. - **websiteKey** (string) - Required - The website key, often found as `window.gokuProps.key`. - **context** (string) - Required - The context, often found as `window.gokuProps.context`. - **iv** (string) - Required - The initialization vector, often found as `window.gokuProps.iv`. - **cookieSolution** (boolean) - Optional - If true, returns the `aws-waf-token` cookie instead of `captcha_voucher`. ### Request Example ```typescript const request = new AmazonRequest({ websiteURL: 'https://example.com/checkout', challengeScript: 'https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/challenge.js', captchaScript: 'https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/captcha.js', websiteKey: 'AQIDAHjcYu...', // window.gokuProps.key context: 'qoJYgnKsc...', // window.gokuProps.context iv: 'CgABAAIAD...', // window.gokuProps.iv cookieSolution: false, }); ``` ### Response #### Success Response - **error** (string) - Description of the error if any - **solution** (object) - Contains the captcha solution - **captcha_voucher** (string) - The captcha voucher string. - **existing_token** (string) - An existing token if applicable. ### Response Example ```json { "error": null, "solution": { "captcha_voucher": "some_voucher_string", "existing_token": "some_token_string" } } ``` ``` -------------------------------- ### client.Solve with FunCaptchaRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves FunCaptcha challenges. The `data` field is used to pass the blob value required by some implementations. ```APIDOC ## `client.Solve` with `FunCaptchaRequest` — Solve FunCaptcha (Arkose Labs) ### Description Solves FunCaptcha challenges. The `data` field is used to pass the blob value required by some implementations. ### Method `client.Solve(request: FunCaptchaRequest)` ### Parameters #### Request Body (FunCaptchaRequest) - **websiteURL** (string) - Required - The URL of the website with the FunCaptcha. - **websitePublicKey** (string) - Required - The public key of the FunCaptcha. - **funcaptchaApiJSSubdomain** (string) - Optional - The subdomain for the FunCaptcha API, used for non-standard installations. - **data** (string) - Optional - Additional data, often a JSON string containing a 'blob' value, required by some FunCaptcha implementations. ### Request Example ```javascript const { CapMonsterCloudClientFactory, ClientOptions, FunCaptchaRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveFunCaptcha() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const request = new FunCaptchaRequest({ websiteURL: 'https://api.funcaptcha.com/fc/api/nojs/?pkey=69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC', websitePublicKey: '69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC', funcaptchaApiJSSubdomain: 'mywebsite-api.funcaptcha.com', // optional, for non-standard installs data: '{"blob":"dyXvXANMbHj1iDyz..."}', // optional blob value }); const result = await client.Solve(request); if (!result.error) { console.log('FunCaptcha token:', result.solution.token); } } solveFunCaptcha(); ``` ### Response #### Success Response - **solution** (object) - Contains the solution details. - **token** (string) - The solved FunCaptcha token. - **error** (boolean) - Indicates if an error occurred during the solving process. ``` -------------------------------- ### client.Solve with ImageToTextRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Converts an image captcha (base64-encoded) to text. Supports site-specific recognition modules, confidence thresholds, case sensitivity, numeric-only mode, and math captchas. ```APIDOC ## `client.Solve` with `ImageToTextRequest` — Solve Image Captcha Converts an image captcha (base64-encoded) to text. Supports site-specific recognition modules, confidence thresholds, case sensitivity, numeric-only mode, and math captchas. ### Parameters - **body** (string) - Required - base64-encoded image, no line breaks - **CapMonsterModule** (string) - Required - The recognition module to use (e.g., `CapMonsterModules.Universal`, `CapMonsterModules.Google`) - **recognizingThreshold** (number) - Optional - 0–100; task is free if confidence < threshold - **Case** (boolean) - Optional - true = case-sensitive recognition - **numeric** (number) - Optional - 1 = numbers only, 0 = any characters - **math** (boolean) - Optional - true = solve arithmetic expressions ### Request Example ```typescript const imageBase64 = fs.readFileSync('./captcha.png').toString('base64'); const request = new ImageToTextRequest({ body: imageBase64, CapMonsterModule: CapMonsterModules.Universal, recognizingThreshold: 65, Case: true, numeric: 1, math: false, }); ``` ### Response #### Success Response - **error** (string) - Description of the error if any - **solution** (object) - Contains the captcha solution - **text** (string) - The recognized captcha text ### Response Example ```json { "error": null, "solution": { "text": "XK9P2" } } ``` ### Available `CapMonsterModules` | Value | Module | |-------|--------| | `CapMonsterModules.Amazon` | `amazon` | | `CapMonsterModules.Google` | `google` | | `CapMonsterModules.Yandex` | `yandex` | | `CapMonsterModules.Steam` | `steam` | | `CapMonsterModules.Facebook` | `facebook` | | `CapMonsterModules.Vk` | `vk` | | `CapMonsterModules.Universal` | `universal` (all other text captchas) | ``` -------------------------------- ### Solve Binance Captcha with BinanceRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves Binance's custom captcha system. Ensure websiteKey and validateId are extracted from network traffic before each solve. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, BinanceRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveBinance() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const request = new BinanceRequest({ websiteURL: 'https://www.binance.com/en/login', websiteKey: 'login', // bizId / bizType / bizCode from traffic validateId: 'abcdef123456', // validateId / securityId from traffic (dynamic!) userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', }); const result = await client.Solve(request); if (!result.error) { console.log('Binance token:', result.solution.token); } } solveBinance(); ``` -------------------------------- ### Solve hCaptcha with `HCaptchaRequest` Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt This code solves standard and invisible hCaptcha challenges. For invisible hCaptcha with `rqdata`, you must provide both `data` and `userAgent`. The `fallbackToActualUA` option can improve acceptance rates by letting the service use an up-to-date user agent. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, HCaptchaRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveHCaptcha() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); // Standard hCaptcha const request = new HCaptchaRequest({ websiteURL: 'https://lessons.zennolab.com/captchas/hcaptcha/?level=easy', websiteKey: '472fc7af-86a4-4382-9a49-ca9090474471', isInvisible: false, fallbackToActualUA: true, }); // Invisible hCaptcha with rqdata const invisibleRequest = new HCaptchaRequest({ websiteURL: 'https://example.com/protected', websiteKey: 'a5f74b19-9e45-40e0-b45d-47ff91b7a6c2', isInvisible: true, data: 'rqdata-value-from-network-request', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', cookies: 'cf_clearance=abc', }); const result = await client.Solve(request); if (!result.error) { console.log('hCaptcha token:', result.solution.gRecaptchaResponse); } } solveHCaptcha(); ``` -------------------------------- ### Retrieve Account Balance Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Fetch the current account balance using the getBalance method. Ensure your API key is correctly configured. Handles potential errors during the API call. ```typescript const { CapMonsterCloudClientFactory, ClientOptions } = require('@zennolab_com/capmonstercloud-client'); async function checkBalance() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); try { const result = await client.getBalance(); console.log('Balance:', result.balance); // e.g. 10.5432 } catch (err) { console.error('Failed to get balance:', err.message); } } checkBalance(); // Expected output: Balance: 10.5432 ``` -------------------------------- ### Solve DataDome with DataDomeRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves DataDome bot-protection challenges using either a base64-encoded HTML page or a direct captcha URL. Requires website URL, user agent, and metadata including the captcha URL or HTML. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, DataDomeRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveDataDome() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); // Using captchaUrl const request = new DataDomeRequest({ websiteURL: 'https://example.com/protected', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', _class: 'DataDome', metadata: { captchaUrl: 'https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMA...&hash=789361B674...&cid=mY4z8GNF...&t=fe&s=20964&e=7fc4a0a...', datadomeCookie: 'datadome=...', }, }); // Using htmlPageBase64 const requestFromHtml = new DataDomeRequest({ websiteURL: 'https://example.com/protected', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', _class: 'DataDome', metadata: { htmlPageBase64: Buffer.from('...datadome captcha page...').toString('base64'), datadomeCookie: 'datadome=AHrlqAAAAAMA...', }, }); const result = await client.Solve(request); if (!result.error) { console.log('DataDome cookie:', result.solution.cookie); } } solveDataDome(); ``` -------------------------------- ### Solve Binance Captcha Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves Binance's custom captcha system. Requires dynamic `websiteKey` and `validateId` extracted from network traffic. ```APIDOC ## `client.Solve` with `BinanceRequest` — Solve Binance Captcha Solves Binance's custom captcha system. `websiteKey` and `validateId` are dynamic values that must be extracted from network traffic before each solve. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, BinanceRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveBinance() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const request = new BinanceRequest({ websiteURL: 'https://www.binance.com/en/login', websiteKey: 'login', // bizId / bizType / bizCode from traffic validateId: 'abcdef123456', // validateId / securityId from traffic (dynamic!) userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', }); const result = await client.Solve(request); if (!result.error) { console.log('Binance token:', result.solution.token); } } solveBinance(); ``` ``` -------------------------------- ### Debug Logging Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Enable detailed debug output from the Capmonstercloud Client JS library by setting the `DEBUG` environment variable. The library uses the `debug` npm package under the `cmc-*` namespace. ```APIDOC ## Debug Logging Enable debug output by setting the `DEBUG` environment variable. The library uses the `debug` npm package under the `cmc-*` namespace. ```bash # Enable all capmonster debug output DEBUG=cmc-* node app.js # Enable only task-level debug (task creation, polling, result) DEBUG=cmc-task node app.js ``` ``` -------------------------------- ### Solve FunCaptcha with FunCaptchaRequest Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Solves FunCaptcha (Arkose Labs) challenges. The 'data' field can pass the required blob value for some implementations. Ensure 'websitePublicKey' is correct. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, FunCaptchaRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveFunCaptcha() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const request = new FunCaptchaRequest({ websiteURL: 'https://api.funcaptcha.com/fc/api/nojs/?pkey=69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC', websitePublicKey: '69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC', funcaptchaApiJSSubdomain: 'mywebsite-api.funcaptcha.com', // optional, for non-standard installs data: '{"blob":"dyXvXANMbHj1iDyz..."}', // optional blob value }); const result = await client.Solve(request); if (!result.error) { console.log('FunCaptcha token:', result.solution.token); } } solveFunCaptcha(); ``` -------------------------------- ### Solve reCAPTCHA v3 Enterprise with `RecaptchaV3EnterpriseRequest` Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt This snippet solves reCAPTCHA v3 Enterprise, supporting optional proxies and `enterprisePayload`. You can set a `minScore` and `pageAction` for specific challenge targeting. Ensure the `enterprisePayload` is correctly formatted. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV3EnterpriseRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveRecaptchaV3Enterprise() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const request = new RecaptchaV3EnterpriseRequest({ websiteURL: 'https://example.com/checkout', websiteKey: '6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16', minScore: 0.6, pageAction: 'checkout', enterprisePayload: { s: 'token-value-here' }, }); const result = await client.Solve(request); if (!result.error) { console.log('Enterprise V3 token:', result.solution.gRecaptchaResponse); } } solveRecaptchaV3Enterprise(); ``` -------------------------------- ### Solve reCAPTCHA v2 Enterprise with `RecaptchaV2EnterpriseRequest` Source: https://context7.com/zennolab/capmonstercloud-client-js/llms.txt Use this snippet to solve Google reCAPTCHA v2 Enterprise. It supports additional `enterprisePayload` parameters required for enterprise implementations. Ensure you have the correct API key and website/enterprise details. ```typescript const { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2EnterpriseRequest } = require('@zennolab_com/capmonstercloud-client'); async function solveRecaptchaV2Enterprise() { const client = CapMonsterCloudClientFactory.Create( new ClientOptions({ clientKey: 'YOUR_API_KEY' }) ); const request = new RecaptchaV2EnterpriseRequest({ websiteURL: 'https://example.com/login', websiteKey: '6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16', enterprisePayload: { s: '2JvUXHNTnZl1Jb6WEvbDyBMzrMTR7oQ78...', }, userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', pageAction: 'login', }); const result = await client.Solve(request); if (!result.error) { console.log('Enterprise token:', result.solution.gRecaptchaResponse); } } solveRecaptchaV2Enterprise(); ```