NSLSolver
Guides

cURL

One-shot commands for solving captchas and reading balance from the shell, including jq tricks for extracting fields.

Setup

Stash the API key in an env var:

export NSL_API_KEY="your-api-key"

Optionally alias the base URL:

NSL=https://api.nslsolver.com

Solve a Turnstile

curl -X POST $NSL/solve \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NSL_API_KEY" \
  -d '{
    "type": "turnstile",
    "site_key": "0x4AAAAAAA",
    "url": "https://example.com"
  }'

Solve a Cloudflare Challenge

A proxy is required.

curl -X POST $NSL/solve \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NSL_API_KEY" \
  -d '{
    "type": "challenge",
    "url": "https://example.com/protected",
    "proxy": "http://user:[email protected]:8080"
  }'

Solve a Kasada

curl -X POST $NSL/solve \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NSL_API_KEY" \
  -d '{
    "type": "kasada",
    "url": "https://passport.twitch.tv",
    "user_agent": "Mozilla/5.0 ... Chrome/145.0.0.0 Safari/537.36",
    "ua_version": 145,
    "kasada_config": {
      "p_js_path": "/149e9513-.../2d206a39-.../p.js",
      "fp_host": "passport.twitch.tv",
      "tl_host": "gql.twitch.tv"
    }
  }'

Check balance

curl $NSL/balance -H "X-API-Key: $NSL_API_KEY"

Pretty-print with jq

curl -s -X POST $NSL/solve \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NSL_API_KEY" \
  -d '{"type":"turnstile","site_key":"0x4AAAAAAA","url":"https://example.com"}' \
  | jq .

Extract just the token

TOKEN=$(curl -s -X POST $NSL/solve \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NSL_API_KEY" \
  -d '{"type":"turnstile","site_key":"0x4AAAAAAA","url":"https://example.com"}' \
  | jq -r '.token')

echo "$TOKEN"

Tail success/error in one line

jq makes it easy to differentiate success and failure:

curl -s -X POST $NSL/solve \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NSL_API_KEY" \
  -d '{"type":"turnstile","site_key":"0x4AAAAAAA","url":"https://example.com"}' \
  | jq 'if .success then "ok: \(.token[:24])... cost=\(.cost)" else "err: \(.error)" end'

Timeout

The default cURL timeout is generous, but for clarity set one explicitly:

curl --max-time 120 -X POST $NSL/solve ...

Use --max-time 180 for Kasada.

Health check

curl $NSL/healthz   # plain "OK"
curl $NSL/health    # detailed JSON

On this page