# Capture Website Screenshot API

> Render any public web page in headless Chromium and return a PNG or JPEG screenshot as base64 (or, with output: url, a signed link) — viewport or full page, with a configurable viewport size, wait strategy and settle delay.

Category: [Tools APIs](https://upapi.io/apis/tools) · Last updated 2026-11-10

## How to call it

- Endpoint: `POST https://api.upapi.io/screenshot.post`, key in the `X-Api-Key` header, JSON body.
- Cost: 20 weighted units per call.
- Timeout: 25 seconds.
- Cache: identical requests are served from cache for 60 seconds, unbilled.
- Try it without writing code: https://app.upapi.io/try/screenshot.post

```bash
curl -X POST https://api.upapi.io/screenshot.post \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{ "url": "https://example.com", "width": 1280, "format": "png", "height": 800, "output": "base64", "delayMs": 0, "blockAds": false, "fullPage": false, "waitUntil": "load" }'
```

## Request parameters

- `url` (string, required) — Absolute http(s) URL of the page to capture (e.g. https://example.com). URLs resolving to private, loopback, link-local or cloud-metadata addresses are rejected.
- `width` (integer) — Viewport width in CSS pixels (e.g. 1280).
- `format` (enum) — Image encoding: 'png' is lossless and sharper for text; 'jpeg' is far smaller and accepts `quality` (e.g. png).
- `height` (integer) — Viewport height in CSS pixels. Still sets the layout viewport when fullPage is true, but the image then grows to the document height (e.g. 800).
- `output` (enum) — How the file comes back: 'base64' (default) puts the bytes in the response; 'url' returns `fileUrl`, a signed HTTPS link that expires after 1 hour, instead — for no-code tools such as Bubble that save a file from a URL (e.g. base64).
- `delayMs` (integer) — Extra settle time after navigation before the shot, in milliseconds — for animations or late hydration (e.g. 500).
- `quality` (integer) — JPEG encoder quality, 1-100 (default 80). Rejected when format is png, which is lossless (e.g. 80).
- `blockAds` (boolean) — Abort requests to known ad and tracker hosts before they load, so they cannot appear in the image (e.g. true).
- `fullPage` (boolean) — Capture the entire scrollable document instead of just the viewport (e.g. false).
- `waitUntil` (enum) — When navigation counts as done: 'domcontentloaded' is fastest, 'load' waits for subresources, 'networkidle' waits for the network to go quiet and suits lazy-rendered apps (e.g. load).

## Response fields

- `bytes` (integer, required) — Size of the DECODED image in bytes (the base64 string is ~4/3 of this).
- `image` (string) — Base64-encoded image bytes. No `data:` URI prefix — decode directly. Present when `output` is 'base64' (the default); replaced by `fileUrl` in url mode.
- `width` (integer, required) — Image width in pixels.
- `format` (enum, required) — Encoding of the returned image.
- `height` (integer, required) — Image height in pixels — the full document height when fullPage was true.
- `fileUrl` (string) — Signed HTTPS link to the file, present only when `output` was 'url'. It expires after 1 hour and the file is deleted soon after.
- `finalUrl` (string, required) — URL of the page actually captured, after any redirects.
- `fileUrlExpiresAt` (string) — When `fileUrl` stops working, as an ISO 8601 timestamp. Only when `output` was 'url'.

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "url": "https://example.com",
  "width": 1280,
  "format": "png",
  "height": 800,
  "output": "base64",
  "delayMs": 0,
  "blockAds": false,
  "fullPage": false,
  "waitUntil": "load"
}
```

```json
{
  "bytes": 1,
  "image": "example",
  "width": 1,
  "format": "png",
  "height": 1,
  "fileUrl": "example",
  "finalUrl": "example",
  "fileUrlExpiresAt": "example"
}
```

## Frequently asked questions

### How much does the Capture Website Screenshot API cost per call?

Each call spends 20 weighted units of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Capture Website Screenshot API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Capture Website Screenshot API responses cached?

Yes — identical requests are served from cache for 60 seconds, and a cache hit is not billed.

## More Tools APIs

- [Render HTML or URL to PDF](https://upapi.io/apis/tools/html-to-pdf)
- [OCR an Image](https://upapi.io/apis/tools/image-ocr)
- [Extract Text from PDF](https://upapi.io/apis/tools/pdf-extract-text)
- [Fetch URL as Markdown](https://upapi.io/apis/tools/fetch-markdown)
- [Get Cloudflare Page Title](https://upapi.io/apis/tools/cloudflare-page-title)
- [Search Hacker News](https://upapi.io/apis/tools/hackernews-search)
