Skip to content

Start a solve

POST
/solves
curl --request POST \
--url https://cf.antibotapi.com/solves \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "url": "https://www.example.com/", "html": "<!DOCTYPE html><html lang=\"en-US\"><head><title>Just a moment...</title>...", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36" }'

Send the address you asked for, the page Cloudflare answered with (the 403 challenge page, or a site’s page holding a Turnstile widget), and your client’s User-Agent. Returns the solve’s id and the first request to send.

x-signature
string

Required when request signing is on for your key. See Authentication.

Media typeapplication/json
object
url
required

The address you asked for, as you asked for it (query and fragment included).

string format: uri
html
required

The page’s body as it came.

string
user_agent
required

The User-Agent your client sends, exactly. You must ensure that you are keeping the user-agent consistent and using a matching TLS profile. Any mismatching user-agent or TLS will cause blocks

string

Example

{
"url": "https://www.example.com/",
"html": "<!DOCTYPE html><html lang=\"en-US\"><head><title>Just a moment...</title>...",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
}

The solve’s id and the first request to send.

Media typeapplication/json
object
id
required
string format: uuid
request
required

A request to send exactly as given.

object
method
required
string
Allowed values: GET POST
url
required
string format: uri
headers
required

Every header, as [name, value], in the order to send them. Send them as they stand and add none. Fill the cookie one, left empty, from your cookie jar for the address (leave it out if you have none for it). Your HTTP library may set content-length itself; it is given so you can keep its place.

Array<Array<string>>
body

The body to send, for a POST.

string
wait_ms
required

Hold the request this many ms before sending it. Cloudflare refuses an answer that arrives sooner than the work it claims could have taken.

integer
timeout_ms
required

Give up after this many ms (0 for no limit) and hand back status 0.

integer

Example

{
"id": "6f1c2a8e-4b1e-4a37-9c0e-2b9f0f6f3a11",
"request": {
"method": "GET",
"url": "https://www.example.com/cdn-cgi/challenge-platform/h/b/orchestrate/chl_page/v1?ray=a4e9cb6aae35e6ac",
"headers": [
[
"sec-ch-ua-full-version-list",
"\"Google Chrome\";v=\"155.0.8059.85\", \"Chromium\";v=\"155.0.8059.85\", \"Not(A:Brand\";v=\"24.0.0.0\""
],
[
"sec-ch-ua-platform",
"\"Windows\""
],
[
"sec-ch-ua",
"\"Google Chrome\";v=\"155\", \"Chromium\";v=\"155\", \"Not(A:Brand\";v=\"24\""
],
[
"user-agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
],
[
"accept",
"*/*"
],
[
"sec-fetch-site",
"same-origin"
],
[
"sec-fetch-mode",
"no-cors"
],
[
"sec-fetch-dest",
"script"
],
[
"referer",
"https://www.example.com/?__cf_chl_rt_tk=..."
],
[
"accept-encoding",
"gzip, deflate, br, zstd"
],
[
"accept-language",
"en-GB,en-US;q=0.9,en;q=0.8"
],
[
"cookie",
""
]
],
"wait_ms": 0,
"timeout_ms": 0
}
}

The body is not the JSON this endpoint takes, or no browser we solve as sends your user_agent (the body then lists the ones we do under user_agents).

Media typeapplication/json
object
error
required
string
user_agents

The User-Agents we solve as, when yours is not one of them.

Array<string>

Example generated

{
"error": "example",
"user_agents": [
"example"
]
}

No key, an unknown key, a key out of balance, or a key not on the beta.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}

We could not take the next step: a response that was not what it should be (a 403 where a 200 was due), or a page or script we cannot read. The solve ends; start a new one.

Media typeapplication/json
object
error
required
string

Example

{
"error": "Expected the PageScript request to answer 200, it answered 403"
}

Too many solves in progress. Retry shortly.

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}