Skip to content
solvepass

Python + Solvepass

A minimal requests client for scripts, workers, and data pipelines. Create, poll, and handle failures.

PythonBackend jobs, data pipelines, and quick prototypes.
solvepass-python.pypython
import os
import time
import requests

key = os.environ["SOLVEPASS_KEY"]
headers = {"Authorization": f"Bearer {key}"}

task = requests.post(
    "https://api.solvepass.com/v1/tasks",
    headers=headers,
    json={
        "type": "recaptcha_v3",
        "sitekey": "6Lc...",
        "pageurl": "https://example.com/login",
        "action": "login",
    },
    timeout=30,
).json()

for _ in range(60):
    data = requests.get(
        f"https://api.solvepass.com/v1/tasks/{task['id']}",
        headers=headers,
        timeout=30,
    ).json()

    if data["status"] == "completed":
        print(data["solution"]["token"])
        break
    if data["status"] == "failed":
        raise RuntimeError(data["error"]["code"])
    time.sleep(1)
else:
    raise TimeoutError("task did not finish")

What to check

  • Use an Idempotency-Key header when retrying task creation.
  • Handle 402 insufficient_credits and 429 rate_limited explicitly.
  • Do not log the token or proxy credentials.

The same three steps

  1. 01Create a task with the type, sitekey, and page URL.
  2. 02Poll the task or wait for a signed webhook.
  3. 03Use the token, or apply the clearance cookies with the same proxy and user agent.

Other integrations