# Screenshot API – Element Capture

> Screenshot API – Element Capture is a paid API for AI agents from screenshot.payapi.market, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-21).

Captures a screenshot of a specific DOM element on a webpage using headless Chromium, returning a base64-encoded PNG image.

## Facts

- Endpoint: POST https://screenshot.payapi.market/capture/element?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/screenshot-api-element-capture-17a1acf7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GMlxq8kAQjkpoyev37kNA

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-element-capture-17a1acf7 -d '<json body>'
```

Example prompt: Take a screenshot of just the '#hero' element on https://stripe.com using a 1440px wide viewport, waiting for the network to be idle before capturing.

## When to prefer this

Choose this endpoint when you need to capture a specific DOM element rather than the full page or a PDF — ideal for extracting charts, UI components, product cards, or any isolated section identified by a CSS selector. Prefer this over full-page screenshot endpoints when only a portion of the page is relevant, reducing image size and noise.

## Known failure modes

- Invalid or unreachable URL returns an error (internal/loopback hosts are rejected)
- CSS selector not found on page results in an error response
- Page fails to reach the requested load state (timeout)
- Viewport dimensions outside allowed range (320-3840px) are rejected
- Payment failure via x402 protocol blocks the request

## How this service works

Headless Chromium screenshots, PDFs, full-page captures and element captures, with x402 payments.

## Output

Returns a JSON object containing the original URL, page title, format ('png'), the CSS selector used, viewport dimensions, final redirected URL, image size in bytes, and the full base64-encoded PNG of the captured element.

## 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."
  },
  "selector": {
   "type": "string",
   "description": "CSS selector of the single element to capture, e.g. '#main' or '.hero'."
  },
  "wait_until": {
   "type": "string",
   "description": "Playwright load state to wait for before capture: 'load', 'domcontentloaded', 'networkidle', or 'commit'. Defaults to 'networkidle'."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com",
  "title": "Example Domain",
  "format": "png",
  "selector": "#main",
  "viewport": {
   "width": 1280,
   "height": 800
  },
  "final_url": "https://example.com/",
  "size_bytes": 8192,
  "image_base64": "iVBORw0KGgoAAAANSUhEUgAAAAUA... (base64-encoded PNG bytes, truncated)"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/screenshot-api-element-capture-17a1acf7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from screenshot.payapi.market](https://www.zero.xyz/host/screenshot.payapi.market/llms.txt)
