Skip to main content
Are you experiencing issues obtaining the token?
Contact support

ComplexImage Recognition


Attention!

Using proxy servers is not required for this task.

Request parameters

type<string>required

ComplexImageTask


class<string>required

recognition


imagesBase64<array>required

Images array in base64 encoding. Example: [ “/9j/4AAQSkZJRgABAQEAAAAAAAD…”]


Task (inside metadata)<string>required

Possible values: oocl_rotate_new and others
Task name (in English).

oocl_rotate_new

Create task oocl_rotate_new

In the request we pass two images: background and circle.

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"{background_base64}",
"{circle_base64}"
],
"metadata": {
"Task": "oocl_rotate_new"
}
}
}

Background example (background_base64):

Circle example (circle_base64):

Response

{
"errorId":0,
"taskId":407533072
}

Get task result oocl_rotate_new

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 407533072
}

Response Degrees by which the circle should be rotated clockwise.

{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution":
{
"answer":[130.90909],
"metadata":{"AnswerType":"NumericArray"}
}
}

oocl_rotate_double_new

Create task oocl_rotate_double_new

In the request we pass three images: background, ring, circle.

POST
https://api.capmonster.cloud/createTask

Request

{ 
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"{background_base64}",
"{ring_base64}",
"{circle_base64}"
],
"metadata": {
"Task": "oocl_rotate_double_new"
}
}
}

Background (background_base64):

Ring (ring_base64):

Circle (circle_base64):

Response

{
"errorId":0,
"taskId":407533072
}

Get task result oocl_rotate_double_new

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 407533072
}

Response Degrees by which the ring should be turned counterclockwise and the circle clockwise.

{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution":
{
"answer":[130.90909],
"metadata":{"AnswerType":"NumericArray"}
}
}

betpunch_3x3_rotate

Create task betpunch_3x3_rotate

In the request we pass nine images. The images must be passed in the following order:

POST
https://api.capmonster.cloud/createTask

Request

{ 
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"{image_1_Base64}",
"{image_2_Base64}",
"{image_3_Base64}",
"{image_4_Base64}",
"{image_5_Base64}",
"{image_6_Base64}",
"{image_7_Base64}",
"{image_8_Base64}",
"{image_9_Base64}",
],
"metadata": {
"Task": "betpunch_3x3_rotate"
}
}
}

Response

{
"errorId":0,
"taskId":407533072
}

Get task result betpunch_3x3_rotate

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 407533072
}

Response "answer":[X,X,X,X,X,X,X,X,X], where X is an integer value from 1 to 4 for each image. 4 - means that the image does not need to be rotated; 1-3 - the number of counterclockwise rotations of the image.

{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution":
{
"answer":[4,4,4,4,4,3,1,2,2],
"metadata":{"AnswerType":"NumericArray"}
}
}

bls

Create task bls

In the request, we send 9 images in base64 format. We also pass the sought value TaskArgument in the metadata.

More on the topic in our blog
POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey":{{API_key}},
"task":
{
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"image1_to_base64",
"image2_to_base64",
"image3_to_base64",
"image4_to_base64",
"image5_to_base64",
"image6_to_base64",
"image7_to_base64",
"image8_to_base64",
"image9_to_base64"
],
"metadata": {
"Task": "bls_3x3",
"TaskArgument": "123"
}
}
}

Example task:

Send images converted to base64:

For this example: "TaskArgument": "546"

Response

{
"errorId":0,
"taskId":143998457
}

Get task result bls

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 143998457
}

Response An array of values with elements true or false, depending on whether the number in the image is the sought argument or not.

{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution":
{
"answer":[true,true,false,false,true,false,false,true,true],
"metadata":{"AnswerType":"Grid"}
}
}

shein

Create task shein

In the request, we pass one image in base64 format.

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"base64"
],
"metadata": {
"Task": "shein"
}
}
}

Example task:

Response

{
"errorId":0,
"taskId":143998457
}

Get task result shein

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 143998457
}

Response Coordinates to be clicked on in a specific order.

{
"solution":
{
"answer":[{"X":68.99999964,"Y":201.954889},{"X":127.99999783999999,"Y":281.54887104},{"X":181.00000776,"Y":49.894734680000006}],
"metadata":{"AnswerType":"Coordinate"}
},
"cost":0.0003,
"status":"ready",
"errorId":0,
"errorCode":null,
"errorDescription":null
}

baidu

Create task baidu

Attention!

At the beginning of the solving process, temporary unsolvable responses may occur. This is not an error – the captcha will continue to be solved successfully after initialization.

In the request, we pass one image in base64 format.

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task":
{
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": ["base64"],
"metadata": {
"Task": "baidu"
}
}
}

Example task:

Response

{
"errorId":0,
"taskId":143998457
}

Get task result baidu

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 143998457
}

Response The degrees by which the image needs to be rotated clockwise.

{
"solution":
{
"answer":[297],
"metadata":{"AnswerType":"NumericArray"}
},
"cost":0.0005,
"status":"ready",
"errorId":0,
"errorCode":null,
"errorDescription":null
}

bills_audio

Create task bills_audio

The bills_audio captcha is an audio version of the "receipt captcha," where generated images or data simulate receipts and contain, for example, numbers, amounts, and dates. In this type of task, the user is asked to listen to an audio file and confirm the correctness of the input based on what they hear. This format may look like the following:

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"UklGRnjuAwBXQVZFZm10...f/2f/9/6z/vf8MAAAA"
],
"metadata": {
"Task": "bills_audio",
"PayloadType": "Audio"
}
}
}

Response

{
"errorId": 0,
"taskId": 143998457
}

Get task result bills_audio

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey": "API_KEY",
"taskId": 143998457
}

Response
The response contains the digits extracted from the audio.

{
"solution": {
"answer": [6, 8, 4, 1, 2, 3],
"metadata": {"AnswerType": "Text"}
},
"cost": 0.0008,
"status": "ready",
"errorId": 0,
"errorCode": null,
"errorDescription": null
}

How to get the audio file from the page and convert it to Base64

  1. Open the captcha page, launch DevTools, and go to the Network tab.
  2. Activate the captcha’s audio mode by clicking the corresponding button.
  3. In the list of requests, find a URL like:
    blob:https://example.com/3be79ac6-1b3d-43ef-9a8a-7ad8877b3606
  4. Copy this URL and open it in the browser’s address bar — the captcha audio file in .wav format will open.

  1. Save the file and convert it from .wav to Base64 in any convenient way — for example, using Node.js code:
const fs = require("fs");

// Path to the source .wav file
const filePath = "C:\\Users\\User\\Downloads\\file-acbe-4fb3-9f8e-f989ba6c7fde.wav";

const fileBuffer = fs.readFileSync(filePath);

// Convert to Base64
const base64 = fileBuffer.toString("base64");

// Save the Base64 string to a text file
fs.writeFileSync("output.txt", base64);

console.log("The file has been successfully converted to Base64 and saved as output.txt");
  1. Use the resulting Base64 string in the request to CapMonster Cloud.

How to find Base64

Images on web pages can be represented either as a URL or directly encoded in Base64 format. To find the required value, right-click on the image, select Inspect, and carefully examine the Elements section or the network requests grid—there you can find the URL or the encoded content.

Manually

  1. Open your website where the captcha appears in the browser.
  2. Right-click on the captcha element and select Inspect.

base64ComplexImage

Automatically

To automate parameter extraction, you can retrieve them via a browser (regular or headless, e.g., using Playwright) or directly from HTTP requests. Since dynamic parameter values are short-lived, it is recommended to use them immediately after retrieval.

Important!

The provided code snippets are basic examples for learning how to extract the required parameters. The exact implementation will depend on your captcha page, its structure, and the HTML elements and selectors used.

Show code (Node.js)
import { chromium } from 'playwright';

// Function to extract base64 from src
async function getBase64FromSrc(elementHandle) {
const src = await elementHandle.getAttribute('src');
if (src && src.startsWith('data:image')) {
return src.split(',')[1];
}
return null;
}

// Function to get base64 using a screenshot (if src is not in base64)
async function elementToBase64(elementHandle) {
const base64 = await getBase64FromSrc(elementHandle);
if (base64) {
return base64; // If the image is already in base64, return it
}
const buffer = await elementHandle.screenshot();
return buffer.toString('base64');
}

// Function to convert an array of elements into an array of base64 strings
async function multipleElementsToBase64(elements) {
const base64Array = [];
for (const el of elements) {
const base64 = await elementToBase64(el);
base64Array.push(base64);
}
return base64Array;
}

// -------------------------------------------------------------
// Preparing base64 for different captcha types
// -------------------------------------------------------------

// 1. oocl_rotate_new (background + circle)
async function prepareOoclRotateNew(page) {
const background = await page.$('img.background');
const circle = await page.$('img.circle');

const backgroundBase64 = await elementToBase64(background);
const circleBase64 = await elementToBase64(circle);

return { backgroundBase64, circleBase64 };
}

// 2. oocl_rotate_double_new (background + ring + circle)
async function prepareOoclRotateDoubleNew(page) {
const background = await page.$('img.background');
const ring = await page.$('img.ring');
const circle = await page.$('img.circle');

const backgroundBase64 = await elementToBase64(background);
const ringBase64 = await elementToBase64(ring);
const circleBase64 = await elementToBase64(circle);

return { backgroundBase64, ringBase64, circleBase64 };
}

// 3. betpunch_3x3_rotate (9 small images)
async function prepareBetpunch3x3(page) {
const sectors = await page.$$('img.sector');

const sectorsBase64 = await multipleElementsToBase64(sectors);

return { sectorsBase64 };
}

// 4. bls (9 small images for clicking)
async function prepareBls(page) {
const sectors = await page.$$('img.sector');

const sectorsBase64 = await multipleElementsToBase64(sectors);

return { sectorsBase64 };
}

// 5. shein (1 large image)
async function prepareShein(page) {
const captchaImage = await page.$('img.captcha');

const captchaBase64 = await elementToBase64(captchaImage);

return { captchaBase64 };
}

// Playwright example
async function run() {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com'); // Replace with the actual URL

// Example of getting base64 for oocl_rotate_new
const { backgroundBase64, circleBase64 } = await prepareOoclRotateNew(page);
console.log('Base64 background:', backgroundBase64);
console.log('Base64 circle:', circleBase64);

await browser.close();
}

run();
Example of Searching for oocl Parameters in Node.js
import { chromium } from "playwright";

// Proxy (optional)
// const proxyHost = "";
// const proxyUsername = "";
// const proxyPassword = "";

async function getBase64FromSrc(elementHandle) {
const src = await elementHandle.getAttribute("src");
if (src && src.startsWith("data:image")) {
return src.split(",")[1];
}
return null;
}

async function elementToBase64(elementHandle) {
const base64 = await getBase64FromSrc(elementHandle);
if (base64) {
return base64;
}
const buffer = await elementHandle.screenshot();
return buffer.toString("base64");
}

async function extractVerifyImagesBase64(page) {
const imgSelectors = [".verify-img-panel img", ".verify-sub-block img"];

const imageHandles = (
await Promise.all(imgSelectors.map((selector) => page.$$(selector)))
).flat();

if (imageHandles.length === 0) {
throw new Error(
"No images found in verify-img-panel or verify-sub-block."
);
}

const imagesBase64 = [];
for (const handle of imageHandles) {
const base64 = await elementToBase64(handle);
imagesBase64.push({
src: await handle.getAttribute("src"),
base64,
});
}

return imagesBase64;
}

async function run() {
const browser = await chromium.launch({
headless: false,
// proxy: {
// server: `http://${proxyHost}`,
// username: proxyUsername,
// password: proxyPassword,
// },
});

const page = await browser.newPage();
await page.goto(
"https://example.com/registration/form?appurl=https://example.com"
);

try {
const images = await extractVerifyImagesBase64(page);
for (const { src, base64 } of images) {
console.log("Source:", src);
console.log("Base64:", base64);
}
} catch (err) {
console.error(err.message);
}

await browser.close();
}

run();

Use the SDK library

Show code (for browser)
// https://github.com/ZennoLab/capmonstercloud-client-js

import { CapMonsterCloudClientFactory, ClientOptions, ComplexImageTaskRecognitionRequest } from '@zennolab_com/capmonstercloud-client';

document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: 'YOUR_API_KEY' }) // Specify your CapMonster Cloud API key
);

// Optionally, you can check the balance
const balance = await cmcClient.getBalance();
console.log("Balance:", balance);

const citRecognitionRequest = new ComplexImageTaskRecognitionRequest({
imagesBase64: ['/9xwee/'], // Image in base64 format
metaData: { Task: 'oocl_rotate' }
});

const result = await cmcClient.Solve(citRecognitionRequest);
console.log("Solution:", result);
});
Show code (Node.js)
// https://github.com/ZennoLab/capmonstercloud-client-js

import { CapMonsterCloudClientFactory, ClientOptions, ComplexImageTaskRecognitionRequest } from '@zennolab_com/capmonstercloud-client';

const API_KEY = "YOUR_API_KEY"; // Specify your CapMonster Cloud API key

async function solveComplexImageTask() {
const cmcClient = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);

// Optionally, you can check the balance
const balance = await cmcClient.getBalance();
console.log("Balance:", balance);

const citRecognitionRequest = new ComplexImageTaskRecognitionRequest({
imagesBase64: ['/9xwee/'], // Image in base64 format
metaData: { Task: 'oocl_rotate' }
});

const result = await cmcClient.Solve(citRecognitionRequest);
console.log("Solution:", result);
}

solveComplexImageTask().catch(console.error);