Use task type waf when your application will perform the request after the
challenge has been solved.
Request data
| Field | Type | Required | Description |
|---|---|---|---|
url |
string | Yes | URL that returned the Cloudflare challenge |
proxy |
string | Yes | Sticky proxy used for the original and follow-up requests |
bulk_proxy |
string | No | Cheap proxy for most of the solve’s traffic. See Save bandwidth |
user_agent |
string | No | User-Agent from the challenged client |
html |
string | No | Challenge response HTML |
When omitted, user_agent defaults to:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36Almost all User-Agents are supported, including Safari, Chrome, and Firefox on Windows, macOS, Linux, Android, and iOS.
{
"url": "https://example.com/protected",
"proxy": "http://user:[email protected]:8080",
"bulk_proxy": "http://user:[email protected]:3128",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...",
"html": "<html>...</html>"
}Save bandwidth with bulk_proxy
Most of a solve’s traffic doesn’t need to go through your main proxy. Set
bulk_proxy to a cheap datacenter or ISP proxy with unlimited bandwidth,
and that traffic goes through it instead:
- About 90% of the bandwidth goes through
bulk_proxy, so your main proxy uses about 10× less and costs less. - Can make solves faster, if your
bulk_proxyis fast.
proxy is still required: the clearance is tied to it, and your follow-up
requests must keep using it. Leave bulk_proxy out and everything goes through
proxy, as before.
Solution
| Field | Type | Description |
|---|---|---|
clearance |
string | Value for the cf_clearance cookie |
cf_bm |
string or null | Optional value for the __cf_bm cookie |
cf_rt |
string or null | Optional first-request __cf_chl_tk query value |
headers |
object | Browser headers used during the solve |
attributes |
object | Form fields for the first follow-up POST |
{
"clearance": "abc123...",
"cf_bm": "xyz789...",
"cf_rt": "token123...",
"headers": {
"user-agent": "Mozilla/5.0 ...",
"sec-ch-ua": "\"Chromium\";v=\"143\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\""
},
"attributes": {
"a": "value1",
"b": "value2"
}
}Apply the solution
Reuse the same proxy
Make the follow-up request through the exact proxy used for the solve.
Set the cookies and headers
Set cf_clearance and, when present, __cf_bm. Reuse the returned headers
exactly, especially user-agent and Client Hints.
Build the first request
Make a POST request to the original challenged URL. Set Referer to that
same URL; when cf_rt is present, add it to the Referer query string as
__cf_chl_tk while preserving any existing query parameters. Send
attributes as the form body using
application/x-www-form-urlencoded. Python wreq performs the encoding
when you pass form=solution.get("attributes", {}).