> ## Documentation Index
> Fetch the complete documentation index at: https://docs-preview.webcompute.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# REST quick actions

> Use REST quick actions to scrape a page, capture a screenshot, or render a PDF without managing a browser session.

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

```bash theme={null}
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

```bash theme={null}
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

```bash theme={null}
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](/runtime-concepts/quick-actions), [REST API](/integrations/rest-api), and [error codes](/reference/error-codes).
