PHPackages                             batrox/php-anticaptcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. batrox/php-anticaptcha

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

batrox/php-anticaptcha
======================

AntiCaptcha - Is PHP Library for working with Anticapthca services

0.0.1(5mo ago)02MITPHPPHP &gt;=7.2.6

Since Dec 15Pushed 5mo agoCompare

[ Source](https://github.com/batrox/php-anticaptcha)[ Packagist](https://packagist.org/packages/batrox/php-anticaptcha)[ Docs](https://github.com/reilag/php-anticaptcha)[ RSS](/packages/batrox-php-anticaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Anticaptcha PHP SDK
===================

[](#anticaptcha-php-sdk)

 This library will help you to recognize any captcha via specific services.
 Easy to install. Easy to use.

 [packages.org](https://packagist.org/packages/reilag/php-anticaptcha) · [anti-captcha.com](http://getcaptchasolution.com/zi0d4paljn)

---

[![Total Downloads](https://camo.githubusercontent.com/d3387e8d692c837c80b21b13c11d3b140024bc8295e837e2e2e7584f7c00b413/68747470733a2f2f706f7365722e707567782e6f72672f7265696c61672f7068702d616e7469636170746368612f646f776e6c6f616473)](https://packagist.org/packages/reilag/php-anticaptcha)[![License](https://camo.githubusercontent.com/c0a016fd1aea133ff5562a67c0440e6bc34b679758655eb0914c8798d7208241/68747470733a2f2f706f7365722e707567782e6f72672f7265696c61672f7068702d616e7469636170746368612f6c6963656e7365)](https://packagist.org/packages/reilag/php-anticaptcha)[![Latest Stable Version](https://camo.githubusercontent.com/0d401f940d606c4c18abc200035340142556795ac3f11ecdd69802acf8236d90/68747470733a2f2f706f7365722e707567782e6f72672f7265696c61672f7068702d616e7469636170746368612f762f737461626c65)](https://packagist.org/packages/reilag/php-anticaptcha)

---

PHP client for [anti-captcha.com](http://getcaptchasolution.com/zi0d4paljn) service. This client supports resolving captcha types:

- [Captcha from image](#recognize-captcha-from-image)
- [reCaptcha V2](#recognize-recaptcha-v2-with-proxy-or-without-invisible)
- [Invisible reCaptcha](#recognize-recaptcha-v2-with-proxy-or-without-invisible)
- [reCaptcha V2 Enterprise](#recognize-recaptcha-v2-enterprise-with-proxy-or-without)
- [reCaptcha V3](#recognize-captcha-from-image)
- [reCaptcha V3 Enterprise](#recognize-recaptcha-v3-or-v3-enterprise)
- [Turnstile](#recognize-turnstile)

To Do:

- FunCaptcha
- GeeTest captcha
- Solving HCaptcha

### Install

[](#install)

You can add Anticaptcha as a dependency using the **composer.phar** CLI:

```
# Install Composer (if need)
curl -sS https://getcomposer.org/installer | php

# Add dependency
composer require reilag/php-anticaptcha:^2.2.0
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

You can find some examples at [/example](/example) path.

### Create Client

[](#create-client)

```
use AntiCaptcha\AntiCaptcha;

// Your API key
$apiKey = '*********** API_KEY **************';

$antiCaptchaClient = new AntiCaptcha(
    AntiCaptcha::SERVICE_ANTICAPTCHA,
    [
        'api_key' => $apiKey,
        'debug' => true
    ]
);
```

### Recognize captcha from image

[](#recognize-captcha-from-image)

```
use AntiCaptcha\AntiCaptcha;

// Get file content
$image = file_get_contents(realpath(dirname(__FILE__)) . '/images/image.jpg');

$imageText = $antiCaptchaClient->recognizeImage($image, null, ['phrase' => 0, 'numeric' => 0], 'en');

echo $imageText;
```

### Recognize reCaptcha V2 (with Proxy or without, Invisible)

[](#recognize-recaptcha-v2-with-proxy-or-without-invisible)

```
$task = new \AntiCaptcha\Task\RecaptchaV2Task(
    "http://makeawebsitehub.com/recaptcha/test.php",     // setIsInvisible(true);

// To use Proxy, use this function
$task->setProxy(
    "8.8.8.8",
    1234,
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116",
    "http",
    "login",
    "password",
    // also you can add cookie
    "cookiename1=cookievalue1; cookiename2=cookievalue2"
);

$response = $antiCaptchaClient->recognizeTask($task);

echo $response['gRecaptchaResponse'];
```

### Recognize reCaptcha V2 Enterprise (with Proxy or without)

[](#recognize-recaptcha-v2-enterprise-with-proxy-or-without)

```
$task = new \AntiCaptcha\Task\RecaptchaV2EnterpriseTask(
    "http://makeawebsitehub.com/recaptcha/test.php",     //  "SOME_ADDITIONAL_TOKEN"
]);

// To use Proxy
$task->setProxy(
    "8.8.8.8",
    1234,
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116",
    "http",
    "login",
    "password",
    // also you can add cookie
    "cookiename1=cookievalue1; cookiename2=cookievalue2"
);

$response = $antiCaptchaClient->recognizeTask($task);

echo $response['gRecaptchaResponse'];
```

### Recognize reCaptcha V3 (or V3 Enterprise)

[](#recognize-recaptcha-v3-or-v3-enterprise)

```
$task = new \AntiCaptcha\Task\RecaptchaV3Task(
    "http://makeawebsitehub.com/recaptcha/test.php",  // target website address
    "6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ",      // recaptcha key from target website

    // Filters workers with a particular score. It can have one of the following values:
    // 0.3, 0.7, 0.9
    "0.3"
);

// Recaptcha's "action" value. Website owners use this parameter to define what users are doing on the page.
$task->setPageAction("myaction");

// As V3 Enterprise is virtually the same as V3 non-Enterprise, we decided to roll out it’s support within the usual V3 tasks.
// Set this flag to "true" if you need this V3 solved with Enterprise API. Default value is "false" and
// Recaptcha is solved with non-enterprise API.
$reCaptchaV3Task->setIsEnterprise(true);

$response = $antiCaptchaClient->recognizeTask($task);

echo $response['gRecaptchaResponse'];  // Return 3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3
```

### Recognize Turnstile

[](#recognize-turnstile)

```
$task = new \AntiCaptcha\Task\TurnstileTask(
    // Address of a target web page. Can be located anywhere on the web site, even in a member area.
    // Our workers don't navigate there but simulate the visit instead.
    "http://makeawebsitehub.com/recaptcha/test.php",
    // Turnstile sitekey
    "6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ"
);

// Optional "action" parameter.
$task->setAction("myaction");

// If you need setup proxy
$task->setProxy(
    "8.8.8.8",
    1234,
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0",
    "http",
    "login",
    "password",
    null // also you can add cookie
);

$response = $antiCaptchaClient->recognizeTask($task);

// Token string required for interacting with the submit form on the target website.
echo $response['token'];  // 0.vtJqmZnvobaUzK2i2PyKaSqHELYtBZfRoPwMvLMdA81WL_9G0vCO3y2VQVIeVplG0mxYF7uX.......

// User-Agent of worker's browser. Use it when you submit the response token.
echo $response['userAgent'];  // Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
```

### Get balance

[](#get-balance)

```
use AntiCaptcha\AntiCaptcha;

$apiKey = '*********** API_KEY **************';

$service = new \AntiCaptcha\Service\AntiCaptcha($apiKey);
$antiCaptchaClient = new \AntiCaptcha\AntiCaptcha($service);

echo "Your Balance is: " . $antiCaptchaClient->balance() . "\n";
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance73

Regular maintenance activity

Popularity2

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

154d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/600ddb056d99d542b6cecb23d556a00117b3f9156d1f1f3fd239aaa4df5e5ce7?d=identicon)[batrox](/maintainers/batrox)

---

Top Contributors

[![m-tymchyk](https://avatars.githubusercontent.com/u/7893507?v=4)](https://github.com/m-tymchyk "m-tymchyk (31 commits)")[![jenyak](https://avatars.githubusercontent.com/u/2803849?v=4)](https://github.com/jenyak "jenyak (2 commits)")[![batrox](https://avatars.githubusercontent.com/u/7557661?v=4)](https://github.com/batrox "batrox (1 commits)")[![flexnst](https://avatars.githubusercontent.com/u/2928442?v=4)](https://github.com/flexnst "flexnst (1 commits)")[![keanor](https://avatars.githubusercontent.com/u/4879588?v=4)](https://github.com/keanor "keanor (1 commits)")[![sidcomua](https://avatars.githubusercontent.com/u/13542815?v=4)](https://github.com/sidcomua "sidcomua (1 commits)")

---

Tags

phpanticaptcharucaptchaanti-captchaantigate

### Embed Badge

![Health badge](/badges/batrox-php-anticaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/batrox-php-anticaptcha/health.svg)](https://phpackages.com/packages/batrox-php-anticaptcha)
```

###  Alternatives

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
