PHPackages                             greezlu/capsolver-php - 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. [API Development](/categories/api)
4. /
5. greezlu/capsolver-php

ActiveLibrary[API Development](/categories/api)

greezlu/capsolver-php
=====================

0.9.4(11mo ago)01.8k2MITPHPPHP &gt;=7.4

Since Oct 28Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/greezlu/capsolver-php)[ Packagist](https://packagist.org/packages/greezlu/capsolver-php)[ RSS](/packages/greezlu-capsolver-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

PHP Client for CapSolver API
============================

[](#php-client-for-capsolver-api)

The simple client for [CapSolver](https://capsolver.com) captcha solving service.

- [Installation](#installation)
    - [Composer](#composer)
- [Configuration](#configuration)
- [Solve captcha](#solve-captcha)
    - [ReCaptcha v3](#recaptcha-v3)
    - [ReCaptcha v2](#recaptcha-v2)
    - [Cloudflare Turnstile](#cloudflare-turnstile)
- [Error handling](#error-handling)

Installation
------------

[](#installation)

This package can be installed via composer.

### Composer

[](#composer)

```
composer require greezlu/capsolver-php

```

Configuration
-------------

[](#configuration)

`CapsolverClient` instance can be created like this:

```
$solver = new \Capsolver\CapsolverClient('YOUR_API_KEY');
```

Solve captcha
-------------

[](#solve-captcha)

Find more information about request and response in the related documentation page.

### ReCaptcha v3

[](#recaptcha-v3)

More in the [documentation.](https://docs.capsolver.com/en/guide/captcha/ReCaptchaV3/)

Request:

```
$solution = $solver->recaptchaV3(
    \Capsolver\Solvers\Token\ReCaptchaV3::TASK,
    [
      'websiteURL'    => 'https://www.google.com/recaptcha/api2/demo',
      'websiteKey'    => '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
      'pageAction'    => 'verify',
      'minScore'      => 0.6,
      'proxy'         => 'http:ip:port:user:pass'
    ]
);
```

Response:

```
$solution = [
    'userAgent' => 'xxx',
    'expireTime' => 1671615324290,
    'gRecaptchaResponse' => '3AHJ...'
];
```

### ReCaptcha v2

[](#recaptcha-v2)

More in the [documentation.](https://docs.capsolver.com/en/guide/captcha/ReCaptchaV2/)

Request:

```
$solution = $solver->recaptchaV2(
    \Capsolver\Solvers\Token\ReCaptchaV2::TASK,
    [
      'websiteURL'    => 'https://www.google.com/recaptcha/api2/demo',
      'websiteKey'    => '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
      'proxy'         => 'http:ip:port:user:pass'
    ]
);
```

Response:

```
$solution = [
    'userAgent' => 'xxx',
    'expireTime' => 1671615324290,
    'gRecaptchaResponse' => '3AHJ...'
];
```

### Cloudflare Turnstile

[](#cloudflare-turnstile)

More in the [documentation](https://docs.capsolver.com/en/guide/captcha/cloudflare_turnstile/).

Request:

```
$solution = $solver->turnsite([
    'websiteURL'    => 'https://www.yourwebsite.com',
    'websiteKey'    => '0x4XXXXXXXXXXXXXXXXX',
    'metadata'      => [
        'action'        => 'login', //optional
        'cdata'         => '0000-1111-2222-3333-example-cdata' //optional
    ]
]);
```

Response:

```
$result = [
    'token'     => "0.mF74FV8wEuf...",
    'type'      => 'turnstile',
    'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)...'
];
```

Error handling
--------------

[](#error-handling)

If case of an error solver throws an instance of `CapsolverException` exception.

```
try {
    $solution = $solver->recaptchaV3('', []);
} catch (\Capsolver\Exceptions\RequestException $error) {
    // Error happened before api request
} catch (\Capsolver\Exceptions\ResponseException $error) {
    // Error happened after api request
} catch (\Capsolver\Exceptions\CapsolverException $error) {
    // General error
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance50

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.4% 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

Every ~145 days

Total

5

Last Release

354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7283f59acdbcae846d7455c971174add8f491ed3b95863a05af9a4a79869fe3e?d=identicon)[greezlu](/maintainers/greezlu)

---

Top Contributors

[![greezlu](https://avatars.githubusercontent.com/u/28956720?v=4)](https://github.com/greezlu "greezlu (17 commits)")[![CODLOP](https://avatars.githubusercontent.com/u/37729402?v=4)](https://github.com/CODLOP "CODLOP (1 commits)")

---

Tags

apicapsolvercaptchacaptcha-solverclientphprecaptcha

### Embed Badge

![Health badge](/badges/greezlu-capsolver-php/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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