Solve Cloudflare

Logo of Capsolver

CapSolver Blogger

How to use capsolver

21-May-2023

Resolving the Cloudflare Challenge

Cloudflare Challenges Addressed by Capsolver

  • Combined Challenge and Turnstile

  • Standalone Challenge

No special parameters are needed for combined challenge and captcha scenarios with createTask—our system will automatically detect and handle the captcha.

Addressing the Cloudflare 5s Challenge

Before tackling the Cloudflare 5s challenge, ensure you meet the following prerequisites and adhere to the critical guidelines:

Prerequisites:

  • Capsolver Key
  • Proxy

Critical Guidelines for Valid Resolution:

  • The Token from the getTaskResult method is crucial for the cf_clearance cookie.
  • You must use the same user-agent returned by getTaskResult.
  • You must use the same proxy IP that was used to resolve the challenge.
  • You must include the cookies from the response.
  • You must include the headers from the response.
  • Use TLS version Chrome 120.

To successfully navigate the Cloudflare challenge, consult our detailed guide. Certain parameters are mandatory while others are optional.
For this instance, only essential parameters are used. The required task type is:

  • AntiCloudflareTask: This task requires your own proxies.

We will utilize the AntiCloudflareTask for a website under the Cloudflare 5s challenge. Failure to correctly input all parameters may result in the rejection of the token by the website. Detailed parameter guidelines can be found in the image below:

Parameter Structure for Resolving the Cloudflare 5s Challenge (cf_clearance)

Step 1: Initiating the Process with Capsolver

Execute the createTask command to submit the necessary information:

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: Obtaining the Results

Continuously poll the getTaskResult API until the captcha is resolved.

Sample request:

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 details similar to those shown below:

{
    "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.

⚠️ Token rejection indicates possible missing or incorrect information. Verify the token is correctly entered into the cf_clearance cookie, that the same proxy IP and TLS version Chrome 120 are used, along with the response headers and user-agent.

For resolving Cloudflare Turnstile Captcha, consult this resource: link

To conclude, overcoming the Cloudflare challenge might seem complex, but with Capsolver.com the process is efficient and straightforward. By adhering to the outlined steps, resolving Cloudflare becomes manageable.

Capsolver Team 💜

More

Cloudflare 403 forbidden
How to Solve Cloudflare 403 Forbidden Error and 522/1020/1010/1015/1012

Cloudflare is a widely-used content delivery network (CDN) and security service that helps websites mitigate various threats, including DDoS attacks and abusive bots...

Cloudflare

15-May-2024

Cloudflare Turnstile and Challenge
How to Solve Cloudflare Turnstile and Challenge in 2024

Approximately 20% of the websites that require scraping employ Cloudflare, a robust anti-bot protection system that can easily block your access...

Cloudflare

15-May-2024

How to solve Cloudflare Turnstile Captcha with Python
How to solve Cloudflare Turnstile Captcha with Python

In this article, we will show you how to solve cloudflare turnstile captcha with Python.

Cloudflare

13-May-2024

How to solve Cloudflare Turnstile Captcha with NodeJS
How to solve Cloudflare Turnstile Captcha with NodeJS

In this article, we will show you how to solve cloudflare turnstile captcha with NodeJS.

Cloudflare

13-May-2024

How to Solve Cloudflare when Web Scraping in 2024 | Step by Step Guide
How to Solve Cloudflare when Web Scraping in 2024 | Step by Step Guide

This blog post delves into effective techniques for solve these defenses with the help of CapSolver, a tool adept at resolving CAPTCHAs. From explaining Cloudflare's security protocols to providing practical strategies and code samples for circumventing these restrictions.

Cloudflare

07-May-2024

How to Solve Cloudflare in 2024: Solve Cloudflare Turnstile and Challenge By Using CapSolver
How to Solve Cloudflare in 2024: Solve Cloudflare Turnstile and Challenge By Using CapSolver

navigating Cloudflare's sophisticated security barriers like the Turnstile and Challenge CAPTCHA remains a critical task for many users. This blog post explores effective methods to bypass these protections using CapSolver, a tool designed for solving CAPTCHAs efficiently. Covering everything from understanding Cloudflare's security measures to practical strategies and code examples for overcoming the barriers, this guide is essential for anyone looking to access Cloudflare-protected sites without interruptions.

Cloudflare

07-May-2024