Getting started

Quickstart

Launch a profile over HTTP and connect Playwright to the returned CDP endpoint in a few lines, in Node.js or Python.

Prerequisites

  • The Oculr app installed and running on this machine.
  • At least one profile. Use an existing one or POST /api/profiles/generate to make one.
  • The access token from Settings, here read from the OCULR_TOKEN environment variable.
  • A driver installed, for example playwright in your project.

Launch and connect

Send one POST to launch the profile, then connect Playwright over CDP using the ws_endpoint from the response. The launched browser already has a context and a page, so attach and start driving.

import { chromium } from "playwright";
const res = await fetch(
"http://127.0.0.1:8378/api/profiles/de-store-01/launch",
{ method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.OCULR_TOKEN}` },
body: JSON.stringify({ stealth: "balanced", headless: false }) },
).then((r) => r.json());
const browser = await chromium.connectOverCDP(res.ws_endpoint);
const page = browser.contexts()[0].pages()[0];
await page.goto("https://example.com");
Replace de-store-01 with one of your own profile ids. List them with GET /api/profiles.

Next steps

  • See Launch a profile for the full set of per launch options and response fields.
  • See Connect a driver for Puppeteer and Selenium attach snippets.
  • See Stealth modes to choose between off, balanced, and max per launch.