SurSolver

BlogProsopo Procaptcha Solver API: SS58 Site Key, Token and Session Checks

Prosopo Procaptcha Solver API: SS58 Site Key, Token and Session Checks

· Updated · 6 min read

Prosopo Procaptcha is built to replace reCAPTCHA without handing visitor data to an ad network, and it ships as a drop-in widget: one script, one container, one hidden response field. Integrating a solver is therefore short. The questions that cost time are about the key and the session: where the SS58 site key lives, whether a token from outside the page's own session will verify, and whether the proxyless task is enough. This guide answers them and shows the full request, the field to fill, and the checks to run when a token verifies as false.

How Procaptcha decides how much to ask

Procaptcha works in tiers and picks one per visitor.

  1. Frictionless. A visitor with a low risk profile is verified in the background, with no puzzle, and the widget calls its callback with a token.
  2. Proof of work. The browser solves a small computation that makes mass automation more expensive.
  3. Image selection. A suspicious visitor is shown a grid and a target, for example "select all the images that contain ...", across one or more rounds.

ProsopoTokenProxyLess and ProsopoToken handle the frictionless pass and the image-selection challenge, and return the token the widget hands to its callback. The site's server later verifies that token with Prosopo using its own secret key.

Recognise Procaptcha

Two signs identify the widget, and either is enough:

  • A container element with the procaptcha class and a data-sitekey attribute.
  • A script loaded from js.prosopo.io/js/procaptcha.bundle.js.

A page can also render the widget from JavaScript. In that case the script calls procaptcha.render(...) and passes the key as its siteKey option, together with a callback function that receives the token.

Find the Procaptcha site key

Procaptcha keys are SS58 addresses. They are 47 or 48 characters long, written in base58, and always begin with 5. That shape is a quick sanity check on whatever you copied.

To find the key:

  1. Open the page, press F12 and search the Elements panel for data-sitekey. The procaptcha container carries it.
  2. If nothing matches, search the page scripts for siteKey and read the argument of the procaptcha.render(...) call.
  3. As a cross-check, reload with the Network panel open and look for requests to prosopo.io. They carry the key, and some pages also send it in a Prosopo-Site-Key request header.

Take the key from the page you are going to submit to. Every widget has its own key and secret pair, so a key copied from another site yields a token that this site rejects. A malformed key is refused before charging with websiteKey must be an SS58 address starting with 5.

Create the task

Send websiteURL, websiteKey and a supported userAgent:

snippet.json
{
  "clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "task": {
    "type": "ProsopoTokenProxyLess",
    "websiteURL": "https://example.com/signup",
    "websiteKey": "5C7bfXYwachNuvmHHusQNx4sPwiyL7AtSN5jB4CVz1Q4Wsvz",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
  }
}

The example key is a placeholder with the right shape. Use the real key from your page.

Poll getTaskResult every 3 seconds. A frictionless pass finishes quickly; an image challenge takes longer because each round has to be read and answered.

snippet.json
{
  "errorId": 0,
  "status": "ready",
  "solution": { "token": "the verified Procaptcha token" }
}

No userAgent comes back. Keep the one you sent and use it for the submit request.

ProxyLess or your own proxy

Start with ProsopoTokenProxyLess: it solves from SurSolver's network and needs no proxy details.

Switch to ProsopoToken and send proxy when a valid-looking token is rejected while the same flow passes in a browser. Some sites check that the IP that solved the widget is the IP that submits the token, and a proxyless token fails that check. With your own proxy, solve and submit through the same sticky session.

Submit procaptcha-response

The token belongs in the form field named procaptcha-response, posted with the rest of the form:

prosopo-python.py
# prosopo-python.py - solve Prosopo Procaptcha and post the token with the form.
# Install: pip install requests
# Run: python prosopo-python.py

import time
from urllib.parse import urlsplit

import requests


# Your SurSolver API key.
CLIENT_KEY = "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# The page that renders the widget, with its path and query string.
TARGET_URL = "https://example.com/page"
# The SS58 key in .procaptcha[data-sitekey] or procaptcha.render({siteKey}).
SITE_KEY = "YOUR_SITE_KEY"
# The User-Agent the solve runs with; send the result with this same user agent.
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
# Current application session as a Cookie header value; used on form submission.
SESSION_COOKIES = None
# Where the page posts the form (the form action, or the request in DevTools, Network).
FORM_URL = "https://example.com/submit"
# The form's other fields as a JSON object, such as {"username": "demo"}.
FORM_FIELDS = None
# Text that appears only in a response the site accepted.
SUCCESS_TEXT = "PASTE_ACCEPTED_MARKER"


API = "https://api.sursolver.com"
POLL_ATTEMPTS = 60


def call(path, body):
    # API errors are HTTP 200 with errorId 1; anything else is a transport failure.
    response = requests.post(f"{API}{path}", json=body, timeout=30)
    response.raise_for_status()
    data = response.json()
    if data["errorId"] != 0:
        raise RuntimeError(f'{data["errorCode"]}: {data["errorDescription"]}')
    return data


def solve(task):
    created = call("/createTask", {"clientKey": CLIENT_KEY, "task": task})
    for _ in range(POLL_ATTEMPTS):
        result = call("/getTaskResult", {"clientKey": CLIENT_KEY, "taskId": created["taskId"]})
        if result["status"] == "ready":
            return result["solution"]
        time.sleep(3)
    raise TimeoutError(f'task {created["taskId"]} was not ready in {POLL_ATTEMPTS} polls')


def main():
    session = requests.Session()
    if SESSION_COOKIES:
        for part in SESSION_COOKIES.split(";"):
            if "=" in part:
                name, value = part.strip().split("=", 1)
                session.cookies.set(name, value, domain=urlsplit(FORM_URL).hostname, path="/")
    solution = solve({
        "type": "ProsopoTokenProxyLess",
        "websiteURL": TARGET_URL,
        "websiteKey": SITE_KEY,
        "userAgent": USER_AGENT,
    })

    # The solve ran with USER_AGENT; the submit presents the same one.
    headers = {"User-Agent": USER_AGENT}
    # Send the token the way the page does; some sites name it differently or send JSON.
    response = session.post(
        FORM_URL,
        data={**(FORM_FIELDS or {}), "procaptcha-response": solution["token"]},
        headers=headers,
        timeout=30,
    )
    session.close()
    if not response.ok or SUCCESS_TEXT not in response.text:
        raise SystemExit(f"The site did not accept the result (HTTP {response.status_code}).")
    print("The site accepted the result.")


if __name__ == "__main__":
    main()

When the page does not post a plain form, call the callback the page passed to procaptcha.render(...) with the token, or set the field with page.evaluate() in a browser run and then click the real submit button. Tokens are short-lived: solve with the request you are about to make and submit immediately.

Why a Procaptcha token verifies as false

Symptom Likely cause Fix
Rejected after a delay The token sat unused for too long Create the task right before the submit and post immediately
Rejected from the first try The key came from another site Read data-sitekey from the exact page you submit to
Valid token, rejected by the site The site validates the solving IP Use ProsopoToken with a sticky proxy and submit through it
Rejected even from a clean IP The site ties each token to a session id rendered in its own widget A token minted outside that session cannot pass; there is no input that changes this
ERROR_INVALID_REQUEST Malformed key Re-copy it; it must begin with 5
ERROR_FAILED The widget or its provider could not complete Retry on a new proxy session; the charge is refunded once

The session-bound case deserves a note. Procaptcha can issue each token against a session id that the site renders into its own widget. A token created outside that page's session verifies as false even when everything else is right, and that is a property of the site's configuration, not of the solving task.

Checklist

  1. Read the SS58 key from data-sitekey or the procaptcha.render(...) call on the page you will submit to.
  2. Start with ProsopoTokenProxyLess; move to ProsopoToken with a sticky proxy when the site validates the IP.
  3. Poll every 3 seconds and never duplicate a task that is still processing.
  4. Submit solution.token as procaptcha-response immediately, using the task's userAgent.

The Prosopo solver page lists the fields at a glance, and the API reference has the schemas. To compare with other widgets, read How to identify any captcha and extract its parameters.

Current input and replay contract

Use the complete SS58 websiteKey, the actual widget page and a supported userAgent. The verified callback token is solution.token; submit it as procaptcha-response or through the callback the application registered. An image classification is not itself the verified token.

The native flow handles frictionless and supported image-selection paths; unsupported challenges fail rather than producing a guessed credential. A shared proxy can align the solving and submitting IPs, but it cannot copy a session ID that this task does not accept. Session-bound applications therefore need verification against their actual integration before a ready token is treated as accepted. See the complete Prosopo example and session boundaries.

More articles