Skip to main content

Util::AntiGate - captcha recognition via the AntiGate service

Scraper overview

antigate

This scraper is typically used as a plug-in component in other scrapers where image captcha solving may be required, for example: SE::YandexSE::Yandex, Check::RosKomNadzorCheck::RosKomNadzor, as well as in custom JavaScript scrapers.

The principle of this scraper is to send a captcha image to a solving service and receive the text value shown on the captcha in response. The accuracy of the solving depends solely on the solving service and sometimes on the captcha settings.

The process of connecting and configuring this scraper is described in detail in the article Anti-captcha settings

Scraper use cases

Features

  • Supports all AntiGate-compatible services: AntiCaptcha, RuCaptcha, 2captcha, XEvil, CapMonster, CapMonster.cloud, CapSolver, captchas.io, ApiBar, etc.
  • Ability to flexibly configure response timeout, captcha parameters, and notify the solving service about an incorrectly solved captcha

Usage scenarios

  • Captcha recognition in built-in scrapers, where solving captchas is optionally or mandatory to obtain results
  • Captcha recognition in custom JS scrapers
  • Recognition of small text data from images (e.g., phone numbers)

Queries

You must specify a link to the captcha as a query, for example:

https://files.a-parser.com/img/get-captcha-image.png

Output results examples

  • $answer - captcha answer
  • $error - if an error occurred, its description

Outputting recognized text

Result format:

$answer

Result example:

332822

Possible settings

ParameterDefault valueDescription
ProviderAntiCaptchaSolving service selection, automatically sets the correct service address (url)
Provider urlSolving service domain, allows overriding the service domain, can be empty
Client keyService access key
HTTP errors retries5Number of attempts to recognize the captcha in case of network failures
HTTP timeout60Server response timeout in seconds
Wait between get status5Delay between polling the AntiGate service for captcha status
Max wait time300Maximum waiting time for a recognized captcha
NO_SLOT_AVAILABLE retries5Number of attempts to upload the captcha to the anti-captcha service if the service reports an overload
NO_SLOT_AVAILABLE interval2Wait interval between attempts in seconds
Param "phrase"00 = default value (one word). 1 = captcha has two words
Param "regsense"00 = default value (case-insensitive). 1 = case-sensitive
Param "numeric"00 = default value. 1 = captcha consists only of digits. 2 = captcha has no digits
Param "calc"00 = default value. 1 = mathematical operation with digits on the captcha
Param "min_len"00 = default value. >0 = minimum text length on the captcha that the worker must enter
Param "max_len"00 = default value (unlimited). >0 = maximum text length on the captcha that the worker must enter
Param "is_russian"00 = default value. 1 = show captcha to a worker with knowledge of the Russian language
Fake answerFake answer, does not use the service but immediately returns a random string as an answer, used for testing scrapers
Report bad captchasIf the option is disabled, time spent checking the captcha correctness request will be saved. Relevant for CapMonster and XEvil
Log captcha imagesManaging the output of captcha images to the log
Stop task on zero balanceStop the task if the solving service balance runs out of funds