Skip to main content
Quick actions create an ephemeral browser, perform one URL-level operation, and return the result. Use them when the job is one scrape, one screenshot, or one PDF and you do not need browser session continuity. Use a managed browser instead when the workflow needs login state, multiple steps, downloads, dialogs, recordings, Debug UI inspection, CDP, or post-step observations after each Playwright action.

Choose the action

NeedUse
Read page text or HTMLweb.scrape(), web scrape, or POST /v1/scrape
Capture visual evidenceweb.screenshot(), web screenshot, or POST /v1/screenshot
Render a printable pageweb.pdf(), web pdf, or POST /v1/pdf
All quick actions can use browser policy. SDK, CLI, and REST quick actions also support custom proxy configuration.

SDK examples

import { Web } from "@webcompute/sdk";

const web = new Web();

const page = await web.scrape({
  url: "https://example.com",
  format: "markdown",
  maxChars: 20_000,
  policy: { allowedDomains: ["example.com"] },
});

console.log(page.title);
console.log(page.content);
const screenshot = await web.screenshot({
  url: "https://example.com",
  fullPage: true,
  format: "png",
});

console.log(screenshot.width, screenshot.height);
const pdf = await web.pdf({
  url: "https://example.com/report",
  format: "Letter",
  printBackground: true,
});

console.log(pdf.pages);

CLI examples

web scrape https://example.com \
  --format markdown \
  --max-chars 20000 \
  --include-links
web screenshot https://example.com \
  --full-page \
  --format png \
  --output example.png
web pdf https://example.com/report \
  --format Letter \
  --output report.pdf

REST examples

curl -sS -X POST https://api.webcompute.dev/v1/scrape \
  -H "Authorization: Bearer $WEBCOMPUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"markdown","maxChars":20000}'
curl -sS -X POST https://api.webcompute.dev/v1/screenshot \
  -H "Authorization: Bearer $WEBCOMPUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","fullPage":true,"format":"png"}'
curl -sS -X POST https://api.webcompute.dev/v1/pdf \
  -H "Authorization: Bearer $WEBCOMPUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/report","format":"Letter"}'
Screenshot and PDF REST responses return encoded document data. Store it in your application or move to a managed browser if you need a richer artifact lifecycle.

When to switch to managed browsers

Switch when any of these are true:
  • The task needs multiple page interactions.
  • You need a Debug UI URL or CDP connection.
  • The result depends on login state.
  • You need downloads, dialogs, permissions, files, or recordings.
  • An agent or application needs observations after each step.
  • Cleanup and lifecycle control matter.
Reference: SDK quick actions reference, REST API, browser control, and policy and proxy.