Skip to main content
Surfsky exposes CAPTCHA commands through a page-level CDP session. Enable anti_captcha when starting the browser, choose a solver for the challenge, and verify the page state after solving.

Enable solving

Add this to the browser start body:
Use auto_captcha_types to restrict automatic detection to the types your page needs. It does not restrict an explicit manual Captcha.solve request.

Provider configuration

Provider availability depends on your account configuration. reCAPTCHA, GeeTest, and BLS use the external provider integration. Image-to-text requires a configured CapMonster key. PerimeterX, DataDome audio, and FunCaptcha use Gemini. Check solver balance for the providers exposed by your account. A balance response does not verify that every provider key is valid or funded.

Choose a method

Support can vary by challenge version and site configuration. Test on your target page and check that the protected content loads.

Connect and solve

This Python example starts a browser, connects Playwright, and attempts a manual Turnstile solve. Install the packages and set your Surfsky credentials:
Replace TARGET_URL with the page you are testing. Save as solve.py:
Run it:
A successful attempt returns {"status": "success", "type": "turnstile"}. If no challenge is present, manual detection can return a CDP error instead. The final API request stops the browser when the example exits. For JavaScript, start with the Playwright lifecycle, add anti_captcha to its start body, and create the CDP session with await page.context().newCDPSession(page). The command parameters are the same.

Manual solving

Captcha.solve waits for one attempt to finish:
Pass only the options listed in the selected solver’s guide. Solvers may ignore other fields even when the request accepts them. Results include status and type. Statuses include success, failed, timeout, and not_detected; image solving also returns solution on success. Invalid parameters and detection failures may raise CDP errors instead of returning a status object.

Automatic solving

Use Captcha.autoSolve to start background detection on the page. Attach event listeners before starting it, then navigate:
The response {"status": "started"} confirms that background solving started. Wait for the expected page content or response to confirm completion, and set a timeout for that wait. type restricts detection to one allowed type. Omit it to detect among the configured auto_captcha_types. Calling autoSolve again replaces the current background loop; disconnecting the CDP client ends it. Repeated failures can stop the loop, so observe failure events.

Events

Payload fields depend on the event. Solve events include the type when known, and may include status, error, or an image solution.

Control the external provider

If the browser loaded the external integration, toggle it on the current page with:
This does not disable internal solvers or stop the background detection loop. If the browser started with disable_external_providers: true, the integration is absent and this command returns an error. Start another browser with loading enabled if you need it.

Troubleshooting

Use DevTools or Screencast to observe one attempt before increasing concurrency. Keep provider keys out of logs and source control.