Skip to content

Latest commit

 

History

History
124 lines (87 loc) · 1.91 KB

File metadata and controls

124 lines (87 loc) · 1.91 KB

Image CAPTCHA — CaptchaAI Example Pack

Full working example for solving Image CAPTCHA (OCR / image-to-text) using the CaptchaAI API.

Languages: Python, Node.js, PHP, Go, Java, C#, Ruby, Rust, Kotlin, Bash

Related article

This example accompanies the blog article: Image CAPTCHA Solving Using API

Prerequisites

  • 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

Image CAPTCHA parameters

Parameter Required Description
method Yes Must be base64
body Yes Base64-encoded CAPTCHA image data

Response

The API returns the recognized text in the request field (e.g. "abc123").

Setup

  1. Clone the repository:

    git clone https://github.com/CaptchaAI/CaptchaAI-Examples.git
    cd CaptchaAI-Examples/articles/image-captcha-solving-using-api
  2. Copy the environment file and add your credentials:

    cp .env.example .env
  3. Edit .env with your API key and image file path.

  4. Follow the language-specific setup below.

Python

cd python
pip install -r requirements.txt
python solve.py

Node.js

cd node
npm install
node solve.js

PHP

cd php
composer install
php solve.php

Go

cd go
go run solve.go

Java

cd java
javac Solve.java
java Solve

C#

cd csharp
dotnet run

Ruby

cd ruby
ruby solve.rb

Rust

cd rust
cargo run

Kotlin

cd kotlin
kotlinc solve.kt -include-runtime -d solve.jar
java -jar solve.jar

Bash

cd bash
chmod +x solve.sh
bash solve.sh

License

MIT