Skip to content

Text Captcha Recognition API (Image to Text) ​

This method recognizes captchas with text on an image: distorted letters, digits and arithmetic. You send the image and get the text back, ready to type into the input.

An overview of text captchas and the service is on the captcha to text solver page. You can try a text captcha on the text captcha demo page. AI assistants can recognize text captchas through the MCP server with the solve_image_captcha tool.

Supported captchas ​

Solve Media, Facebook, Yandex, Steam, VKontakte, BotDetect, Google, Hotmail, Avito and more than 100,000 other types.

Choosing the neural network ​

Choosing the neural network in the dashboard
Choose the neural network that suits your type of captcha on the settings page in your dashboard. Changes take effect within 5 minutes.

  • Method OLD is the most versatile method and works with any type of captcha, but its recognition rate is lower than that of the specialized methods.
  • General v1 is a general method with more accurate recognition of some subtypes.
  • individual_v1 is similar to General v1 but more accurate for numeric captchas.
  • General Cyrillic is a general method for captchas with Cyrillic characters.

You can also set the captcha kind for each request with the vernet parameter (see the table below).

Sending a task ​

http://api2.cap.guru/in.php

ParameterTypeRequiredDescription
keyStringYesYour API key. You can find it in the dashboard
methodStringYespost: you send the image as a file using multipart/form-data
base64: you send the image in Base64 format
fileFileYes*Image file
* required if you send the image as a file (method=post)
bodyStringYes*Image encoded in Base64
* required if you send the image in Base64 (method=base64)
jsonNumber
Default: 0
No0: the server returns a plain text response
1: the server returns a JSON response
vernetNumberNoCaptcha kind:
2 - General v1
6 - General v2
22 - Arithmetic
12 - Rambler
18 - General Yandex
20 - Yandex, 6 characters
16 - VKontakte
14 - SolveMedia
13 - Gibdd
9 - Ok.ru
17 - World of Tanks
5 - Microsoft Hotmail

Example: vernet=5

For distorted text from an unknown site, try vernet 2 or 6.

Request and response example

Request example ​

text
POST http://api2.cap.guru/in.php
Host: api2.cap.guru
Content-Type: application/json
json
{
  "key": "YOUR_API_KEY",
  "method": "base64",
  "body": "R0lGODlheAAoAAAAACwAAAAAeAAoAIcAAAAAADMAAGYAAJkAAMwAAP8AKwAAKzMAK2YAK5kAK8wAK/8AVQAAVTMAVWYAVZkAVcwAVf8AgAAAgDMAgGYAgJkAgMwAgP8AqgAA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0yDNpE5/Zsx0lObQgsoWijlY9ahFmlxpZi0IFuOkrmINnm2KEMDWgj7L7ss0s+bbiTTvCqRKc0XBoGMvHl1q0+BMNAmL6hVYmCCxxnjlMoY8WarAujURN7RLkLJAn1B7IjUY13JnAFcjrpC8r7RpxoFd53VYM+rr1qMRxg3LdmDQ2xD5Bt4H1urpsXEnRX7N9zZhhQCG760dNXTku3WJyz0r9TlFyp73nf+Vftr6ZeoEuZuP+Hvg033etUOliaYl8IXc5e42aMCogRU3xFAaeaXBdZNFjwGgmXH1WEYYTl0tthBhYBG2nnZocVZQcwNhxtpykw20VFLCwWeTAaX1phCFXoUFAIBioCHGJB6ulyFNyl20n2RgcScQd8PFB11N9tV0oXwI8aUZWWipSNFvyiR42j7Q5LaUhOghRCFBHoaV2mk5MnmUhF/dN1NcUO132n0CbVlQgsCl1RZqLpKpEZyvGYVTgqm9NyRwRX2IY0If7oOZSIHSSRCLpy1WqGNZDpRfVOS5F51BboY0qZimYbZSeBseWNChTA55EIci1eWkhpa2qFBzNtJTtCqbhpL5G60ZJVjpDWQSU5qdtg1KpU3kPRoippHGxFFzaE2USaUYKhuSh65ulKy0HFX1JbbcSgRtt+CGK+645JZr7rnopqvuuuy26+678MYrb0AAOw==",
  "json": 1
}

After sending the task to us, you should receive in response 'OK|65787087' or {"status":1,"request":"65787087"} if the request is successful. Please read [the full list of possible errors] (/en/api/code_error) in case you did not receive the task number.

Response example ​

json
{
 "status":1,
 "request":"65787087"
}

Getting a response ​

http://api2.cap.guru/res.php

ParameterTypeRequiredDescription
keyStringYesThe key can be viewed here
actionStringYesget — get response
idNumberYesID of captcha returned by in.php.
jsonNumber
By default: 0
No0 — the server will return a response in plain text
1 — the server will return a response in JSON format
Request and response example

Request example ​

text
POST http://api2.cap.guru/res.php
Host: api2.cap.guru
Content-Type: application/json

id is the task ID returned by in.php, for example 65787087.

json
{
  "key": "YOUR_API_KEY",
  "action": "get",
  "id": "65787087",
  "json": 1
}

If the captcha is recognized, you receive OK|W68HP or {"status":1,"request":"W68HP"}. If you did not get an answer, check the full list of possible errors.

Response example ​

json
{
  "status": 1,
  "request": "W68HP"
}

Recognition in ZennoPoster ​

Text captcha recognition in ZennoPoster

Code examples ​

js
string img = project.Variables["image"].Value;
string key = project.Variables["capguru_apikey"].Value;

string result = project.Variables["result"].Value;

img = EncodeString(img);


string text12 = "method=base64&key="+key+"&body="+img+"&vernet=0";


var answer = ZennoPoster.HTTP.Request( 
	method: ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.POST, 
	url: @"http://api.cap.guru/in.php",  
	content: text12,  
	respType: ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.BodyOnly
);
info("Get id:" +answer );


			
if(answer.Contains("OK")){	
	var answerInt  = Regex.Replace(answer,@"[^0-9]","");
	Thread.Sleep(4000);
	
	answer = ZennoPoster.HTTP.Request( method: ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.GET, url: @"http://api.cap.guru/res.php?action=get&id="+answerInt+"&key="+key, respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.BodyOnly);
		
	if(answer.Contains("OK")){
		//result =  new string(answer.Split("|")[1]);
		var parts2 = answer.Substring(3);
		project.Variables["result"].Value =parts2;
	}
	info("Result: " +answer );

}		
			

	void info(string word){  project.SendInfoToLog(word.ToString(), "[CapGuru][IMG]", true);  }
		
string EncodeString(string str){
    int maxLengthAllowed = 65519;
    StringBuilder sb = new StringBuilder();
    int loops = str.Length / maxLengthAllowed;
    for (int i = 0; i <= loops; i++){  sb.Append(Uri.EscapeDataString(i < loops ? str.Substring(maxLengthAllowed * i, maxLengthAllowed) : str.Substring(maxLengthAllowed * i))); }
    return sb.ToString();
}
py
import requests
from io import BytesIO
import base64
import time

key = 'YOUR_API_KEY'
url = 'https://test.cap.guru/web/_images/ex.png'
response = requests.get(url)

ee = base64.b64encode((response.content))

payload = {'key': key, 'method': 'base64', 'body': ee}
r = requests.post("http://api.cap.guru/in.php", data=payload)

time.sleep(10)

rt = r.text.split('|')
url = 'http://api.cap.guru/res.php?key='+key+'&id='+rt[1]
print(url);
response = requests.get(url)

print(response.content)
php
<?php 

 

$file = base64_encode(file_get_contents("http://test.cap.guru/web/_images/aws/99737344449386000000.png"));

$json = [];
$json['key'] = "YOUR_API_KEY";
$json['method'] = "base64";
$json['click'] = "oth";
$json['textinstructions'] = "Amazon,Place a dot at the end of the car's path";
$json['body'] = $file;


$postdata = http_build_query($json);

$opts = array('http' =>
    array(
        'method'  => 'POST',
        'header'  => 'Content-Type: application/x-www-form-urlencoded',
        'content' => $postdata
    )
);

$context  = stream_context_create($opts);

$result = file_get_contents('http://api.cap.guru/in.php', false, $context);

sleep(5);

//echo $server_output;
echo file_get_contents("http://api.cap.guru/res.php?key=YOUR_API_KEY&action=get&id=".explode("|", $result)[1]);

?>
js

var request = require('request');

var img =  getBinanceBase64();

var YOUR_API_KEY = "YOUR_API_KEY";

(async() => {
	var waw =  await k(img);
	console.log(waw);
})();

function delay(time) {
	return new Promise(function(resolve) {
		setTimeout(resolve, time)
	});
}
async function k(img) {

	return new Promise(async function(resolve2) {
		let buffurl1 = img
		var myJSONObject = {
			"key": YOUR_API_KEY,
			"method": "base64",
			"body": buffurl1,
			
		};
		request({
			url: "http://api.cap.guru/in.php",
			method: "POST",
			json: true,
			body: myJSONObject
		}, async function(error, response, body) {
			console.log(body);
			id = body.split("|")[1]
			let res = await delay(5000).then(async() => {
				let res2 = await get_result_request(id);
				console.log(res2);
				dd = res2.split("|")[1]
				resolve2(dd )
			});
		});
	});

	function get_result_request(id) {
		return new Promise(async resolve => {
			return await request.get('http://api.cap.guru/res.php?key=' + YOUR_API_KEY + '&id=' + id + '&action=get', async function(error2, response2, body2) {
				resolve(body2);
			})
		});
	}
}



function getBinanceBase64(){
	return "data:image/gif;base64,R0lGODlheAAoAAAAACwAAAAAeAAoAIcAAAAAADMAAGYAAJkAAMwAAP8AKwAAKzMAK2YAK5kAK8wAK/8AVQAAVTMAVWYAVZkAVcwAVf8AgAAAgDMA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