What is Altcha and how to recognise it
Altcha is a privacy-first, self-hostable bot-protection widget. Instead of an image puzzle it asks the browser to run a silent proof-of-work computation in a Web Worker, then posts the result as a JSON payload. In the default flow there is nothing for the visitor to click.

The widget is a web component, <altcha-widget>, and its result lands in a hidden form field named altcha unless the site renamed it. The server issues a fresh challenge with an algorithm, a challenge, a salt and a signature; the browser searches for a number that satisfies it; the server checks it with one cheap verification. That is why a solve is a computation, not recognition.
Some sites running Altcha Cloud or Sentinel can escalate suspicious traffic to an interactive text or audio code challenge. A proof-of-work result does not satisfy that step, so the clean fit is a site that uses only the proof-of-work widget.
How to find the challenge URL and JSON
Altcha has no sitekey. What the task needs is the page URL plus the challenge URL, and optionally the challenge JSON itself when you already captured it. Because the input is only that challenge, a server-side job works the same way as a browser script when the challenge endpoint can be called directly.
In DevTools, open the Elements panel and look for <altcha-widget>. Its challengeurl attribute, or its challenge attribute when that holds an address, is where the widget gets the challenge from. Then open the Network tab and find that request. The endpoint differs from site to site, and some include a sitekey or apiKey query value that belongs to the URL, not to a separate key.

The response body is the challenge JSON, with algorithm, challenge, salt and signature, and usually a maximum number. Copy it exactly as received. The algorithm matters for solve time: memory-hard ones such as Argon2id and Scrypt are heavier than the default.
Where the token goes
The solution has a single key, token. Put it into the hidden input the widget manages, named altcha by default. Confirm the name in the Elements panel, because the widget's name attribute can change it, and some sites expect an altcha cookie instead. Then submit the form as usual.

Submit the full token, not only the number inside it, unless the receiving server demonstrably accepts the bare number; servers differ, so test both if the first attempt is refused. In a browser-automation script, fill the field with page.fill() or the DOM equivalent and submit straight away.
Common mistakes
The commonest failure is a stale challenge. Challenges are fresh and single-use, and they carry an expiry, so capture one right before you create the task and never retry with the same one after a rejection.
The second is changing the data in transit: pass the challenge JSON through exactly as the endpoint returned it. The third is expecting a proof-of-work result to clear an interactive code challenge. If a site escalates, no number will pass that step.
Do not look for a sitekey that does not exist, and do not assume the field is called altcha without checking. Expect slower results on sites that use the memory-hard algorithms.
Solve it with SurSolver
Send the page URL, the challenge URL (and the challenge JSON when you hold it) and your browser userAgent to createTask with the task type AltchaTokenProxyLess (or AltchaToken), then poll getTaskResult until the status is ready. The solution's token key is what you place in the altcha field. The accepted names and parameters are listed by the public catalog (GET /v1/task-types).
Examples in your language
The official client wraps createTask and polling in one solve call; each language tab is its Quick start with this captcha's request, and prints the solved token, which goes in the altcha field. challengeURL must be a public https endpoint; add challengeJSON when you captured the response and want that exact challenge solved. The Playwright tab runs the whole flow on the live page: it reads the challenge URL from the widget, solves, fills the field and submits the form.
import { SurSolver, TaskType } from 'sursolver';
const API_KEY = 'YOUR_API_KEY';
const 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';
const client = new SurSolver(API_KEY);
const { solution } = await client.solve({
type: TaskType.AltchaTokenProxyLess,
websiteURL: 'https://example.com/login',
userAgent: USER_AGENT,
challengeURL: 'https://example.com/challenge',
});
console.log(solution.token);
from sursolver import SurSolver, TaskType
API_KEY = "YOUR_API_KEY"
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"
)
client = SurSolver(API_KEY)
result = client.solve(
{
"type": TaskType.AltchaTokenProxyLess,
"websiteURL": "https://example.com/login",
"userAgent": USER_AGENT,
"challengeURL": "https://example.com/challenge",
}
)
print(result.solution["token"])
package main
import (
"context"
"fmt"
"log"
sursolver "github.com/sursolver/sursolver-go"
)
const (
APIKey = "YOUR_API_KEY"
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
)
func main() {
client, err := sursolver.New(APIKey)
if err != nil {
log.Fatal(err)
}
result, err := client.Solve(context.Background(), sursolver.Task{
"type": sursolver.TaskTypeAltchaTokenProxyLess,
"websiteURL": "https://example.com/login",
"userAgent": UserAgent,
"challengeURL": "https://example.com/challenge",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Solution["token"])
}
use serde_json::json;
use sursolver::{Client, task_types};
const API_KEY: &str = "YOUR_API_KEY";
const USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36";
#[tokio::main]
async fn main() -> Result<(), sursolver::Error> {
let client = Client::new(API_KEY)?;
let result = client
.solve(&json!({
"type": task_types::ALTCHA_TOKEN_PROXY_LESS,
"websiteURL": "https://example.com/login",
"userAgent": USER_AGENT,
"challengeURL": "https://example.com/challenge",
}))
.await?;
println!("{}", result.solution["token"]);
Ok(())
}
<?php
require __DIR__ . '/vendor/autoload.php';
use SurSolver\Client;
use SurSolver\TaskTypes;
const API_KEY = 'YOUR_API_KEY';
const 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';
$client = new Client(API_KEY);
$result = $client->solve([
'type' => TaskTypes::ALTCHA_TOKEN_PROXY_LESS,
'websiteURL' => 'https://example.com/login',
'userAgent' => USER_AGENT,
'challengeURL' => 'https://example.com/challenge',
]);
echo $result->solution['token'];
require "sursolver"
API_KEY = "YOUR_API_KEY"
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"
client = SurSolver::Client.new(API_KEY)
result = client.solve(
"type" => SurSolver::TaskTypes::ALTCHA_TOKEN_PROXY_LESS,
"websiteURL" => "https://example.com/login",
"userAgent" => USER_AGENT,
"challengeURL" => "https://example.com/challenge"
)
puts result.solution["token"]
import com.sursolver.SolveResult;
import com.sursolver.SurSolverClient;
import com.sursolver.TaskTypes;
import java.util.Map;
public class QuickStart {
static final String API_KEY = "YOUR_API_KEY";
static final String 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";
public static void main(String[] args) throws InterruptedException {
SurSolverClient client = SurSolverClient.create(API_KEY);
SolveResult result = client.solve(Map.of(
"type", TaskTypes.AltchaTokenProxyLess,
"websiteURL", "https://example.com/login",
"userAgent", USER_AGENT,
"challengeURL", "https://example.com/challenge"));
System.out.println(result.solution().get("token"));
}
}
using System.Text.Json.Nodes;
using SurSolver;
const string ApiKey = "YOUR_API_KEY";
const string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36";
var client = new SurSolverClient(ApiKey);
var result = await client.SolveAsync(new JsonObject
{
["type"] = TaskTypes.AltchaTokenProxyLess,
["websiteURL"] = "https://example.com/login",
["userAgent"] = UserAgent,
["challengeURL"] = "https://example.com/challenge",
});
Console.WriteLine(result.Solution["token"]);
// altcha-playwright.js - solve Altcha on the live page and submit the form with the token.
// Install: npm install playwright && npx playwright install chromium
// Run: node altcha-playwright.js
const { chromium } = require('playwright');
const { setTimeout: sleep } = require('node:timers/promises');
// Your SurSolver API key.
const CLIENT_KEY = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// The page that renders the widget, with its path and query string.
const TARGET_URL = 'https://example.com/page';
// Optional, read from the page when empty: the challengeurl attribute of the <altcha-widget>
// element.
const CHALLENGE_URL = '';
// The User-Agent the solve runs with; send the result with this same user agent.
const 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';
// The control that submits the form.
const SUBMIT_SELECTOR = '.PASTE_SUBMIT_SELECTOR';
// A selector that matches only after the site accepted the result.
const SUCCESS_SELECTOR = '.PASTE_ACCEPTED_SELECTOR';
const API = 'https://api.sursolver.com';
const POLL_ATTEMPTS = 60;
// API errors are HTTP 200 with errorId 1; anything else is a transport failure.
async function call(path, body) {
const res = await fetch(`${API}${path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
if (data.errorId !== 0) throw new Error(`${data.errorCode}: ${data.errorDescription}`);
return data;
}
async function solve(task) {
const created = await call('/createTask', { clientKey: CLIENT_KEY, task });
for (let attempt = 0; attempt < POLL_ATTEMPTS; attempt += 1) {
const result = await call('/getTaskResult', {
clientKey: CLIENT_KEY,
taskId: created.taskId,
});
if (result.status === 'ready') return result.solution;
await sleep(3000);
}
throw new Error(`task ${created.taskId} was not ready in ${POLL_ATTEMPTS} polls`);
}
// Optional task fields are sent only when they have a value.
function withoutEmpty(fields) {
return Object.fromEntries(
Object.entries(fields).filter(([, value]) => value !== undefined && value !== ''),
);
}
// A value the page did not show must be pasted into its constant at the top.
function need(name, value) {
if (value === undefined || value === null || value === '') {
throw new Error(`Could not read ${name} from the page; fill in the ${name} constant.`);
}
return value;
}
// Opens the page once and reads what the solve needs from it.
async function readPage(browser) {
const page = await browser.newPage({ userAgent: USER_AGENT });
try {
await page.goto(TARGET_URL, {
waitUntil: 'domcontentloaded',
timeout: 45000,
});
// The widget is often added after the page loads; give it a moment to appear.
await page
.waitForFunction(
() =>
!!(() => {
const url = document.querySelector('altcha-widget')?.getAttribute('challengeurl');
return url ? new URL(url, location.href).href : undefined;
})(),
undefined,
{ timeout: 10000 },
)
.catch(() => undefined);
const dom = await page.evaluate(() => ({
challengeURL: (() => {
const url = document.querySelector('altcha-widget')?.getAttribute('challengeurl');
return url ? new URL(url, location.href).href : undefined;
})(),
}));
return {
pageUrl: page.url(),
...dom,
};
} finally {
await page.close();
}
}
async function main() {
const browser = await chromium.launch();
try {
const found = await readPage(browser);
const solution = await solve({
type: 'AltchaTokenProxyLess',
websiteURL: found.pageUrl,
challengeURL: need('challengeURL', CHALLENGE_URL || found.challengeURL),
userAgent: USER_AGENT,
});
// Submit from a fresh session with the user agent the solve ran with.
const context = await browser.newContext({ userAgent: USER_AGENT });
const page = await context.newPage();
await page.goto(found.pageUrl);
const applied = await page.evaluate(
({ token }) => {
let filled = false;
for (const name of ['altcha']) {
for (const field of document.querySelectorAll(`[name="${name}"]`)) {
field.value = token;
filled = true;
}
}
if (!filled) {
// The widget script did not run, so the hidden field does not exist yet.
const anchor = document.querySelector('altcha-widget');
const form = anchor?.closest('form') ?? document.forms[0];
if (form) {
const field = document.createElement('input');
field.type = 'hidden';
field.name = anchor?.dataset.solutionFieldName ?? 'altcha';
field.value = token;
form.append(field);
filled = true;
}
}
const callback = null;
if (callback && typeof window[callback] === 'function') {
window[callback](token);
filled = true;
}
return filled;
},
{ token: solution.token },
);
if (!applied) {
throw new Error('The page has no token field or callback; check how it passes the token.');
}
await page.click(SUBMIT_SELECTOR);
await page.locator(SUCCESS_SELECTOR).first().waitFor({ timeout: 15000 });
console.log('The site accepted the token.');
} finally {
await browser.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
For the challenge capture step by step, the Altcha solver API guide walks through the same flow.