TurnstileTask#


Proxy-based solving method for bypassing Cloudflare 403 protection pages.
Returns a cf_clearance cookie and matching user-agent string that can be used to access Cloudflare-protected pages that return 403 Forbidden errors.
Price: $1.0/K

TurnstileTask Task object structure#

nametypeRequiredDescription
typeStringYesTurnstileTask
websiteURLStringYesThe full URL of the Cloudflare 403 protection page
htmlPageBase64StringNoBase64-encoded full HTML content of the 403 page. Optional - if not provided, the system will automatically fetch the page via your proxy (Auto Fetch Mode).
proxyTypeStringYesProxy type:`http`, `socks4`, `socks5`
proxyAddressStringYesProxy server IP address or hostname
proxyPortIntegerYesproxy port
proxyLoginStringNoProxy login name
proxyPasswordStringNoProxy login password

Mode 1: Auto Fetch#

When htmlPageBase64 is not provided, the system automatically fetches the 403 page through your proxy. Use this mode when the target website always returns a 403 page regardless of the visitor's IP address.

Mode 2: Manual HTML Submission#

When htmlPageBase64 is provided, you capture the 403 page HTML content, encode it to base64, and send it in the request. Use this mode when the target website only shows a 403 page for certain IP addresses.

Request example#

API endpoint: https://api.nextcaptcha.com/createTask

method: POST

Content type: application/json

Mode 1: Auto Fetch#

{
    "clientKey":"api key",
    "task": {
        "type":"TurnstileTask",
        "websiteURL":"https://example.com",
        "proxyType":"http",
        "proxyAddress":"your_proxy_address",
        "proxyPort":1234,
        "proxyLogin":"your_proxy_login",
        "proxyPassword":"your_proxy_password"
    }
}

Mode 2: Manual HTML Submission#

{
    "clientKey":"api key",
    "task": {
        "type":"TurnstileTask",
        "websiteURL":"https://example.com",
        "htmlPageBase64":"PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+...",
        "proxyType":"http",
        "proxyAddress":"your_proxy_address",
        "proxyPort":1234,
        "proxyLogin":"your_proxy_login",
        "proxyPassword":"your_proxy_password"
    }
}

Response example#

{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "cf_clearance": "abc123def456...",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"
  },
  "createTime": 1701234567890,
  "endTime": 1701234567890
}

Important: The cf_clearance cookie is bound to three factors that must ALL match when you use the cookie to access the target website:

  • TLS Fingerprint: You must use a TLS fingerprint of Windows Chrome version 136 or newer.
  • IP Address: You must use the same proxy IP address that was used during solving.
  • User-Agent: You must use the exact user-agent string returned in the solution response.
If any of these three factors (TLS fingerprint, IP address, User-Agent) do not match, the target website will still return a 403 Forbidden error.

Sample Code#

import requests
import time
 
CLIENT_KEY = "YOUR_CLIENT_KEY"
WEBSITE_URL = "https://example.com"
PROXY_TYPE = "http"
PROXY_ADDRESS = "your_proxy_address"
PROXY_PORT = 1234
PROXY_LOGIN = "your_proxy_login"
PROXY_PASSWORD = "your_proxy_password"
 
# Step 1: Create task
# Auto Fetch Mode (without htmlPageBase64)
# For sites that always return 403 regardless of IP
task_data = {
    "clientKey": CLIENT_KEY,
    "task": {
        "type": "TurnstileTask",
        "websiteURL": WEBSITE_URL,
        "proxyType": PROXY_TYPE,
        "proxyAddress": PROXY_ADDRESS,
        "proxyPort": PROXY_PORT,
        "proxyLogin": PROXY_LOGIN,
        "proxyPassword": PROXY_PASSWORD
    }
}
 
# Manual Mode: add htmlPageBase64 to the task
# For sites that only return 403 for certain IPs
# task_data["task"]["htmlPageBase64"] = "PCFET0NUWVBFIGh0bWw+..."
 
response = requests.post(
    "https://api.nextcaptcha.com/createTask",
    json=task_data
)
result = response.json()
task_id = result["taskId"]
 
# Step 2: Poll for result
while True:
    time.sleep(3)
    response = requests.post(
        "https://api.nextcaptcha.com/getTaskResult",
        json={
            "clientKey": CLIENT_KEY,
            "taskId": task_id
        }
    )
    result = response.json()
    if result["status"] == "ready":
        cf_clearance = result["solution"]["cf_clearance"]
        user_agent = result["solution"]["userAagent"]
        print(f"cf_clearance: {cf_clearance}")
        print(f"userAagent: {userAgent}")
        break
    elif result["status"] == "failed":
        print(f"Task failed: {result.get('errorDescription')}")
        break
 
# Step 3: Use the cookie with matching TLS, IP, and User-Agent
# IMPORTANT: TLS fingerprint must be Chrome 136+
# IMPORTANT: Must use the same proxy IP and returned user-agent
session = requests.Session()
session.cookies.set("cf_clearance", cf_clearance, domain=".example.com")
session.headers.update({"User-Agent": user_agent})
session.proxies = {
    "https": f"http://{PROXY_LOGIN}:{PROXY_PASSWORD}@{PROXY_ADDRESS}:{PROXY_PORT}"
}
response = session.get(WEBSITE_URL)
print(f"Status: {response.status_code}")

Related Links#