Full working example for solving BLS CAPTCHA using the CaptchaAI API.
Languages: Python, Node.js, PHP, Go, Java, C#, Ruby, Rust, Kotlin, Bash
This example accompanies the blog article: How to Solve BLS CAPTCHA Step by Step
- A CaptchaAI account with API key (get one here)
- A CAPTCHA image file for testing (PNG, JPG, etc.)
- One or more of: Python 3.8+, Node.js 16+, PHP 8.0+, Go 1.21+, Java 11+, .NET 8+, Ruby 3.0+, Rust 1.70+, Kotlin 1.9+, or Bash with curl and jq
| Parameter | Required | Description |
|---|---|---|
method |
Yes | Must be bls |
body |
Yes | Base64-encoded CAPTCHA image data |
textinstructions |
Yes | Text instructions describing what to select (e.g. "Select all images with a car") |
The API returns the selected cell indices in the request field (e.g. "1,3,5").
-
Clone the repository:
git clone https://github.com/CaptchaAI/CaptchaAI-Examples.git cd CaptchaAI-Examples/articles/how-to-solve-bls-captcha-step-by-step -
Copy the environment file and add your credentials:
cp .env.example .env
-
Edit
.envwith your API key, image file path, and instructions. -
Follow the language-specific setup below.
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
bash solve.sh- The script loads the CAPTCHA image from the file specified in
CAPTCHA_IMAGE_FILE. - The image is base64-encoded and sent via POST to
in.phpwithmethod=blsandtextinstructions. - The API returns a task ID.
- The script polls
res.phpuntil the solution is ready. - The answer contains the selected cell indices (e.g.
"1,3,5").
- The image file must exist and be readable.
- Submission uses POST (not GET) because the base64-encoded image body is too large for a URL.
- The
textinstructionsparameter tells the solver what to look for in the image grid.