SurSolver
Docs menu

Docs / Guides

Quickstart

Send your first captcha task from PowerShell, Playwright, Puppeteer, Selenium or a browser extension — five steps from an API key to a solved captcha.

SurSolver is an HTTP API. You send the page URL and the parameters your code already reads from the page, and you get back the token, cookies or fields the page expects. There is nothing to install — no SDK, no browser extension, no plugin.

Five steps take you from an empty account to a solved captcha. Steps 1, 2, 4 and 5 are the same for everyone; step 3 is the code you paste. Pick the tool you will send with — the link jumps to that tool’s section in step 3:

Step 1: Create an account and an API key

  1. Sign up at sursolver.com. One account holds up to five prepaid keys.
  2. Open Dashboard → API keys and click Create key. Copy the key when it appears: it is shown once and cannot be retrieved later. It looks like sur_…; Change on the same page replaces it with a new one.
  3. Top up the balance from the same dashboard. A task is charged when the API accepts it; Billing & packages explains what that means for failures.

The key travels in the request body as clientKey. The solver endpoints have no auth header, so never put the key in a URL.

Step 2: Know what you are sending

POST /createTask takes one JSON object:

snippet.json
{
  "clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "task": {
    "type": "TurnstileTokenProxyLess",
    "websiteURL": "https://example.com/login",
    "websiteKey": "0x4AAAAAAA...",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
  }
}
  • type picks the solver; the example above solves Cloudflare Turnstile without a proxy.
  • websiteURL is the page the captcha sits on. websiteKey is the site key you can read from that page’s HTML.
  • userAgent is required for every browser captcha: the User-Agent of the browser or HTTP client that will use the result. The solve runs with it, so send every later request with the same one. The result never returns a user agent.
  • Types that must run from your own IP take proxy fields as well — see Proxies.

The public catalog, GET /v1/task-types (no key needed), lists every type, the exact field names it accepts and what its answer carries. The API stores your task object as sent.

Step 3: Send it with your tool

The call is the same everywhere; only the tool that makes it differs. Pick yours from the list at the top of this page — the sections below are in the same order.

REST API

Any language with an HTTP client works. This is the whole call from PowerShell.

  1. Paste your key into the constant at the top so it stays out of your code:

    snippet.powershell
    $clientKey = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
  2. Create the task:

    snippet.powershell
    $task = @{
      clientKey = $clientKey
      task = @{
        type = 'TurnstileTokenProxyLess'
        websiteURL = 'https://example.com/login'
        websiteKey = '0x4AAAAAAA...'
        userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36'
      }
    }
    Invoke-RestMethod -Method Post -Uri 'https://api.sursolver.com/createTask' -ContentType 'application/json' -Body ($task | ConvertTo-Json -Depth 10)
  3. Read taskId from the reply and continue with step 4. The fields your type takes are in GET /v1/task-types.

Playwright

  1. npm install playwright, then submit the task with Playwright’s own request context — no second HTTP library needed:

    solve.js
    const { request } = require('playwright');
    
    const API_KEY = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
    
    // `page` is the page that will submit the token: the solve runs with its user agent.
    async function createTask(page) {
      const api = await request.newContext();
      const res = await api.post('https://api.sursolver.com/createTask', {
        data: {
          clientKey: API_KEY,
          task: {
            type: 'TurnstileTokenProxyLess',
            websiteURL: 'https://example.com/login',
            websiteKey: '0x4AAAAAAA...',
            userAgent: await page.evaluate(() => navigator.userAgent),
          },
        },
      });
      if (!res.ok()) throw new Error(`HTTP ${res.status()}`); // transport failure
      return res.json(); // { errorId, taskId, status }
    }
  2. Once step 4 hands you the token, put it into the page and submit the form:

    solve.js
    await page.evaluate((token) => {
      document.querySelector('input[name="cf-turnstile-response"]').value = token;
    }, solution.token);
  3. Got taskId? Go to step 4. The fields your type takes are in GET /v1/task-types.

Puppeteer

  1. Install Puppeteer and send the task with fetch — Puppeteer drives the browser but has no HTTP client of its own:

    solve.js
    const API_KEY = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
    
    // `page` is the page that will submit the token: the solve runs with its user agent.
    async function createTask(page) {
      const res = await fetch('https://api.sursolver.com/createTask', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          clientKey: API_KEY,
          task: {
            type: 'TurnstileTokenProxyLess',
            websiteURL: 'https://example.com/login',
            websiteKey: '0x4AAAAAAA...',
            userAgent: await page.evaluate(() => navigator.userAgent),
          },
        }),
      });
      if (!res.ok) throw new Error(`HTTP ${res.status}`); // transport failure
      return res.json(); // { errorId, taskId, status }
    }
  2. After step 4, hand the token to the open page:

    solve.js
    await page.evaluate((token) => {
      document.querySelector('input[name="cf-turnstile-response"]').value = token;
    }, solution.token);
  3. Head to step 4 with the taskId; the fields your type takes are in GET /v1/task-types.

Selenium

  1. Send the task from the same Python process that drives the browser — Selenium has no HTTP client of its own, so use requests:

    solve.py
    import requests
    
    API_KEY = "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    
    # The browser that will submit the token: the solve runs with its user agent.
    USER_AGENT = driver.execute_script("return navigator.userAgent")
    created = requests.post(
        "https://api.sursolver.com/createTask",
        json={
            "clientKey": API_KEY,
            "task": {
                "type": "TurnstileTokenProxyLess",
                "websiteURL": "https://example.com/login",
                "websiteKey": "0x4AAAAAAA...",
                "userAgent": USER_AGENT,
        },
        timeout=30,
    )
    created.raise_for_status()  # a non-200 reply is a transport failure
    task_id = created.json()["taskId"]
  2. Once step 4 returns the token, write it into the page:

    solve.py
    driver.execute_script(
        "document.querySelector('input[name=\"cf-turnstile-response\"]').value = arguments[0];",
        solution["token"],
    )
  3. Continue with step 4; the fields your type takes are in GET /v1/task-types.

Browser extension

SurSolver ships no extension — the extension here is yours, and it calls the same API from its background service worker (Manifest V3).

  1. Ask the service worker for a task when the toolbar button is clicked:

    solve.js
    chrome.action.onClicked.addListener(async (tab) => {
      const { apiKey } = await chrome.storage.local.get('apiKey');
      const res = await fetch('https://api.sursolver.com/createTask', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          clientKey: apiKey,
          task: {
            type: 'TurnstileTokenProxyLess',
            websiteURL: tab.url,
            websiteKey: '0x4AAAAAAA...',
            userAgent: navigator.userAgent,
          },
      });
      if (!res.ok) throw new Error(`HTTP ${res.status}`); // transport failure
      const { taskId } = await res.json();
      // Poll getTaskResult (step 4) for that taskId, then inject the token below.
    });

    Reading tab.url needs the "tabs" permission; the injection below needs "scripting" and the key is kept with "storage" — all three go in manifest.json.

  2. After step 4, inject the token into the tab:

    solve.js
    await chrome.scripting.executeScript({
      target: { tabId: tab.id },
      func: (token) => {
        document.querySelector('input[name="cf-turnstile-response"]').value = token;
      },
      args: [solution.token],
    });
  3. Continue with step 4. Keep the key in chrome.storage.local, never in a content script, and remember that a key shipped inside a published extension is readable by everyone who installs it. The fields your type takes are in GET /v1/task-types.

Step 4: Poll for the answer

createTask returns a taskId immediately; the solver works in the background. Ask POST /getTaskResult for that id — with the taskId from step 3:

snippet.powershell
$body = @{ clientKey = $clientKey; taskId = 'tsk_9c1f4e2a7b0d5e3f81a62c47' } | ConvertTo-Json -Depth 10
Invoke-RestMethod -Method Post -Uri 'https://api.sursolver.com/getTaskResult' -ContentType 'application/json' -Body $body

While the solver is working, the answer is:

snippet.json
{"errorId":0,"status":"processing"}

Poll every 3 seconds until status is ready; the solution object then carries what the page expects:

snippet.json
{"errorId":0,"status":"ready","solution":{"token":"0.eUN4b21wbGVfLi4u"}}

Polling is not metered by the rate limits. Replies the API reports itself are HTTP 200: check errorId, and on errorId: 1 stop polling and read errorCode and errorDescription. A non-200 status or a body without errorId is a transport failure — see Errors. Results stay readable for 30 minutes from creation; after that the task answers ERROR_TASK_EXPIRED (see Task lifecycle).

Step 5: Use the solution

solution carries the values the page needs: usually the token for the widget’s hidden response field; for the cookie types the protection’s cookie under its own name (such as cf_clearance, datadome or _abck) and cookies, an object of every returned cookie name and value. Use it with the same userAgent you sent in the task. Keep the solve’s exit IP for IP-bound types such as Cloudflare Challenge, Vercel and Akamai SBSD; Akamai _abck, Kasada and Shape can be replayed from your own IP.

POST /getBalance reports the cash balance of the key’s owner in USD:

snippet.json
{"errorId":0,"balance":9.987}

Complete runnable scripts in PowerShell, Python, Node.js and Playwright are at the bottom of this page, generated from the same source as every task page.

Where to go next

A complete example

Every tab is generated from the same source as the examples in theAPI reference. The PowerShell, Python and Node.js tabs run against https://api.sursolver.com once your key and the fields for your site are in place (GET /v1/task-types lists them); the Playwright tab, where there is one, declares every setting as a constant at the top of the script.

solve.ps1
$api = 'https://api.sursolver.com'
$key = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

# 1/2 Create the task. API errors are HTTP 200 with errorId 1; a thrown request is a transport failure.
$task = @{
  type = 'ReCaptchaV3TokenProxyLess'
  websiteURL = 'https://example.com/login'
  websiteKey = '6Le...'
  userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36'
}
$request = @{ clientKey = $key; task = $task } | ConvertTo-Json -Depth 10
$created = Invoke-RestMethod -Method Post -Uri "$api/createTask" -ContentType 'application/json' -Body $request
if ($created.errorId -ne 0) { Write-Error $created.errorDescription; exit 1 }

# 2/2 Poll getTaskResult until the task is ready (60 tries, 3 s apart).
for ($attempt = 0; $attempt -lt 60; $attempt += 1) {
  $poll = @{ clientKey = $key; taskId = $created.taskId } | ConvertTo-Json -Depth 10
  $result = Invoke-RestMethod -Method Post -Uri "$api/getTaskResult" -ContentType 'application/json' -Body $poll
  if ($result.errorId -ne 0) { Write-Error $result.errorDescription; exit 1 }
  if ($result.status -eq 'ready') { $result.solution; exit 0 }
  Start-Sleep -Seconds 3
}
Write-Error "task $($created.taskId) was not ready after 60 polls"
exit 1