Cloudflare Turnstile solver · C#
Solve Cloudflare Turnstile in C#
In .NET, HttpClient and System.Text.Json cover it: create a Turnstile task, poll getTaskResult for the token, and surface the API's error code when a task fails. No NuGet package is needed.
No SDK needed: plain JSON over HTTPS
The steps in C#
Get an API key
Sign up with an email and a password, create your key in the dashboard and add funds in crypto, from $10.
Create a task
Send createTask with the page's URL, its Turnstile site key, and the widget's action and cData when it sets them. The price is held on your balance and a taskId comes back at once.
Poll for the token
Ask getTaskResult every two seconds until the status is ready, and stop after a deadline of your own, such as three minutes.
Use the token within 300 seconds
Send the token where the page sends it, usually the cf-turnstile-response form field. It works once, and expires 300 seconds after it was issued.
New to the API? The quickstart walks through sign-up, the key and the first task.
Good to know
The sample is a .NET 8 console program with top-level statements; nothing beyond the base library.
Reuse one HttpClient for all tasks, as .NET recommends.
Check errorId on every reply: the compatible format answers HTTP 200 with errorId 1 when a call fails.
Read next
- APIcreateTask and getTaskResult: The Captcha API Format ExplainedHow the createTask, getTaskResult and getBalance format works: request bodies, replies, errorId, polling, and ZeroCaptcha's Cloudflare Turnstile tasks.
- SecuritySecure Captcha API Keys: IP Allowlists, Rotation, Spend CapsProtect a captcha API key and your balance: scopes, IP allowlists, daily spend caps, rotation with an overlap, instant revocation, and spotting a leaked key.
- APICaptcha API Error Codes: What Each Means and What It CostsERROR_CAPTCHA_UNSOLVABLE, ERROR_ZERO_BALANCE, ERROR_KEY_DOES_NOT_EXIST and the rest: what each captcha API error means, whether to retry, and what it costs.
C# questions
Is there a .NET SDK?
No. The API is plain JSON over HTTPS, so HttpClient and System.Text.Json are enough, as the sample shows.
How long does a Cloudflare Turnstile token last?
A Cloudflare Turnstile token works once and expires 300 seconds after it is issued, so solve right before you submit. Every result tells you when its token expires.
What does a failed task cost?
Nothing. The price is held when you create a task and released at once if it fails or expires, and a refused task holds nothing; you pay only when a token is ready.