# Screenshot API - Viewport Screenshot Capture

> Screenshot API - Viewport Screenshot Capture is a paid API for AI agents from screenshot-api-production-fe7e.up.railway.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Captures a viewport-sized PNG screenshot of any public HTTP/HTTPS URL using headless Chromium and returns the image as a base64-encoded JSON envelope with metadata.

## Facts

- Endpoint: POST https://screenshot-api-production-fe7e.up.railway.app/capture/screenshot
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/screenshot-api-viewport-screenshot-capture-6a43d405
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1mJFhg83AdXnxdhTt6lmJ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability screenshot-api-viewport-screenshot-capture-6a43d405 -d '<json body>'
```

Example prompt: Can you take a screenshot of https://news.ycombinator.com at 1440x900 resolution and wait for the page to fully load (networkidle) before capturing?

## When to prefer this

Choose this endpoint when you need a standard viewport-sized screenshot (what a user would see above the fold in a browser window) at a specific resolution. It is ideal for generating preview thumbnails, visual QA checks, link previews, or archiving web content at a defined viewport. Use the sibling full-page endpoint instead if you need the entire scrollable page captured; use the element screenshot endpoint if you only need a specific CSS-selected component.

## Known failure modes

- Internal or loopback hosts (e.g. localhost, 192.168.x.x) are rejected with an error
- Invalid or malformed URLs return a validation error
- Pages that timeout before reaching the specified load state may return a partial capture or error
- Very large pages or high-resolution viewports may produce large base64 payloads
- Pages requiring authentication will capture the login screen rather than the authenticated content
- Invalid wait_until values outside the accepted enum will cause a parameter error

## How this service works

Capture a viewport-sized PNG screenshot of an http(s) URL with headless Chromium; returns a JSON envelope with the PNG base64-encoded under image_base64, plus final_url, title, viewport, and size.

## Output

A JSON object containing: `image_base64` (PNG screenshot encoded as base64), `final_url` (the URL after any redirects), `title` (the page title), `viewport` (object with width and height used), and `size` (byte size of the PNG). The image can be decoded and used directly as a PNG file.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "The http(s) URL to capture, e.g. 'https://example.com'. Internal/loopback hosts are rejected."
  },
  "width": {
   "type": "integer",
   "description": "Viewport width in pixels (320-3840). Defaults to 1280."
  },
  "height": {
   "type": "integer",
   "description": "Viewport height in pixels (240-3840). Defaults to 800."
  },
  "wait_until": {
   "type": "string",
   "description": "Playwright load state to wait for before capture: 'load', 'domcontentloaded', 'networkidle', or 'commit'. Defaults to 'networkidle'."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/screenshot-api-viewport-screenshot-capture-6a43d405/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from screenshot-api-production-fe7e.up.railway.app](https://www.zero.xyz/host/screenshot-api-production-fe7e.up.railway.app/llms.txt)
