Getting Started with Cloud Browser
Cloud Browser provides remote browser sessions accessible via WebSocket using the Chrome DevTools Protocol (CDP). Connect with Puppeteer, Playwright, Selenium, or AI agent frameworks like Browser Use, Stagehand, and Vibium.
Key Features
Remote Browser Sessions
Access real Chrome browsers running in the cloud via CDP WebSocket connections
Proxy Integration
Choose between datacenter or residential proxy networks for geo-targeting
OS Fingerprinting
Emulate Windows, macOS, or Linux browser environments
Session Persistence
Maintain browser state across multiple connections with session resume
Human-in-the-Loop
Take manual control of sessions for debugging and CAPTCHA solving
Debug Mode Coming Soon
Record sessions as videos for debugging and analysis
WebSocket Connection
Connect to Cloud Browser using a CDP-compatible WebSocket URL with your API key and optional parameters:
Connection Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
api_key |
Yes | - | Your Scrapfly API key for authentication |
proxy_pool |
No | datacenter |
Proxy network type: datacenter or residential |
os |
No | random | Operating system fingerprint: linux, windows, or macos |
session |
No | - | Optional session identifier for maintaining browser state across connections. See Session Resume. |
country |
No | - | Proxy country code (ISO 3166-1 alpha-2), e.g., us, uk, de |
auto_close |
No | true |
Automatically stop the browser session when the CDP connection disconnects. Set to false to keep the browser alive for reconnection. |
timeout |
No | 900 |
Maximum session duration in seconds (15 minutes default, 30 minutes max). The session will be forcefully terminated after this time. |
debug Coming Soon |
No | false |
Enable session recording for debugging. Records the entire session as a video. See Debug Mode. |
Integrations
Cloud Browser uses the standard Chrome DevTools Protocol (CDP), making it compatible with all major browser automation tools and AI agent frameworks.
Quick Start Examples
Puppeteer
Connect to Cloud Browser using Puppeteer's browserWSEndpoint:
Playwright
Connect using Playwright's CDP endpoint:
Python (Playwright)
Connect using Playwright for Python:
Browser Use (AI Agent)
Connect Browser Use AI agent to Cloud Browser:
Billing
Cloud Browser uses a dual-dimension billing model based on:
- Session Time: Billed per 30 seconds (always rounded up)
- Bandwidth: Billed per MB consumed (no free threshold)
- Datacenter 1 credits
- Residential 1 credits
- Datacenter 2 credits
- Residential 10 credits
For detailed billing information and examples, see the Cloud Browser Billing page.
Troubleshooting
Cause: Invalid API key or network connectivity issues.
Solution:
- Verify your API key is correct
- Ensure your firewall allows WebSocket connections
- Check if you're behind a corporate proxy that blocks WebSocket
Cause: Session ID not provided or session expired.
Solution: Always include the same session parameter in the WebSocket URL for persistent sessions.
Note: Sessions expire after 1 hour of inactivity by default.
Cause: Browser session timeout or crash.
Solution:
- Always call
browser.close()to properly terminate sessions - Implement reconnection logic in your automation
- Monitor your scripts for memory leaks or infinite loops
Related Documentation
- Session Resume - Reconnect to existing browser sessions
- Human-in-the-Loop - Take manual control of sessions for debugging
- Debug Mode - Record sessions as videos for analysis
- File Downloads - Retrieve downloaded files from browser sessions
- Cloud Browser Billing - Detailed pricing and cost calculation
- Puppeteer Integration - Full Puppeteer setup guide
- Playwright Integration - Full Playwright setup guide
- Browser Use Integration - AI agent framework setup
- Stagehand Integration - AI-powered browser automation setup
- Vibium Integration - AI-powered Python browser automation
- Error Reference - All Cloud Browser API errors and troubleshooting
- General Billing Overview - Account-wide billing information