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
Metadata
Release files for nslsolver 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nslsolver-1.1.1.tar.gz | 9.7 kB | Without provenance | Details for nslsolver-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nslsolver-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for nslsolver-1.1.1-py3-none-any.whl |
Total release size: 21.3 kB
Release files / nslsolver-1.1.1.tar.gz
| Download URL | nslsolver-1.1.1.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
758c522a6854aca20a2f9d370566978ccecc3d9e430b4ae0fb006d2dfaeab2fb
|
|
BLAKE2b-256 checksum How to use checksums |
76e93b4067e4dd83723f9aebbc1ce721273c977379e9623a7e6a0e93ce2f631b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / nslsolver-1.1.1-py3-none-any.whl
| Download URL | nslsolver-1.1.1-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
030c9e2d9d972c1132cbcea4a59c0d7e3a051a66e0a87caee9b4c53b62b09e9c
|
|
BLAKE2b-256 checksum How to use checksums |
30b203f61488555d3449280b628a9f255e1cf1f83879f617880af15d21be6c1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for nslsolver 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.