Menu

Rozwiązywanie captcha obrazkowego

Prześlij treść obrazka i otrzymaj zawarty w nim tekst. Tekst może składać się wyłącznie z cyfr, liter, znaków specjalnych i spacji. Animacje GIF są obsługiwane, do 500kb. Specjalne captcha, jak "znajdź obrazek kota w zestawie obrazków i przepisz numer obrazka" nie są obsługiwane.

Wszystkie captche w Anti Captcha są rozwiązywane wyłącznie przez ludzi, bez udziału sztucznej inteligencji ani oprogramowania OCR. Aktywnie przeciwdziałamy próbom oszukiwania przez naszych pracowników, którzy chcą rozwiązywać je za pomocą oprogramowania OCR, i od 2007 roku zablokowaliśmy miliony kont pracowników. Stosujemy dziesiątki różnych taktyk, aby zapewnić rzeczywistą obecność człowieka, mierzyć i oceniać jakość wprowadzanego tekstu oraz promować lojalnych pracowników. Naszym celem zawsze było osiągnięcie 100% jakości rozpoznawania obrazów, aby zapewnić satysfakcję i spokój ducha naszym klientom.

Python
Node.js
Go
PHP
Java
Kotlin
C#
C++
Rust
Ruby
bash

Jak rozwiązać Captcha obrazkowa w Python

#pip3 install anticaptchaofficial

from anticaptchaofficial.imagecaptcha import *

solver = imagecaptcha()
solver.set_verbose(1)
solver.set_key("YOUR_API_KEY_HERE")

# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)

# optional parameters, see documentation for details
# solver.set_phrase(True)                      # 2 words
# solver.set_case(True)                        # case sensitivity
# solver.set_numeric(1)                        # only numbers
# solver.set_minLength(1)                      # minimum captcha text length
# solver.set_maxLength(10)                     # maximum captcha text length
# solver.set_math(True)                        # math operation result, for captchas with text like 50+5
# solver.set_comment("only green characters")  # comment for workers
# solver.set_language_pool("en")               # language pool

captcha_text = solver.solve_and_return_solution("captcha.jpeg")
if captcha_text != 0:
    print("captcha text "+captcha_text)
else:
    print("task finished with error "+solver.error_code)

Jak rozwiązać Captcha obrazkowa w Node.js

// npm install @antiadmin/anticaptchaofficial
// https://github.com/anti-captcha/anticaptcha-npm

const ac = require("@antiadmin/anticaptchaofficial");
const fs = require('fs');

const captcha = fs.readFileSync('captcha.png', { encoding: 'base64' });

ac.setAPIKey('YOUR_API_KEY_HERE');

// Specify softId to earn 10% commission with your app.
// Get your softId here: https://anti-captcha.com/clients/tools/devcenter
ac.setSoftId(0);

// Additional flags, see documentation description
// ac.settings.phrase = true;                  // 2 words
// ac.settings.case = true;                    // case sensitivity
// ac.settings.numeric = 1;                    // only numbers
// ac.settings.comment = "only green letters"; // text comment for workers
// ac.settings.math = true;                    // math operation like 50+2
// ac.settings.minLength = 1;                  // minimum amount of characters
// ac.settings.maxLength = 10;                 // maximum number of characters
// ac.settings.languagePool = 'en';            // language pool

ac.solveImage(captcha, true)
    .then(text => console.log('captcha text: '+text))
    .catch(error => console.log('test received error '+error));

Jak rozwiązać Captcha obrazkowa w Go

// Install with:
// go get github.com/anti-captcha/anticaptcha-go
package main

import (
    "fmt"
    "github.com/anti-captcha/anticaptcha-go"
    "log"
)

func main() {
    // Create API client and set the API Key
    ac := anticaptcha.NewClient("API_KEY_HERE")

    // set to 'false' to turn off debug output
    ac.IsVerbose = true

    // Specify softId to earn 10% commission with your app.
    // Get your softId here: https://anti-captcha.com/clients/tools/devcenter
    //ac.SoftId = 1187

    // Make sure the API key funds balance is positive
    balance, err := ac.GetBalance()
    if err != nil {
        log.Fatal(err)
        // Exit program to make sure you don't DDoS API with requests, while having empty balance
        return
    }
    fmt.Println("Balance:", balance)

    // Solve image captcha
    solution, err := ac.SolveImageFile("captcha.jpg", anticaptcha.ImageSettings{
        // Optional settings, see documentation for description
        // Phrase        true,                         // Set to 'true' if the image has 2 or more words
        // CaseSensitive true,                         // Set to 'true' if the image is case-sensitive
        // Numeric       1,                            // Set numbers mode
        // MathOperation true,                         // Set to 'true' if the needs a math operation, like result of 50+5
        // MinLength     1,                            // Set minimum length of the text
        // MaxLength     10,                           // Set maximum length of the text
        // LanguagePool  "en",                         // Set language pool to 'en' for English, 'rn' for Russian
        // Comment       "Type in green characters",   // Optional comment for the task
        // WebsiteURL:   "https://some-website.com/",  // Optional to collect stats in the dashboard by this website
    })
    // OR
    // solution, err := ac.SolveImage("image-encoded-in-base64", anticaptcha.ImageSettings{})
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println("Captcha Solution:", solution)
}

Jak rozwiązać Captcha obrazkowa w PHP

//git clone https://github.com/anti-captcha/anticaptcha-php.git

include("anticaptcha.php");
include("imagetotext.php");

$api = new ImageToText();

//your anti-captcha.com account key
$api->setKey("YOUR_API_KEY_HERE");

//setting file
$api->setFile("captcha.jpg");

//Specify softId to earn 10% commission with your app.
//Get your softId here: https://anti-captcha.com/clients/tools/devcenter
$api->setSoftId(0);

//$api->setPhraseFlag(true);   // 2 words flag
//$api->setCaseFlag(true);     // case sensitivity flag
//$api->setNumericFlag(1);     // only numbers flag
//$api->setMathFlag(true);     // math operation flag
//$api->setMinLengthFlag(1);   // minimum number or characters flag
//$api->setMaxLengthFlag(10);  // maximum number of characters flag
//$api->setLanguagePool("en"); // define language pool (see available pools above)

//Define the source website to collect statistics in your Anti-Captcha dashboard
//$api->setWebsiteURL("https://mywebsite.com/");


//create task in API
if (!$api->createTask()) {
    echo "API v2 send failed - ".$api->getErrorMessage()."\n";
    exit;
}

$taskId = $api->getTaskId();

if (!$api->waitForResult()) {
    echo "could not solve captcha\n";
    echo $api->getErrorMessage()."\n";
} else {
    $captchaText    =   $api->getTaskSolution();
    echo "captcha text: $captchaText\n\n";
}

Jak rozwiązać Captcha obrazkowa w Java

// GitHub: https://github.com/anti-captcha/anticaptcha-java
//
// Maven, add to pom.xml:
//   <dependency>
//     <groupId>com.anti-captcha</groupId>
//     <artifactId>anticaptcha</artifactId>
//     <version>1.0.0</version>
//   </dependency>
//
// Gradle, add to build.gradle:
//   implementation "com.anti-captcha:anticaptcha:1.0.0"

import com.anti_captcha.Api.ImageToText;
import com.anti_captcha.Helper.DebugHelper;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        // Set to false to turn the debug output off
        DebugHelper.setVerboseMode(true);

        ImageToText api = new ImageToText();
        api.setClientKey("YOUR_API_KEY_HERE");

        // Specify softId to earn 10% commission with your app.
        // Get your softId here: https://anti-captcha.com/clients/tools/devcenter
        api.setSoftId(0);

        api.setFilePath("captcha.jpg");
        // OR api.setBodyBase64("image-encoded-in-base64");

        // Additional flags, see documentation for details
        // api.setPhrase(true);      // 2 or more words
        // api.setCase(true);        // case sensitivity
        // api.setNumeric(ImageToText.NumericOption.NUMBERS_ONLY);
        // api.setMath(1);           // math operation like result of 50+5
        // api.setMinLength(1);      // minimum length of solution
        // api.setMaxLength(10);     // maximum length
        api.setLanguagePool("en");   // language pool, see docs for available pools

        // Make sure the API key funds balance is positive
        Double balance = api.getBalance();
        if (balance == null || balance <= 0) {
            // Stop here to make sure you don't DDoS the API while having empty balance
            DebugHelper.out("Balance error: " + api.getErrorMessage(), DebugHelper.Type.ERROR);
            return;
        }
        DebugHelper.out("Balance: " + balance, DebugHelper.Type.SUCCESS);

        if (!api.createTask()) {
            DebugHelper.out("API v2 send failed. " + api.getErrorMessage(), DebugHelper.Type.ERROR);
        } else if (!api.waitForResult()) {
            DebugHelper.out("Could not solve the captcha.", DebugHelper.Type.ERROR);
        } else {
            DebugHelper.out("Captcha text: " + api.getTaskSolution().getText(), DebugHelper.Type.SUCCESS);
        }
    }
}

Jak rozwiązać Captcha obrazkowa w Kotlin

// GitHub: https://github.com/anti-captcha/anticaptcha-kotlin
//
// Gradle, add to build.gradle.kts:
//   implementation("com.anti-captcha:anticaptcha-kotlin:1.0.0")

import com.anticaptcha.AnticaptchaClient
import com.anticaptcha.AnticaptchaException
import com.anticaptcha.ApiException
import com.anticaptcha.ImageSettings
import kotlinx.coroutines.runBlocking

fun main(): Unit = runBlocking {
    // Create the API client and set the API key
    val ac = AnticaptchaClient(
        apiKey = "YOUR_API_KEY_HERE",
        // Specify softId to earn 10% commission with your app.
        // Get your softId here: https://anti-captcha.com/clients/tools/devcenter
        softId = 0,
        // Set to false to turn the debug output off
        verbose = true,
    )

    try {
        // Make sure the API key funds balance is positive
        val balance = ac.getBalance()
        if (balance <= 0) {
            // Stop here to make sure you don't DDoS the API while having empty balance
            System.err.println("Empty balance")
            return@runBlocking
        }
        println("Balance: $balance")

        val solution = ac.solveImageFile(
            "captcha.jpg",
            ImageSettings(
                // Additional flags, see documentation for details
                // phrase = true,             // 2 or more words
                // caseSensitive = true,      // case sensitivity
                // numeric = 1,               // 1 - digits only, 2 - no digits
                // mathOperation = true,      // math operation like result of 50+5
                // minLength = 1,             // minimum length of solution
                // maxLength = 10,            // maximum length
                languagePool = "en",          // language pool, see docs for available pools
                // comment = "Type in green characters",
            ),
        )

        println("Captcha text: ${solution.text}")
    } catch (error: ApiException) {
        // https://anti-captcha.com/apidoc/errors
        System.err.println("API error: ${error.errorCode} ${error.description}")
    } catch (error: AnticaptchaException) {
        System.err.println("Failed: ${error.message}")
    }
}

Jak rozwiązać Captcha obrazkowa w C#

// GitHub: https://github.com/anti-captcha/anticaptcha-csharp.git
// install:  dotnet add package AntiCaptchaOfficial
// or, in the Package Manager Console:
// Install-Package AntiCaptchaOfficial

using System;
using AntiCaptcha.Api;
using AntiCaptcha.Helper;


class Program
{
    static void Main()
    {
        // Set to 'false' to turn off debug output
        DebugHelper.VerboseMode = true;

        var api = new ImageToText
        {
            ClientKey = "YOUR_API_KEY_HERE",
            FilePath = "captcha.jpg",
            // OR
            // BodyBase64 = "image-encoded-in-base64",

            // Additional flags, see documentation for details
            // Phrase = true,                                    // 2 or more words
            // Case = true,                                      // case sensitivity
            // Numeric = ImageToText.NumericOption.NumbersOnly,  // numbers only
            // Math = 1,                                         // math operation like result of 50+5
            // MinLength = 1,                                    // minimum length of solution
            // MaxLength = 10,                                   // maximum length
            // LanguagePool = "en",                              // language pool, see docs for available pools
            // Comment = "Type in green characters",             // hint for the worker

            // Specify softId to earn 10% commission with your app.
            // Get your softId here:
            // https://anti-captcha.com/clients/tools/devcenter
            SoftId = 0
        };

        // Make sure the API key funds balance is positive
        var balance = api.GetBalance();
        if (balance == null || balance <= 0)
        {
            // Exit the program to make sure you don't DDoS the API with requests while having empty balance
            Console.WriteLine("Balance error: " + api.ErrorMessage);
            return;
        }
        Console.WriteLine("Balance: " + balance);

        var solution = api.Solve();
        Console.WriteLine("Captcha text: " + solution?.Text);
    }
}

Jak rozwiązać Captcha obrazkowa w C++

// GitHub: https://github.com/anti-captcha/anticaptcha-cplus.git
// Add it to your CMake project:
//   include(FetchContent)
//   FetchContent_Declare(anticaptcha
//           GIT_REPOSITORY https://github.com/anti-captcha/anticaptcha-cplus.git
//           GIT_TAG v1.0.0)
//   FetchContent_MakeAvailable(anticaptcha)
//   target_link_libraries(your_app PRIVATE anticaptcha::anticaptcha)

#include <iostream>
#include <anticaptcha/anticaptcha.hpp>

int main() {
    // Create the API client and set the API key
    anticaptcha::Client ac("YOUR_API_KEY_HERE");

    // Debug output is on by default, turn it off with:
    // ac.shut_up();

    // Specify softId to earn 10% commission with your app.
    // Get your softId here: https://anti-captcha.com/clients/tools/devcenter
    ac.set_soft_id(0);

    try {
        // Make sure the API key funds balance is positive
        const double balance = ac.get_balance();
        if (balance <= 0) {
            // Stop here to make sure you don't DDoS the API while having empty balance
            std::cerr << "Empty balance" << std::endl;
            return 1;
        }
        std::cout << "Balance: " << balance << std::endl;

        anticaptcha::ImageSettings params;
        // Additional flags, see documentation for details
        // params.phrase = true;             // 2 or more words
        // params.case_sensitive = true;     // case sensitivity
        // params.numeric = 1;               // 1 - digits only, 2 - no digits
        // params.math_operation = true;     // math operation like result of 50+5
        // params.min_length = 1;            // minimum length of solution
        // params.max_length = 10;           // maximum length
        params.language_pool = "en";         // language pool, see docs for available pools
        // params.comment = "Type in green characters";

        const anticaptcha::Solution solution = ac.solve_image_file("captcha.jpg", params);
        std::cout << "Captcha text: " << solution.text() << std::endl;
    } catch (const anticaptcha::ApiError& error) {
        // https://anti-captcha.com/apidoc/errors
        std::cerr << "API error: " << error.error_code() << " " << error.description() << std::endl;
        return 1;
    } catch (const anticaptcha::Error& error) {
        std::cerr << "Failed: " << error.what() << std::endl;
        return 1;
    }

    return 0;
}

Jak rozwiązać Captcha obrazkowa w Rust

// GitHub: https://github.com/anti-captcha/anticaptcha-rust
// Install with:
//   cargo add anticaptchaofficial
// or add it to Cargo.toml:
//   [dependencies]
//   anticaptchaofficial = "1"

use anticaptcha::{Client, ImageSettings};

#[tokio::main]
async fn main() -> anticaptcha::Result<()> {
    // Create the API client and set the API key
    let ac = Client::new("YOUR_API_KEY_HERE")
        // Specify softId to earn 10% commission with your app.
        // Get your softId here: https://anti-captcha.com/clients/tools/devcenter
        .with_soft_id(0);
    // .quiet() turns the debug output off

    // Make sure the API key funds balance is positive
    let balance = ac.get_balance().await?;
    if balance <= 0.0 {
        // Stop here to make sure you don't DDoS the API while having empty balance
        eprintln!("Empty balance");
        return Ok(());
    }
    println!("Balance: {balance}");

    let solution = ac
        .solve_image_file(
            "captcha.jpg",
            &ImageSettings {
                // Additional flags, see documentation for details
                // phrase: true,             // 2 or more words
                // case_sensitive: true,     // case sensitivity
                // numeric: 1,               // 1 - digits only, 2 - no digits
                // math_operation: true,     // math operation like result of 50+5
                // min_length: 1,            // minimum length of solution
                // max_length: 10,           // maximum length
                language_pool: "en".into(),  // language pool, see docs for available pools
                // comment: "Type in green characters".into(),
                ..Default::default()
            },
        )
        .await?;

    println!("Captcha text: {}", solution.text());

    Ok(())
}

Jak rozwiązać Captcha obrazkowa w Ruby

# GitHub: https://github.com/anti-captcha/anticaptcha-ruby
# Install with:
#   gem install anticaptchaofficial
# or add it to your Gemfile:
#   gem "anticaptchaofficial"

require "anticaptcha"

# Create the API client and set the API key
ac = Anticaptcha.new("YOUR_API_KEY_HERE")

# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
ac.soft_id = 0

# Set to false to turn the debug output off
ac.verbose = true

begin
  # Make sure the API key funds balance is positive
  balance = ac.balance
  # Stop here to make sure you don't DDoS the API while having empty balance
  abort "Empty balance" if balance <= 0
  puts "Balance: #{balance}"

  solution = ac.solve_image_file(
    "captcha.jpg",
    # Additional flags, see documentation for details
    # phrase: true,             # 2 or more words
    # case_sensitive: true,     # case sensitivity
    # numeric: 1,               # 1 - digits only, 2 - no digits
    # math_operation: true,     # math operation like result of 50+5
    # min_length: 1,            # minimum length of solution
    # max_length: 10,           # maximum length
    language_pool: "en"
    # comment: "Type in green characters",
  )

  puts "Captcha text: #{solution.text}"
rescue Anticaptcha::ApiError => e
  # https://anti-captcha.com/apidoc/errors
  warn "API error: #{e.error_code} #{e.description}"
rescue Anticaptcha::Error => e
  warn "Failed: #{e.message}"
end

Jak rozwiązać Captcha obrazkowa w bash

curl -i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST -d '{
    "clientKey":"YOUR_API_KEY_HERE",
    "task":
        {
            "type":"ImageToTextTask",
            "body":"BASE64_BODY_HERE__NO_NEWLINES__NO_EXTRA_TAGS__ONLY_CLEAN_BASE64",
            "phrase":false,
            "case":false,
            "numeric":0,
            "math":false,
            "minLength":0,
            "maxLength":0,
            "languagePool":"en"
        },
    "softId": 0
}' https://api.anti-captcha.com/createTask

Obiekt typu zadanie

Właściwość/atrybut Typ Wymagany Domyślna wartość Przeznaczenie
type Łańcuch znaków (String) Tak ImageToTextTask Definiuje rodzaj zadania.
body Łańcuch znaków (String) Tak Plik zakodowany w base64. Upewnij się, że wysyłasz bez znaków końca linii. Nie należy dołączać 'data:image/png,' ani innych tagów, wyłącznie czyste base64!
phrase Logiczny (Boolean) Nie false
case Logiczny (Boolean) Nie true
numeric Integer Nie 0
math Logiczny (Boolean) Nie false
minLength Integer Nie 0
maxLength Integer Nie 0
comment Łańcuch znaków (String) Nie Dodatkowe komentarze dla pracowników, takie jak "wpisz czerwony tekst". Wynik nie jest gwarantowany i zależy wyłącznie od pracownika.
websiteURL Łańcuch znaków (String) Nie Opcjonalny parametr pozwalający rozróżnić źródła captcha obrazkowych w statystykach obciążeń konta.
languagePool Łańcuch znaków (String) Nie en Ustawia język puli pracowników. Dotyczy tylko captcha obrazkowych. Obecnie dostępne są pule w językach:

"en" (domyślnie): Kolejka w języku angielskim
"rn": grupa krajów: Rosja, Ukraina, Białoruś, Kazachstan

Obiekt typu rozwiązanie zadania

Właściwość/atrybut Typ Przeznaczenie
text Łańcuch znaków (String) Tekst z captcha obrazkowego
url Łańcuch znaków (String) Adres w sieci, gdzie będziemy przechowywać captcha przez kolejne 24 godziny. Po tym okresie jest ona usuwana.

Przykład odpowiedzi

{
    "errorId":0,
    "status":"ready",
    "solution":
    {
        "text":"deditur",
        "url":"http://61.39.233.233/1/147220556452507.jpg"
    },
    "cost":"0.000700",
    "ip":"46.98.54.221",
    "createTime":1472205564,
    "endTime":1472205570,
    "solveCount":"0"
}