When navigating a page with Browser API, our integrated CAPTCHA solver automatically solves all CAPTCHAs by default. You can monitor this auto-solving process in your code with the following custom CDP functions.
If you would like to disable CAPTCHA solver entirely through the Control Panel see our feature for Disable Captcha Solver
Once a CAPTCHA is solved, if there is a form to submit, it will be submitted by default.
Use this command to return the status after the captcha was solved, failed, or not detected.
Use this command to return the status after the captcha was solved, failed, or not detected.
Copy
Ask AI
Captcha.solve({ detectTimeout?: number // Detect timeout in millisecond for solver to detect captcha options?: CaptchaOptions[] // Configuration options for captcha solving }) : SolveResult
Examples
Copy
Ask AI
const page = await browser.newPage();const client = await page.target().createCDPSession();await page.goto('[https://site-with-captcha.com](https://site-with-captcha.com/)'); // Note 1: If no captcha was found it will return not_detected status after detectTimeout // Note 2: Once a CAPTCHA is solved, if there is a form to submit, it will be submitted by default const client = await page.target().createCDPSession(); const {status} = await client.send('Captcha.solve', {detectTimeout: 30*1000}); console.log(`Captcha solve status: ${status}`)
If CAPTCHA-solving fails, please attempt a retry. If the issue persists, submit a support reques detailing the specific problem you encountered.
Custom CDP commands for CAPTCHA status
Use the commands below to pinpoint a more specific stage in the CAPTCHA solving flow:
Captcha.detected
Browser API has encountered a CAPTCHA and has begun to solve it
Captcha.solveFinished
Browser API successfully solved the CAPTCHA
Captcha.solveFailed
Browser API failed in solving the CAPTCHA
Captcha.waitForSolve
Browser API waits for CAPTCHA solver to finish
Examples
The following code sets up a CDP session, listens for CAPTCHA events, and handles timeouts:
If you would like to either manually configure or fully disable our default CAPTCHA solver and instead call the solver manually or solve on your own, see the following CDP commands and functionality.
Captcha.setAutoSolve
This command is used to control the auto-solving of a CAPTCHA. You can disable auto-solve or configure algorithms for different CAPTCHA types and manually trigger this:
Copy
Ask AI
Captcha.setAutoSolve({ autoSolve: boolean // Whether to automatically solve captcha after navigate options?: CaptchaOptions[] // Configuration options for captcha auto-solving }) : void
Examples of CDP commands to disable auto-solver completely within the session:
Use this command to get a list of all possible devices that can be emulated. This method returns an array of device options that can be used with the setDevice command.
Once you’ve received the list above of supported devices, you can emulate a specific device using the Emulation.setDevice command. This command changes the screen width, height, userAgent, and devicePixelRatio to match the specified device.
Use this command to install custom client SSL/TLS certificates where required for specific domain authentication. These certificates are applied for the duration of a single Browser API session and are automatically removed once the session ends.
Browser.addCertificate
Copy
Ask AI
Browser.addCertificate(params: { cert: string // base64 encoded certificate file pass: string // password for the certificate}) : void
Code examples
Replace placeholder values SBR_ZONE_FULL_USERNAME:SBR_ZONE_PASSWORD with your valid Browser API credentials.
Replace client.pfx with the actual path to your certificate file. This file should be a valid SSL/TLS client certificate in .pfx format.
Replace secret with the actual password for the certificate.