Image captcha
Image captcha: parameters, request, response and the 2Captcha method of ImageToTextTask.
On this page
A picture with distorted text or digits. Send the image in base64 and get the text in solution.text; the options say what the answer may contain (digits only, a sum to calculate, case, length, the language of the workers' pool).
| Status | coming soon |
| Type codes | ImageToTextTask — without a proxy |
| Proxy | not needed |
| Also accepted as | — |
| Price | set when the type is switched on — see pricing |
Parameters#
Fields of the task object in createTask:
ParameterDescription
typestringrequired- Task type:
ImageToTextTask. bodystringrequired- The captcha file in base64. Base64 picture (PNG, JPEG, GIF, WEBP or BMP), a
data:image/…;base64,prefix is allowed; up to 600 KB decoded. phrasebooleantruewhen the answer has two or more words.trueorfalse(1and0are accepted too).casebooleantruewhen the answer is case-sensitive.trueorfalse(1and0are accepted too).numericinteger0any characters,1digits only,2letters only,3digits or letters,4both. Integer from 0 to 4.mathbooleantruewhen the picture is a sum to calculate.trueorfalse(1and0are accepted too).minLengthinteger- Minimum length of the answer,
0for no limit. Integer from 0 to 100. maxLengthinteger- Maximum length of the answer,
0for no limit. Integer from 0 to 100. commentstring- Instruction for the solver. One line of text, up to 1024 characters.
imgInstructionsstring- Instruction as a picture. Base64 picture (PNG, JPEG, GIF, WEBP or BMP), a
data:image/…;base64,prefix is allowed; up to 100 KB decoded. languagePoolstring- Language of the workers:
en(default),ru,zhand other two-letter codes. It may also be sent next totask, as 2Captcha clients do. Letters, digits and_ - . :, up to 8 characters.
Request#
A ImageToTextTask task:
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "ImageToTextTask",
"body": "iVBORw0KGgoAAAANSUhEUgAA…"
}
}Response#
getTaskResult once the task is solved:
{
"errorId": 0,
"status": "ready",
"solution": {
"text": "x7k2p",
"userAgent": ""
},
"cost": "0.000500",
"ip": "198.51.100.7",
"createTime": 1793370000,
"endTime": 1793370012,
"solveCount": 1
}2Captcha in.php#
The same task through the 2Captcha API: method=base64 (or method=post with the picture in file), parameters → task fields:
| in.php | task |
|---|---|
body | body |
phrase | phrase |
regsense | case |
numeric | numeric |
calc | math |
min_len | minLength |
max_len | maxLength |
textinstructions | comment |
imginstructions | imgInstructions |
lang | languagePool |
res.php returns text of the solution as text (OK|…), or in request with json=1.