Skip to main content
Use REST quick actions when one URL-level browser operation is enough and you want to call Webcompute from any language.

Quick-action shape

  • One-off scrape, screenshot, and PDF requests over HTTP.
  • Base64 binary handling for screenshot and PDF responses.
  • The point where a workflow should switch to a managed browser.

Setup

Set WEBCOMPUTE_API_KEY in your shell. These examples use example.com so they do not require an account or private data.

Run a scrape

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}'

Capture a screenshot

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"}' \
  | jq -r '.data' \
  | base64 -d > example.png

Render a PDF

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","format":"Letter","printBackground":true}' \
  | jq -r '.data' \
  | base64 -d > example.pdf

Expected output

Scrape responses include page content and metadata. Screenshot responses include data, format, width, height, elapsedMs, and _meta. PDF responses include data, pages, elapsedMs, and _meta.

Inspect

  • Response metadata for final URL, timing, and browser IDs.
  • The saved example.png or example.pdf file.
  • Error codes when a quick action times out or policy blocks navigation.

Cleanup

Delete local output files when you no longer need them. REST quick actions use ephemeral browser work; there is no browser session to close.

Common failures

  • If the job needs login state, multiple clicks, downloads, dialogs, recordings, Debug UI, or CDP, switch to a managed browser.
  • If binary output is corrupted, confirm you decoded only the data field and did not pipe the full JSON response into base64.
Reference: quick actions, REST API, and error codes.