Browser (CDP)
Connect with Playwright
Drive the remote browser with playwright-core over CDP.
Connect playwright-core to the remote browser with connectOverCDP, passing your API key as an Authorization
header.
import { chromium } from "playwright-core";
const browser = await chromium.connectOverCDP("wss://request.usestring.ai/v1/wss", {
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
});
const context = browser.contexts()[0] ?? (await browser.newContext());
const page = context.pages()[0] ?? (await context.newPage());
await page.goto("https://example.com/");
const html = await page.content();
await browser.close();Billing
The session is metered by bandwidth and duration and billed when it ends. Close the browser as soon as you're done. See Browser pricing.