✨ NoCaptcha v2 is here — fresh look, API v2 & agentic solving.Read the changelog →
Image Tasks

ImageToText

Recognize text inside an image (OCR) with the NoCaptchaAI API.

Create a task

POST https://api.nocaptchaai.com/createTask

curl -X POST https://api.nocaptchaai.com/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "ImageToTextTask",
      "body": "/9j/4AAQSkZJRgABAQ....",
      "module": "module_nocap_201",
      "case": false,
      "numeric": 0,
      "math": false,
      "minLength": 0,
      "maxLength": 0
    }
  }'
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "ImageToTextTask",
    "body": "/9j/4AAQSkZJRgABAQ....",
    "module": "module_nocap_201",
    "case": false,
    "numeric": 0,
    "math": false,
    "minLength": 0,
    "maxLength": 0
  }
}

Task parameters

ParameterTypeRequiredDescription
typestringYesTask type, must be "ImageToTextTask".
bodystringYesBase64-encoded image string.
modulestringNoOCR model identifier, for example module_nocap_201 or module_nocap_202. Defaults to common. Match your image against the samples below.
casebooleanNoCase sensitivity: true for case-sensitive, false otherwise. Default is false.
numericintegerNoCharacter filter: 0 for any, 1 for numbers only, 2 for letters only. Default is 0.
mathbooleanNoWhether the image contains a mathematical equation to solve. Default is false.
minLengthintegerNoMinimum length of recognized text. Default is 0 (no minimum).
maxLengthintegerNoMaximum length of recognized text. Default is 0 (no maximum).

Supported models

Compare your captcha image with the samples below and pass the matching module value in your task. common is the universal fallback model: use it when none of the specialized samples match your captcha, or omit module to use it by default.

common1 sample
General Alphanumeric
module_nocap_20113 samples
NCS Spaced Letters
EnzoSolution / Securimage
BDRIS
Web.de
France Visa
Dot Matrix Numbers
Catch.au
BLS Senegal / Italy Visa
Croatia Visa
Mozambique eVisa
Clean Alphanumeric
Multi-colored Staggered
BLS / Morocco OCR
module_nocap_2029 samples
Poland Konsulat (Math)
Vietnam eVisa
Malawi eVisa
Azerbaijan eVisa
Bahrain Portal
State Bank of India (SBI)
SBI Multi-Color
Thailand eVisa
Oman eVisa
module_nocap_2031 sample
MCA India Portal
module_nocap_2046 samples
Brazil Legal — Sample 1
Brazil Legal — Sample 2
Brazil Legal — Sample 3
Brazil Legal — Sample 4
Brazil Legal — Sample 5
Brazil Legal — Sample 6
module_nocap_2058 samples
SEFAZ RN / SEI — Sample 1
SEFAZ RN / SEI — Sample 2
SEFAZ RN / SEI — Sample 3
SEFAZ RN / SEI — Sample 4
SEFAZ RN / SEI — Sample 5
SEFAZ RN / SEI — Sample 6
SEFAZ RN / SEI — Sample 7
SEFAZ RN / SEI — Sample 8
mod-ocr7035 samples
OCR 703 — Sample 1
OCR 703 — Sample 2
OCR 703 — Sample 3
OCR 703 — Sample 4
OCR 703 — Sample 5
probot1 sample
Probot

Returns a taskId:

{
  "errorId": 0,
  "status": "idle",
  "taskId": "abc123"
}

Get the result

Poll POST https://api.nocaptchaai.com/getTaskResult until status is ready:

{
  "clientKey": "YOUR_API_KEY",
  "taskId": "abc123"
}
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "text": "aB3xQ"
  }
}
  • solution.text contains the recognized text or mathematical result.

Code example

import time
import requests

API_KEY = "YOUR_API_KEY"
BASE = "https://api.nocaptchaai.com"

# 1. Create the task
task = requests.post(
    f"{BASE}/createTask",
    json={
        "clientKey": API_KEY,
        "task": {
            "type": "ImageToTextTask",
            "body": "/9j/4AAQSkZJRgABAQ....",
            "module": "module_nocap_201",
            "case": False,
            "numeric": 0,
            "math": False,
            "minLength": 0,
            "maxLength": 0,
        },
    },
).json()

task_id = task["taskId"]

# 2. Poll for the result
while True:
    time.sleep(2)
    res = requests.post(
        f"{BASE}/getTaskResult",
        json={"clientKey": API_KEY, "taskId": task_id},
    ).json()

    if res.get("status") == "ready":
        print(res["solution"]["text"])
        break
    if res.get("status") == "failed" or res.get("errorId"):
        raise SystemExit(res)
const API_KEY = "YOUR_API_KEY";
const BASE = "https://api.nocaptchaai.com";

// 1. Create the task
const create = await fetch(`${BASE}/createTask`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    clientKey: API_KEY,
    task: {
      type: "ImageToTextTask",
      body: "/9j/4AAQSkZJRgABAQ....",
      module: "module_nocap_201",
      case: false,
      numeric: 0,
      math: false,
      minLength: 0,
      maxLength: 0,
    },
  }),
}).then((r) => r.json());

// 2. Poll for the result
let solution;
while (true) {
  await new Promise((r) => setTimeout(r, 2000));
  const res = await fetch(`${BASE}/getTaskResult`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      clientKey: API_KEY,
      taskId: create.taskId,
    }),
  }).then((r) => r.json());

  if (res.status === "ready") {
    solution = res.solution.text;
    break;
  }
  if (res.status === "failed" || res.errorId) {
    throw new Error(JSON.stringify(res));
  }
}

console.log(solution);
# 1. Create the task
curl -X POST https://api.nocaptchaai.com/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "ImageToTextTask",
      "body": "/9j/4AAQSkZJRgABAQ....",
      "module": "module_nocap_201",
      "case": false,
      "numeric": 0,
      "math": false,
      "minLength": 0,
      "maxLength": 0
    }
  }'

# 2. Get the result
curl -X POST https://api.nocaptchaai.com/getTaskResult \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "taskId": "abc123"
  }'

Next steps

On this page