What is Friendly Captcha and how to recognise it
Friendly Captcha is a privacy-oriented bot check. The visitor's browser solves a cryptographic proof-of-work puzzle in the background, so there is no image to pick and no checkbox to tick. It ships as an embeddable widget: an element with a data-sitekey attribute plus loader scripts.

The widget exists in two generations, v1 and v2. They load different script files and return different token shapes, which matters when you place the token. The scripts the page loads tell them apart.
What you get from a solve is always a token string that is posted back with the protected form. There is no image or challenge payload to relay.
How to find the sitekey
Open DevTools, go to the Elements panel and search for data-sitekey. The widget element carries the sitekey there. On v1 you can also filter the Network tab for puzzle?sitekey= and read the sitekey from that request; on v2 search the page source or the network traffic for sitekey.

The page URL is the full address of the page that hosts the widget, including the exact path of the form. Send the widget's full script URL as the required scriptUrl, copied from the page source or Network tab. widget.module.min.js or widget.min.js identifies v1, and site.min.js identifies v2, so no separate version field is needed. The sitekey, page URL and scriptUrl are required.
Where the token goes
Put the token in the hidden input the widget would have filled, then submit the form. On v1 the field is named frc-captcha-solution; on v2 it is frc-captcha-response. If the widget element sets data-solution-field-name, use that name instead. If it defines data-callback, call that function with the token.

Order matters. The widget script must not be loaded on the page when you inject the token. In Playwright, abort the request for the widget module script before you open the page, set the field, and submit. A token injected while the widget script is running is likely to be rejected. A plain HTTP client works the same way when you post the form yourself and the widget never loads.
Common mistakes
The biggest one is leaving the widget script loaded. Abort the script request first, then inject the token; with the widget running, the token is likely to be rejected.
The second is putting a v1 token into the v2 field, or the other way round. Work out the version from the script URL or the x-frc-client header before you decide on the field. Third, check data-solution-field-name and data-callback before assuming the default names; a custom field name is easy to miss and looks exactly like a rejected token.
Last, do not reach for a proxy first. Try the proxyless task name, and use your own proxy only if the site refuses the tokens that came back without one.
Solve it with SurSolver
Send the page URL, sitekey, widget scriptUrl and your browser userAgent to createTask with the task type FriendlyCaptchaTokenProxyLess, or FriendlyCaptchaToken when you want to solve through your own proxy. Then poll getTaskResult until the status is ready; the solution carries the token. 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. The Playwright tab opens the live page with the widget script blocked, reads the sitekey from the widget element, solves the task, writes the token into the field the widget would have filled and submits the form — the same abort-first order the token placement section describes.
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.FriendlyCaptchaTokenProxyLess,
websiteURL: 'https://example.com/login',
websiteKey: 'FC...',
scriptUrl: 'https://example.com/script.js',
userAgent: USER_AGENT,
});
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.FriendlyCaptchaTokenProxyLess,
"websiteURL": "https://example.com/login",
"websiteKey": "FC...",
"scriptUrl": "https://example.com/script.js",
"userAgent": USER_AGENT,
}
)
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.TaskTypeFriendlyCaptchaTokenProxyLess,
"websiteURL": "https://example.com/login",
"websiteKey": "FC...",
"scriptUrl": "https://example.com/script.js",
"userAgent": UserAgent,
})
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::FRIENDLY_CAPTCHA_TOKEN_PROXY_LESS,
"websiteURL": "https://example.com/login",
"websiteKey": "FC...",
"scriptUrl": "https://example.com/script.js",
"userAgent": USER_AGENT,
}))
.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::FRIENDLY_CAPTCHA_TOKEN_PROXY_LESS,
'websiteURL' => 'https://example.com/login',
'websiteKey' => 'FC...',
'scriptUrl' => 'https://example.com/script.js',
'userAgent' => USER_AGENT,
]);
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::FRIENDLY_CAPTCHA_TOKEN_PROXY_LESS,
"websiteURL" => "https://example.com/login",
"websiteKey" => "FC...",
"scriptUrl" => "https://example.com/script.js",
"userAgent" => USER_AGENT
)
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.FriendlyCaptchaTokenProxyLess,
"websiteURL", "https://example.com/login",
"websiteKey", "FC...",
"scriptUrl", "https://example.com/script.js",
"userAgent", USER_AGENT));
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.FriendlyCaptchaTokenProxyLess,
["websiteURL"] = "https://example.com/login",
["websiteKey"] = "FC...",
["scriptUrl"] = "https://example.com/script.js",
["userAgent"] = UserAgent,
});
Console.WriteLine(result.Solution["token"]);
// friendlycaptcha-playwright.js - solve FriendlyCaptcha on the live page and submit the form
// with the token.
// Install: npm install playwright && npx playwright install chromium
// Run: node friendlycaptcha-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: data-sitekey on the .frc-captcha element.
const SITE_KEY = '';
// Optional, read from the page when empty: the widget script URL (widget.min.js or
// widget.module.min.js for v1, site.min.js for v2).
const SCRIPT_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(
() =>
!!document.querySelector('.frc-captcha[data-sitekey]')?.dataset.sitekey,
undefined,
{ timeout: 10000 },
)
.catch(() => undefined);
const dom = await page.evaluate(() => ({
websiteKey: document.querySelector('.frc-captcha[data-sitekey]')?.dataset.sitekey,
scriptUrl: [...document.scripts]
.map((script) => script.src)
.find((url) => /(widget|site)(\.module|\.compat)?\.min\.js/.test(url)),
}));
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: 'FriendlyCaptchaTokenProxyLess',
websiteURL: found.pageUrl,
websiteKey: need('websiteKey', SITE_KEY || found.websiteKey),
scriptUrl: need('scriptUrl', SCRIPT_URL || found.scriptUrl),
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();
// The widget script must not run again: it would replace the token with its own.
await context.route(
(url) => url.href === (SCRIPT_URL || found.scriptUrl),
(route) => route.abort(),
);
await page.goto(found.pageUrl);
const applied = await page.evaluate(
({ token, scriptUrl }) => {
let filled = false;
for (const name of ['frc-captcha-response', 'frc-captcha-solution']) {
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('.frc-captcha');
const form = anchor?.closest('form') ?? document.forms[0];
if (form) {
const field = document.createElement('input');
field.type = 'hidden';
const legacy = /\/widget(\.module)?\.min\.js/.test(scriptUrl ?? '');
const name = anchor?.dataset.solutionFieldName;
field.name = name ?? (legacy ? 'frc-captcha-solution' : 'frc-captcha-response');
field.value = token;
form.append(field);
filled = true;
}
}
const callback = document.querySelector('.frc-captcha')?.dataset.callback;
if (callback && typeof window[callback] === 'function') {
window[callback](token);
filled = true;
}
return filled;
},
{ token: solution.token, scriptUrl: SCRIPT_URL || found.scriptUrl },
);
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;
});
The Friendly Captcha solver API guide walks through recognising the widget generation and the same submit flow.