PHPackages                             nslsolver/nslsolver - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. nslsolver/nslsolver

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

nslsolver/nslsolver
===================

Official PHP SDK for the NSLSolver captcha solving API (Turnstile, Challenge, Kasada, Akamai, reCAPTCHA v3)

1.1.0(1mo ago)00MITPHPPHP &gt;=8.1

Since Jun 12Pushed 1mo agoCompare

[ Source](https://github.com/NSLSolver/NSLSolver-SDK-PHP)[ Packagist](https://packagist.org/packages/nslsolver/nslsolver)[ RSS](/packages/nslsolver-nslsolver/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

NSLSolver PHP SDK
=================

[](#nslsolver-php-sdk)

PHP client for the [NSLSolver](https://nslsolver.com) captcha solving API. Handles Cloudflare Turnstile, Cloudflare Challenge, Kasada, Akamai Bot Manager, and reCAPTCHA v3 (incl. Enterprise).

Requires PHP 8.1+. Current version: **1.1.0**.

Install
-------

[](#install)

```
composer require nslsolver/nslsolver
```

Usage
-----

[](#usage)

```
use NSLSolver\NSLSolver;

$solver = new NSLSolver('your-api-key');

// Turnstile
$result = $solver->solveTurnstile([
    'site_key' => '0x4AAAAAAAB...',
    'url'      => 'https://example.com',
]);
echo $result->token, ' cost=$', $result->cost;

// Challenge (proxy required)
$result = $solver->solveChallenge([
    'url'   => 'https://example.com/protected',
    'proxy' => 'http://user:pass@host:port',
]);
echo $result->cookies['cf_clearance'];
echo $result->userAgent;

// Kasada
$result = $solver->solveKasada([
    'url'        => 'https://example.com/api',
    'user_agent' => 'Mozilla/5.0 ... Chrome/131.0.0.0 ...',
    'ua_version' => 131,
    'kasada_config' => [
        // fp_host / tl_host are bare hostnames (no scheme, no path).
        'p_js_path' => '/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/p.js',
        'fp_host'   => 'passport.twitch.tv',
        'tl_host'   => 'gql.twitch.tv',
    ],
]);
echo $result->headers['x-kpsdk-ct'];
echo $result->headers['x-kpsdk-cd'];

// Akamai (url, user_agent, and proxy all required)
$result = $solver->solveAkamai([
    'url'        => 'https://example.com',
    'user_agent' => 'Mozilla/5.0 ... Chrome/131.0.0.0 ...',
    'proxy'      => 'http://user:pass@host:port',
]);
echo $result->abck();              // the _abck cookie
echo $result->cookies['_abck'];    // same value, raw cookie jar

// reCAPTCHA v3 (site_key, url, and proxy all required)
$result = $solver->solveRecaptchaV3([
    'site_key'   => '6Lc_aCMTAAAAA...',
    'url'        => 'https://example.com',
    'proxy'      => 'http://user:pass@host:port',
    'action'     => 'login',  // optional, server defaults to "verify"
    'enterprise' => true,     // optional, only for reCAPTCHA Enterprise
]);
echo $result->token, ' cost=$', $result->cost;

// Balance
$balance = $solver->getBalance();
echo $balance->balance;       // 42.50
echo $balance->maxCpm;        // 600
echo $balance->currentCpm;    // 12  (tokens consumed in the rolling minute)
echo $balance->cpmLimit;      // 600 (mirror of maxCpm)
echo $balance->unlimited ? 'unlimited' : 'metered';
```

### Options

[](#options)

```
$solver = new NSLSolver('your-api-key', [
    'base_url'    => 'https://api.nslsolver.com', // default
    'timeout'     => 120,                          // seconds, default
    'max_retries' => 3,                            // retries on 429/503, default
]);
```

Both `solveTurnstile` and `solveChallenge` accept optional `user_agent` and `proxy` params. Turnstile also supports `action` and `cdata`. `solveKasada` accepts an optional `proxy` and an optional `cd_constant` inside `kasada_config`. `solveRecaptchaV3` requires `site_key`, `url`, and `proxy`, and accepts optional `action` (server defaults to `"verify"`), `enterprise` (set `true` for reCAPTCHA Enterprise), and `user_agent`.

Error Handling
--------------

[](#error-handling)

All exceptions extend `NSLSolverException`. Catch specific ones or the base class:

```
use NSLSolver\Exceptions\AuthenticationException;
use NSLSolver\Exceptions\InsufficientBalanceException;
use NSLSolver\Exceptions\RateLimitException;
use NSLSolver\Exceptions\SolveException;
use NSLSolver\Exceptions\NSLSolverException;

try {
    $result = $solver->solveTurnstile([...]);
} catch (AuthenticationException $e) {
    // bad api key (401)
} catch (InsufficientBalanceException $e) {
    // need to top up (402)
} catch (RateLimitException $e) {
    // 429, thrown after retries exhausted
} catch (SolveException $e) {
    // 400 or 503
} catch (NSLSolverException $e) {
    // catch-all -- $e->response has the raw API body
}
```

Requests that get 429 or 503 are retried automatically with exponential backoff (up to `max_retries`). Errors 400/401/402/403 fail immediately.

Documentation
-------------

[](#documentation)

For more information, check out the full documentation at

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

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

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/263619131?v=4)[NSLSolver](/maintainers/NSLSolver)[@NSLSolver](https://github.com/NSLSolver)

---

Top Contributors

[![catcha8](https://avatars.githubusercontent.com/u/89837052?v=4)](https://github.com/catcha8 "catcha8 (3 commits)")

---

Tags

recaptchacaptchacloudflareakamaisolverturnstilekasadanslsolver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nslsolver-nslsolver/health.svg)

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

###  Alternatives

[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k9.0M34](/packages/anhskohbo-no-captcha)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2701.9M2](/packages/josiasmontag-laravel-recaptchav3)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[laragear/turnstile

Use Cloudflare's no-CAPTCHA with HTTP/3 in your Laravel application.

708.7k](/packages/laragear-turnstile)[andkab/php-turnstile

API Implementation of CloudFlare Turnstile for PHP

118.8k](/packages/andkab-php-turnstile)

PHPackages © 2026

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