Before delving into the solution, it's essential to acquaint yourself with the appearance of the DataDome Interstitial. Here's a visual representation:
Before attempting to tackle the DataDome Interstitial, there are specific requirements and critical considerations to take into account:
- A Capsolver Key
- A Proxy, with MetaProxies being a recommended choice (https://metaproxies.net/)
- Dynamic Query Parameters: It's imperative that the captcha URL query parameters are dynamic; static URLs won't work.
- Specific Query Parameters: The 't' parameter in the URL must be either 'it' (for the Interstitial page) or 'fe' (for the captcha). If it's 'bv', it signifies a ban.
- Matching TLS: Ensure that the TLS version matches the Chrome version used, along with the header and its order.
- Consistent Proxy Usage: Use the same proxy for both solving the captcha and interacting with the webpage.
Understanding these key points is pivotal for a successful resolution of the DataDome Interstitial using Capsolver.
To get started, familiarize yourself with the Capsolver documentation: Capsolver Documentation.
For this process, we will employ the createTask
method, which is elaborated in the image below:
Our focus will be on the required parameters, utilizing the DatadomeSliderTask as an example.
Commence the process by utilizing the createTask
method to submit your information:
POST https://api.capsolver.com/createTask
{
"clientKey": "Your_API_KEY",
"task": {
"type": "DatadomeSliderTask",
"websiteURL": "https://antoinevastel.com/bots/datadome",
"captchaUrl": "https://geo.captcha-delivery.com/captcha/?initialCid=yourInitialCid&cid=yourCid&t=it&referer=https%3A%2F%2Fantoinevastel.com%2Fbots%2Fdatadome&s=YourSParam&e=youreParam",
"proxy": "yourproxy",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
}
}
Subsequently, continuously monitor the getTaskResult
API endpoint until the captcha is successfully solved:
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey":"YOUR_API_KEY",
"taskId": "TASKID_OF_CREATETASK"
}
Upon successful resolution, you will receive a response resembling the following:
To verify the captcha token, submit the datadome
cookie with the response value to the site. If the token is rejected, double-check for any missing or incorrect information, ensuring that TLS, headers, and proxy usage are accurate.