captcha.funCaptcha.fun

Image to Text

Create an Image to Text solve and retrieve decoded captcha text


Create Solve

POST https://api.captcha.fun/v1/request

Request Headers

HeaderTypeRequiredDescription
API_KEYstringYesYour API key
Content-TypestringYesapplication/json
APP_IDstringNoOptional application identifier for tracking requests

Request Body

FieldTypeRequiredDescription
kindstringYesMust be image_to_text
imageBase64stringYesBase64-encoded PNG, JPEG, or WebP captcha image. A data: URI prefix is accepted.
modelstringNoModel variant: queueit. Defaults to queueit.

Create Solve Example

curl -X POST https://api.captcha.fun/v1/request \
  -H "API_KEY: CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "kind": "image_to_text",
    "imageBase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "model": "queueit"
  }'
import requests

response = requests.post(
    "https://api.captcha.fun/v1/request",
    headers={
        "API_KEY": "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "kind": "image_to_text",
        "imageBase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
        "model": "queueit",
    },
)

print(response.status_code, response.json())
const response = await fetch("https://api.captcha.fun/v1/request", {
  method: "POST",
  headers: {
    "API_KEY": "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    kind: "image_to_text",
    imageBase64: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    model: "queueit"
  })
});

console.log(response.status, await response.json());

Create Solve Response

{"id": "550e8400-e29b-41d4-a716-446655440000","message": "Request submitted successfully"}
{"message": "Invalid request body"}

Create Response Fields

FieldTypeDescription
idstring (UUID)The unique identifier for the solve request
messagestringStatus message

Get Solve

GET https://api.captcha.fun/v2/response/{id}
GET https://api.captcha.fun/v1/response/{id}

Polling

Poll this endpoint every 1 second and check for `ready === true` in the response body. This is faster and more efficient than v1's long polling approach.

Path Parameters

ParameterTypeRequiredDescription
idstring (UUID)YesThe ID returned by POST /v1/request

Request Headers

HeaderTypeRequiredDescription
API_KEYstringYesYour API key

Get Solve Example

curl -X GET https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000 \  -H "API_KEY: CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \  -H "Accept: application/json"
import requestsresponse = requests.get(    "https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000",    headers={        "API_KEY": "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",        "Accept": "application/json"    })print(response.status_code, response.json())
const response = await fetch(  "https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000",  {    method: "GET",    headers: {      "API_KEY": "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",      "Accept": "application/json"    }  });const data = await response.json();console.log(response.status, data);
package mainimport (    "encoding/json"    "fmt"    "net/http")func main() {    req, _ := http.NewRequest("GET", "https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000", nil)    req.Header.Set("API_KEY", "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")    req.Header.Set("Accept", "application/json")    client := &http.Client{}    resp, _ := client.Do(req)    defer resp.Body.Close()    var result map[string]interface{}    json.NewDecoder(resp.Body).Decode(&result)    fmt.Println(resp.StatusCode, result)}
import java.net.http.*;import java.net.URI;public class Main {    public static void main(String[] args) throws Exception {        HttpClient client = HttpClient.newHttpClient();        HttpRequest request = HttpRequest.newBuilder()            .uri(URI.create("https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000"))            .header("API_KEY", "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")            .header("Accept", "application/json")            .GET()            .build();        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());        System.out.println(response.statusCode() + " " + response.body());    }}
using System.Net.Http;var client = new HttpClient();client.DefaultRequestHeaders.Add("API_KEY", "CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");client.DefaultRequestHeaders.Add("Accept", "application/json");var response = await client.GetAsync("https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000");var result = await response.Content.ReadAsStringAsync();Console.WriteLine($"{(int)response.StatusCode} {result}");

Response

{  "ready": true,  "status": "SUCCESS",  "success": true,  "text": "7GDK4",  "confidence": 0.982}
{  "message": "Invalid request ID"}

Solve Response Fields

FieldTypeDescription
readybooleanWhether the solve is complete - poll until true (v2 only)
statusstringThe status of the solve request (SUCCESS or FAILURE)
successbooleanWhether the solve was successful
textstringDecoded captcha text for Image to Text solves
confidencenumberImage to Text confidence score from 0 to 1