How to solve Cloudflare Challenge

Lucas Mitchell
Automation Engineer
11-May-2023

Challenges Supported by Capsolver
-
Challenge + Turnstile

-
Challenge

If it's challenge + captcha, you don't need to put any special parameter in the createTask, as we will recognize that require to solve the captcha.
How to solve Cloudflare Challenge (5s IUAM)
Before we start solving Cloudflare, there are some requeriments and points that we need to be aware that they are needed to know
Requeriments:
- Capsolver Key
- Proxy
Points to be aware that if we don't follow, solution will be invalid:
Tokenreturned in the response of the method getTaskResult is the value of the cookiecf_clearancethat you will need to create.- Must use the same user-agent that the method getTaskResult return
- Must use the same proxy IP used for solve the challenge
- Must use the cookies of the response
- Must use the headers of the response
- Use TLS chrome 120 version
To solve cloudflare challenge, follow our documentation. Some parameters are required and some are optional.
For this example, we will only use the required parameters. The task types for cloudflare are:
AntiCloudflareTask: This task type requires your own proxies.
We will use AntiCloudflareTask as the site uses Cloudflare Challenge 5s.
If any parameters are missing or you don't submit correctly, you will likely encounter issues with the token not being accepted by the website. You can find all the parameters in this picture:

Step 1: Submitting the information to capsolver
Use the method createTask to submit the information required:
JSON
POST https://api.capsolver.com/createTask
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiCloudflareTask",
"websiteURL": "https://www.yourwebsite.com",
"proxy": "158.120.100.23:334:user:pass"
}
}
Step 2: Getting the results
To verify the results, you'll need to continuously poll the getTaskResult API endpoint until the captcha is resolved.
Here's an example request:
json
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey":"YOUR_API_KEY",
"taskId": "TASKID_OF_CREATETASK" //ID created by the createTask method
}
Once the captcha is successfully resolved, you'll receive a response similar to the one depicted in the following image:
markdown
{
"errorId": 0,
"taskId": "d8d3a8b4-30cc-4b09-802a-a476ca17fa54",
"status": "ready",
"solution": {
"accept-language": "en-US,en;q=0.9",
"cookies": {
},
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.9",
"cache-control": "max-age=0",
"content-type": "application/x-www-form-urlencoded",
"origin": "",
"referer": "",
"sec-ch-ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"",
"sec-ch-ua-arch": "\"arm\"",
"sec-ch-ua-bitness": "\"64\"",
"sec-ch-ua-full-version": "\"120.0.6099.71\"",
"sec-ch-ua-full-version-list": "\"Not_A Brand\";v=\"8.0.0.0\", \"Chromium\";v=\"120.0.6099.71\", \"Google Chrome\";v=\"120.0.6099.71\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-model": "\"\"",
"sec-ch-ua-platform": "\"macOS\"",
"sec-ch-ua-platform-version": "\"10.14.6\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "same-origin",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
},
"proxy": "your proxy",
"token": "cf clearance token",
"type": "challenge",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
}
}
The captcha token received can be verified by submitting the cookie cf_clearance with the value of the response token, use the same proxy IP used for solve the challenge, cookies, TLS chrome 120, headers and also the same user-agent that we return you in the response to the relevant site.
⚠️ If the token is rejected, it may indicate that some information is missing or incorrect. Make sure that you are submitting the token value correctly to the cookie cf_clearance, that you are using the same proxy IP used for solve the challenge, TLS chrome 120, headers of the response and also the same user-agent that it's returned to you in the response.
If you want to solve Cloudflare Turnstile Captcha. Please refer to this blog: link
In conclusion, while solving cloudflare challenge may seem a daunting task, capsolver.com makes the process swift and efficient. By following the steps outlined above, you can easily resolve cloudflare.
Capsolver Team 💜
Compliance Disclaimer: The information provided on this blog is for informational purposes only. CapSolver is committed to compliance with all applicable laws and regulations. The use of the CapSolver network for illegal, fraudulent, or abusive activities is strictly prohibited and will be investigated. Our captcha-solving solutions enhance user experience while ensuring 100% compliance in helping solve captcha difficulties during public data crawling. We encourage responsible use of our services. For more information, please visit our Terms of Service and Privacy Policy.
More

How to Automate Cloudflare Challenge Solving in Selenium
Master the definitive strategy for Cloudflare Challenge Solving in Selenium. Use Undetected-Chromedriver, behavioral mimicry, and CapSolver's API for reliable web automation

Ethan Collins
03-Dec-2025

How to Solve Cloudflare Challenge with Node.js
A look at why Cloudflare blocks Node.js scrapers and how developers reliably get cf_clearance for data workflows.

Ethan Collins
03-Dec-2025

Top Cloudflare Challenge Solvers in 2026: Performance Rankings
Discover the Top Cloudflare Challenge Solvers in 2026. We compare CapSolver's superior speed and 99%+ success rate against 5 smaller competitors. Learn why CapSolver is the best choice for web automation.

Aloísio Vítor
11-Nov-2025

How to Solve Cloudflare Captcha with Python & Selenium
Struggling with Cloudflare Captcha? Learn how to tackle it using Python and Selenium! This guide breaks down what Cloudflare Captcha is and offers effective solutions for web scraping in 2024.

Rajinder Singh
10-Nov-2025

How to Solve Cloudflare in 2026: The 6 Best Methods for Uninterrupted Automation
Discover the 6 best methods to solve the Cloudflare Challenge 5s in 2026 for web scraping and automation. Includes detailed strategies, code examples, and a deep dive into the AI-powered CapSolver solution

Ethan Collins
29-Oct-2025

How to Solve the Cloudflare 5s Challenge: A Technical Guide for Web Scraping
Learn how to solve the Cloudflare 5-second challenge using advanced CAPTCHA solver APIs. A step-by-step guide for developers on overcoming Cloudflare JavaScript and Managed Challenges with CapSolver for stable web scraping automation.

Anh Tuan
28-Oct-2025

