SurSolver

How to solve Friendly Captcha

Friendly Captcha runs a proof-of-work puzzle in the visitor browser and returns a token. Here is how to find its sitekey, tell v1 from v2 and submit the token.

Updated

$0.65 / 1K tasksCharged when a task is accepted

On this page

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 Friendly Captcha v2 widget inside the signup form on friendlycaptcha.com/demo, in its verifying state with the form fields around it

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 Friendly Captcha widget div with its data-sitekey attribute, selected in the DevTools Elements panel on the official friendly-challenge 0.9.17 demo page

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.

The frc-captcha-solution hidden input selected in the DevTools Elements panel on the official friendly-challenge 0.9.17 demo page, its value attribute holding the solved 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.

quickstart.ts
npm install sursolver
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);

The Friendly Captcha solver API guide walks through recognising the widget generation and the same submit flow.

FAQ

How do I solve Friendly Captcha automatically?

Send the page URL, sitekey (the widget's data-sitekey) and widget script URL as scriptUrl to createTask, poll for the result, and put the returned token into the field the widget would have filled. Block the widget script on that page, otherwise the token is likely to be rejected.

Where is the Friendly Captcha sitekey?

In the data-sitekey attribute of the widget element. On v1 you can also see it in the sitekey parameter of the puzzle request in the Network tab.

Why is my Friendly Captcha token rejected?

The most common cause is a widget script that is still loaded on the page when you inject the token. The second is a token placed in the wrong field for the widget version: v1 uses frc-captcha-solution, v2 uses frc-captcha-response. Check data-solution-field-name too, since a site can rename the field.

What is the difference between v1 and v2?

They load different script files and use different token fields. v1 loads widget.module.min.js or widget.min.js and uses the field frc-captcha-solution; v2 loads site.min.js and uses frc-captcha-response. Check the Network tab to see which one the page loads.

Do I need a proxy for Friendly Captcha?

Not by default. Start with the proxyless task name. Use the proxy task name with your own proxy only if the site refuses tokens that were solved without one.