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

DataDome

DataDome
$2.2 / 1000 tokens
99%

This type of captcha basically requires the user to solve a puzzle by moving a slider to confirm.

Attention!

This task will be performed using our proxy servers. Use the received cookies in your project to automatically pass the captcha.

Request parameters

type<string>required

CustomTask


class<string>required

DataDome


websiteURL<string>required

The address of the main page where the captcha is solved.


metadata.htmlPageBase64<string>required (if metadata.captchaUrl is not filled)

Object that contains additional data about the captcha: "htmlPageBase64": "..." - a base64 encoded html page that comes with a 403 code and a Set-Cookie: datadome="..." header in response to a get request to the target site.


metadata.captchaUrl<string>required (if metadata.htmlPageBase64 is not filled)

"captchaUrl" - link to the captcha. Usually it looks like this: "https://geo.captcha-delivery.com/captcha/?initialCid=...".


metadata.datadomeCookie<string>required

Your cookies from datadome. You can get it on the page using "document.cookie" or in the Set-Cookie request header: "datadome=..." (see example request /createTask)


userAgent<string>optional

Browser User-Agent.
Pass only the actual UA. Now this is: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5.1 Mobile/21F90 Safari/604.1

Create task method

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

Request

{
"clientKey": "API_KEY",
"task": {
"type": "CustomTask",
"class": "DataDome",
"websiteURL": "https://www.leboncoin.fr/",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5.1 Mobile/21F90 Safari/604.1",
"metadata": {
"htmlPageBase64": "PGh0bWw+PGhlYWQ+PHRpdGxlPmJs...PC9odG1sPg==",
"datadomeCookie": "datadome=VYUWrgJ9ap4zmXq8Mgbp...64emvUPeON45z"
}
}
}

Response

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

Get task result method

Use the getTaskResult method to get the DataDome solution.

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

Request

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

Response

{
"errorId":0,
"status":"ready",
"solution": {
"domains": {
"site.com": {
"cookies": {
"datadome": "t355hfeuUFbsWpoMzXyIWL_ewfwgre25345323rwgregeFEkG5iju9esKVfWMzuLAjcfCIJUIHU7332At1l~HY78g782hidwfeO4K2ZP_CFHYUFEgygfiYGfGYEUfgyefWrXG6_3sy; Max-Age=31536000; Domain=.site.com; Path=/; Secure; SameSite=Lax"
}
}
}
}
}

Use SDK Library

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

import { CapMonsterCloudClientFactory, ClientOptions, DataDomeRequest } 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 dataDomeRequest = new DataDomeRequest({
websiteURL: 'site.com',
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5.1 Mobile/21F90 Safari/604.1',
metadata: {
captchaUrl: 'https://geo.captcha-delivery.com/captcha/?initialCid=12434324',
datadomeCookie: '',
},
});

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