Full working example for solving Cloudflare Turnstile using the CaptchaAI API.
Languages: Python, Node.js, PHP, Go, Java, C#, Ruby, Rust, Kotlin, Bash
This example accompanies the blog article: Solving Cloudflare Turnstile with Python Requests and CaptchaAI
- A CaptchaAI account with API key (get one here)
- A target page with Cloudflare Turnstile for testing
-
Clone the repository:
git clone https://github.com/CaptchaAI/CaptchaAI-Examples.git cd CaptchaAI-Examples/articles/solving-cloudflare-turnstile-python-requests -
Copy and edit the environment file:
cp .env.example .env
-
Run any language example:
cd python && pip install -r requirements.txt && python solve.pycd node && npm install && node solve.jscd php && composer install && php solve.phpcd go && go run solve.gocd java && javac Solve.java && java Solvecd csharp && dotnet runcd ruby && ruby solve.rbcd rust && cargo runcd kotlin && kotlinc solve.kt -include-runtime -d solve.jar && java -jar solve.jarcd bash && chmod +x solve.sh && ./solve.sh- Submit — Sends the CAPTCHA parameters to
https://ocr.captchaai.com/in.phpusing methodturnstile - Poll — Checks
https://ocr.captchaai.com/res.phpevery 5 seconds for the result - Result — Returns the solved token/answer ready for use
Browse more examples in the CaptchaAI-Examples repository.