CAPTCHA

View as Markdown

BCTRL can detect and solve captchas on the current page. Supported captcha types include reCAPTCHA v2/v3, Cloudflare Turnstile, hCaptcha, GeeTest, Arkose, and more.

Access via runtime.captcha.

Supported types

TypeID
reCAPTCHA v2recaptcha_v2
reCAPTCHA v3recaptcha_v3
Cloudflare Turnstileturnstile
hCaptchahcaptcha
GeeTest v3geetest_v3
GeeTest v4geetest_v4
Arkose Labsarkose
MTCaptchamtcaptcha
Leminlemin
Friendly Captchafriendly_captcha
DataDomedatadome

captcha.detect(options?)

Scan the page for captcha widgets. Detection checks the DOM, loaded scripts, and network requests.

1const result = await runtime.captcha.detect();
2
3if (result.found) {
4 for (const captcha of result.captchas) {
5 console.log(captcha.type, captcha.siteKey, captcha.source);
6 }
7}
ParameterTypeRequiredDescription
typesCaptchaType[]NoOnly detect these specific captcha types

Returns CaptchaDetectResult

FieldTypeDescription
foundbooleanWhether any captchas were detected
captchasCaptchaDetection[]Array of detected captchas
captchas[].typeCaptchaTypeThe captcha type
captchas[].siteKeystringThe site key (if found)
captchas[].source'dom' | 'script' | 'network'How the captcha was detected

captcha.solve(options?)

Detect and solve a captcha, then inject the solution token into the page.

1const result = await runtime.captcha.solve();
2
3if (result.success) {
4 console.log(`Solved ${result.type} in ${result.duration}ms`);
5}
ParameterTypeRequiredDescription
typeCaptchaTypeNoSolve a specific captcha type (auto-detects if omitted)

Returns CaptchaSolveResult

FieldTypeDescription
successbooleanWhether the captcha was solved
typeCaptchaTypeThe captcha type that was solved
tokenstringThe solution token
durationnumberTime to solve in milliseconds
errorstringError message if solving failed

Auto-solve on launch

Enable automatic captcha solving when launching a runtime:

1const runtime = await workspace.runtimes.browser("main").playwright({
2 mode: "ephemeral",
3 config: {
4 solveCaptchas: true,
5 },
6});

When solveCaptchas is enabled, captchas are detected and solved automatically as they appear — no manual calls needed.

Example: detect then solve

1// Navigate to a page with a captcha
2await runtime.page.goto("https://example.com/login");
3
4// Check what's on the page
5const detection = await runtime.captcha.detect();
6console.log(`Found ${detection.captchas.length} captcha(s)`);
7
8// Solve it
9const result = await runtime.captcha.solve();
10if (result.success) {
11 // Captcha token is injected — now submit the form
12 await runtime.page.locator("#submit").click();
13}