🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

nslsolver

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nslsolver

Official Python SDK for the NSLSolver captcha solving API

pipPyPI
Version
1.1.1
Weekly downloads
152
744.44%
Maintainers
1
Weekly downloads
 

NSLSolver Python SDK

Python SDK for the NSLSolver captcha solving API.

Installation

pip install nslsolver

# async support
pip install nslsolver[async]

Quick Start

from nslsolver import NSLSolver

solver = NSLSolver("your-api-key")

# Turnstile
result = solver.solve_turnstile(
    site_key="0x4AAAAAAAB...",
    url="https://example.com",
)
print(result.token)

# Cloudflare challenge (proxy required)
result = solver.solve_challenge(
    url="https://example.com/protected",
    proxy="http://user:pass@host:port",
)
print(result.cookies, result.user_agent)

# Kasada
from nslsolver import KasadaConfig

result = solver.solve_kasada(
    url="https://example.com/api",
    user_agent="Mozilla/5.0 ...",
    ua_version=131,
    kasada_config=KasadaConfig(
        p_js_path="/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/p.js",
        fp_host="https://fp.example.com",
        tl_host="https://tl.example.com",
    ),
)
print(result.headers)
print(result.ct, result.cd)

# Akamai Bot Manager (user_agent + proxy required)
result = solver.solve_akamai(
    url="https://www.example.com",
    user_agent="Mozilla/5.0 ...",
    proxy="http://user:pass@host:port",
)
print(result.abck)  # the _abck cookie

# reCAPTCHA v3 / Enterprise (site_key + url + proxy required)
result = solver.solve_recaptchav3(
    site_key="6Lc...",
    url="https://example.com/login",
    proxy="http://user:pass@host:port",
    action="login",       # optional; defaults to "verify"
    enterprise=False,     # set True for reCAPTCHA Enterprise
)
print(result.token, result.action)

# Balance
balance = solver.get_balance()
print(f"Balance: {balance.balance} {balance.currency}")

Async

import asyncio
from nslsolver import AsyncNSLSolver

async def main():
    async with AsyncNSLSolver("your-api-key") as solver:
        result = await solver.solve_turnstile(
            site_key="0x4AAAAAAAB...",
            url="https://example.com",
        )
        print(result.token)

asyncio.run(main())

Error Handling

from nslsolver import (
    NSLSolver,
    AuthenticationError,
    InsufficientBalanceError,
    RateLimitError,
    SolveError,
    NSLSolverError,
)

solver = NSLSolver("your-api-key")

try:
    result = solver.solve_turnstile(
        site_key="0x4AAAAAAAB...",
        url="https://example.com",
    )
except AuthenticationError:
    print("Bad API key.")
except InsufficientBalanceError:
    print("Top up your balance.")
except RateLimitError:
    print("Rate limited after all retries.")
except SolveError as e:
    print(f"Solve failed: {e.message}")
except NSLSolverError as e:
    print(f"API error (HTTP {e.status_code}): {e.message}")

Rate-limit (429) and backend (503) errors are retried automatically with exponential backoff before raising.

Configuration

solver = NSLSolver(
    api_key="your-api-key",
    base_url="https://api.nslsolver.com",  # default
    timeout=120,       # seconds (default: 120)
    max_retries=3,     # retries for 429/503 (default: 3)
)

Both clients support context managers (with / async with) for session cleanup.

Requirements

  • Python 3.8+
  • requests (sync client)
  • aiohttp (async client, optional)

Documentation

For more information, check out the full documentation at https://docs.nslsolver.com

License

MIT

Keywords

captcha

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts