Start a solve
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://cf.antibotapi.com/solves"), Headers = { { "x-api-key", "<x-api-key>" }, }, Content = new StringContent("{ \"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\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://cf.antibotapi.com/solves"
payload := strings.NewReader("{ \"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\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://cf.antibotapi.com/solves';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Required when request signing is on for your key. See Authentication.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The address you asked for, as you asked for it (query and fragment included).
The page’s body as it came.
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
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"}Responses
Section titled “Responses”The solve’s id and the first request to send.
object
A request to send exactly as given.
object
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.
The body to send, for a POST.
Hold the request this many ms before sending it. Cloudflare refuses an answer that arrives sooner than the work it claims could have taken.
Give up after this many ms (0 for no limit) and hand back status 0.
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).
object
The User-Agents we solve as, when yours is not one of them.
Example generated
{ "error": "example", "user_agents": [ "example" ]}No key, an unknown key, a key out of balance, or a key not on the beta.
object
object
What went wrong.
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.
object
Example
{ "error": "Expected the PageScript request to answer 200, it answered 403"}Too many solves in progress. Retry shortly.
object
Example generated
{ "error": "example"}