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

ComplexImageTask Recaptcha

reCAPTCHA 2 (3x3)
$0.2 / 1000 images
99%
reCAPTCHA 2 (3x3)
$0.04 / 1000 dynamic images
99%
reCAPTCHA 2 (4x4)
$0.1 / 1000 images
99%

The object contains data about the task for solving ReCaptcha2 from Google.

Request parameters

type<string>required

ComplexImageTask


class<string>required

recaptcha


imageUrls<array>required (if imagesBase64 is not filled)

Single image 4x4, 3x3 or a new 1x1 captcha part (in an array). Example: [“https://i.postimg.cc/yYjg75Kv/img1.jpg”]\


imagesBase64<array>required (if imageUrls is not filled)

Single image 4x4, 3x3 or a new 1x1 captcha part in base64 format (in an array). Example: [ “/9j/4AAQSkZJRgABAQEAAAAAAAD…”]


metadata.Grid<string>required

Image grid size. Possible values: 4x4, 3x3, 1x1


metadata.TaskDefinition<string>required (if metadata.Task is not filled)

Technical value that defines the task type

How to get TaskDefinition

The data can be found in responses to /recaptcha/{recaptchaApi}/reload or /recaptcha/{recaptchaApi}/userverify requests, where recaptchaApi is "enterprise" or "api2" depending on the Recaptcha type. The response contains json, in which one can take a list of TaskDefinitions for loaded captchas.


metadata.Task<string>required (if metadata.TaskDefinition is not filled)

Possible values: Click on traffic lights and others
Task name (in English).


userAgent<string>optional

The browser User-Agent to use when loading images if links were passed in imageUrls. It is required to use a modern browser signature, otherwise Google will return an error asking for a browser update.


websiteURL<string>optional

URL of the page where the captcha is solved.

Description of parameters

imageUrls: links to images.

imagesBase64: images in Base64 format.

metadata.Grid: additional metadata related to image grid sizes.

metadata.TaskDefinition: task description identifier/type, e.g.: /m/015qff means "Click on traffic lights".

metadata.Task: additional metadata related to the task.

userAgent: information about the user agent. Current userAgent: userAgentPlaceholder

websiteURL: address of the web page with the captcha.

Create task method

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

Request

{
"clientKey":"API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recaptcha",
"imageUrls":[ "https://i.postimg.cc/yYjg75Kv/payloadtraffic.jpg" ],
"metadata": {
"Task": "Click on traffic lights",
"Grid": "3x3",
"TaskDefinition": "/m/015qff"
},
"userAgent": "userAgentPlaceholder",
"websiteUrl": "https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=middle"
}
}

Response

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

Get task result method

Use the getTaskResult method to get the captcha solution. Depending on the system load, you will receive a response after a time ranging from 300ms to 6s.

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

Request

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

Response

{
"errorId":0,
"status":"ready",
"solution": {
"answer": [ false, false, false, false, true, false, false, false, false ]
}
}

PropertyTypeDescription
answerArrayList with boolean values, "true" means that you need to click on the image corresponding to this position.

Use SDK Library

// https://github.com/ZennoLab/capmonstercloud-client-js

import { CapMonsterCloudClientFactory, ClientOptions, ComplexImageRecaptchaRequest } 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 complexImageRecaptchaRequest = new ComplexImageRecaptchaRequest({
imageUrls: ['https://i.postimg.cc/yYjg75Kv/payloadtraffic.jpg'],
metaData: {
Grid: '3x3',
Task: 'Please click each image containing a mountain',
TaskDefinition: '/m/015qff',
},
websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=middle',
});

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