const browser =
await chromium.launch(); Sessions are free — pay only for traffic
Run Playwright in the Cloud
Point your Playwright scripts and tests at Chromium running in Floppydata's cloud. One API request starts a browser, connectOverCDP() connects to it, and the rest of your code stays as it is.
- Connect with connectOverCDP() — no browsers to install
- Node.js, Python and Playwright Test
- Free with Floppydata proxies — you pay only for traffic
How to Run Playwright in the Cloud
Create a session with one API request, then hand its connectUrl to Playwright. The example follows the Cloud Browser guide in our documentation.
Three steps
- 1 Create a Client API key in your Floppydata account.
- 2 Send POST /v2/browser/sessions. The response has a connectUrl.
- 3 Pass it to connectOverCDP() and work as usual. Closing the browser stops the session.
import { chromium } from 'playwright';const res = await fetch('https://api.floppydata.net/v2/browser/sessions', { method: 'POST', headers: { 'X-Api-Key': process.env.FLOPPY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ proxy: { type: 'residential', location: { countryCode: 'US' } }, }),});const { connectUrl } = await res.json();const browser = await chromium.connectOverCDP(connectUrl);const page = await browser.contexts()[0].newPage();await page.goto('https://example.com/');console.log(await page.title());await browser.close(); // stops the session import os, requestsfrom playwright.sync_api import sync_playwrightsession = requests.post( 'https://api.floppydata.net/v2/browser/sessions', headers={'X-Api-Key': os.environ['FLOPPY_API_KEY']}, json={'proxy': { 'type': 'residential', 'location': {'countryCode': 'US'}, }},).json()with sync_playwright() as p: browser = p.chromium.connect_over_cdp(session['connectUrl']) page = browser.contexts[0].new_page() page.goto('https://example.com/') print(page.title()) browser.close() import { test as base, expect, chromium } from '@playwright/test';const SESSIONS_URL = 'https://api.floppydata.net/v2/browser/sessions';const test = base.extend({ page: async ({}, use) => { const res = await fetch(SESSIONS_URL, { method: 'POST', headers: { 'X-Api-Key': process.env.FLOPPY_API_KEY, 'Content-Type': 'application/json', }, body: '{}', }); const { connectUrl } = await res.json(); const browser = await chromium.connectOverCDP(connectUrl); await use(await browser.contexts()[0].newPage()); await browser.close(); },});test('home page loads', async ({ page }) => { await page.goto('https://example.com/'); await expect(page.locator('h1')).toBeVisible();}); Create a session, connect, open a page.
From Local Playwright to Cloud Playwright
Locally, every Playwright worker starts its own Chromium. As a test suite or a scraper grows, those browsers compete for CPU and memory, and every CI runner has to download them first.
With Floppydata Cloud Browser, Chromium runs remotely. Your code connects over the Chrome DevTools Protocol, so playwright-core is enough on your side, and every run gets a browser session of its own.
const browser =
await chromium.connectOverCDP(connectUrl); Everything after this line stays the same. connectUrl comes from the create request above.
Playwright with Built-in Proxies
Every session runs through Floppydata proxies, so there is no proxy server to set up in Playwright. Pick the IP type, the country and the rotation, and send the result as the body of the create request.
Configure your Playwright cloud session
{
"proxy": {
"type": "residential",
"location": {
"countryCode": "US"
},
"rotation": {
"mode": "sticky"
}
}
} A city, a state or an ASN can be targeted in the same request. Residential IPs cover 148 countries, mobile 150 and datacenter 71.
Local vs Cloud Playwright
| Local Playwright | Playwright on Cloud Browser | |
|---|---|---|
| Chromium | Installed and updated on every machine | Runs in Floppydata's cloud |
| Browsers in CI | Downloaded on every runner | Not needed: playwright-core is enough |
| Proxies | Set up by you for every launch | Built in: residential, mobile or datacenter |
| Parallel browsers | Limited by your CPU and RAM | Up to 100 sessions per account |
| Cost of the browser | Your servers' time | Free: only proxy traffic is billed |
| Connection | Playwright protocol, every browser engine | CDP with connectOverCDP(), Chromium only |
connectOverCDP() covers what most scripts do (navigation, locators, clicks, forms, waits and JavaScript), but it is not the full Playwright protocol. Check anything unusual against your own scripts.
Scale and Shape Each Session
Every setting is an optional field of the create request: send only the ones you need, or send nothing and get a residential proxy, a coherent fingerprint and a 10-minute timeout.
-
Parallel runs: up to 100 sessions at once on one account, more on request
-
Fingerprint: OS, locale, timezone, hardware, and canvas, WebGL and WebRTC masking
-
Runtime: from 1 minute to 6 hours, with reconnects when keepAlive is on
-
Saved state: reuse a browser identity and its cookies across sessions
-
Start URLs: open one or more pages at launch, each in its own tab
-
Metadata: tag a session with your own job ID to match it to your logs
Debug Playwright Runs in a Live Browser
When a script stops on a screen it didn't expect, like a consent banner or an extra login step, open a live view of the session in your own browser and see exactly what the page shows.
Playwright and the live view take turns on one session, so the run can continue where it stopped instead of starting over. More about UI mode
- 1 Create the session with keepAlive: true, so disconnecting doesn't stop it.
- 2 When a run stops on an unexpected screen, disconnect Playwright.
- 3 Request a live view and open it: see the page and deal with it by hand.
- 4 Get the session again and reconnect Playwright with the fresh connectUrl.
Free for Floppydata Proxy Users
Cloud Browser has no subscription, runtime or per-session fee. Every session runs through Floppydata proxies, and the proxy traffic it uses is the only thing you pay for: from $1.00 per GB, one rate for residential, mobile and datacenter.
If you already buy Floppydata proxies, Cloud Browser is included: the same balance, the same API key. Run up to 100 sessions at once on one account, or ask support to raise the limit.
Common Playwright Cloud Connection Errors
What the API or the connection says when something goes wrong, and what to do about it.
| Error | What it means | What to do |
|---|---|---|
unauthorized | The signed connectUrl has expired or is invalid. | Get the session again and connect with its fresh connectUrl. |
connection_in_use | Another client or a live view is already connected: one connection per session. | Close the other connection, then retry. |
session_not_active | The session has stopped, timed out or failed. | Create a new session; for long jobs, raise runtime.timeoutSeconds. |
| Connection closes | A single message went over about 1 MiB, such as a full-page screenshot or a screencast frame. | Take viewport or element screenshots, or clip the area you need. |
upstream_error | A browser service operation failed for a moment. | Retry: stopping a session is safe to repeat. |