---
title: "Capture a screenshot from URL, HTML, or Markdown"
method: POST
path: "/v1/screenshot"
---

# Capture a screenshot from URL, HTML, or Markdown

`POST /v1/screenshot`

## Request

- Base URL: `https://app.snap-render.com`
- URL: `https://app.snap-render.com/v1/screenshot`
- Auth: API key in header `X-API-Key`

Takes a screenshot and returns it as a binary image or JSON with base64 data URI. Accepts a JSON body with exactly one of: url (capture a website), html (render raw HTML), or markdown (render Markdown with a styled template). All screenshot parameters (format, width, height, dark_mode, etc.) work with all three sources. Use POST when providing html or markdown content. Supports device emulation, dark mode, ad blocking, cookie banner removal, and caching.

## Request body

- object
  - `url` string: URL to capture (mutually exclusive with html and markdown)
  - `html` string: Raw HTML content to render (max 2MB, mutually exclusive with url and markdown)
  - `markdown` string: Markdown content to render with styled template (max 500KB, mutually exclusive with url and html)
  - `format` 'png' | 'jpeg' | 'webp' | 'pdf'
  - `width` integer
  - `height` integer
  - `full_page` boolean
  - `quality` integer
  - `delay` integer
  - `dark_mode` boolean
  - `block_ads` boolean
  - `block_cookie_banners` boolean
  - `device` 'iphone_14' | 'iphone_15_pro' | 'pixel_7' | 'ipad_pro' | 'macbook_pro'
  - `hide_selectors` string
  - `click_selector` string
  - `user_agent` string
  - `headers` object: Extra request headers for the target site, e.g. a secret header the site owner's firewall allows. Sent to the target's domain and its subdomains only, never to other sites. POST only (never put secrets in a URL). Host, Cookie, Origin, Referer, User-Agent (use user_agent), Sec-*, Proxy-* and X-Forwarded-* cannot be set. Only with url.
  - `cache` boolean: Return cached result if available. OFF by default: set true to enable caching. Cached hits are free but may be up to 24h old.
  - `cache_ttl` integer: Cache lifetime in seconds (default 24h). Cached screenshots older than this are recaptured.
  - `response_type` 'binary' | 'json'

## Response `200`

Screenshot captured successfully

- object
  - `url` string, nullable: The captured URL (null for html/markdown)
  - `source` 'url' | 'html' | 'markdown': Content source type
  - `format` string
  - `width` integer
  - `height` integer
  - `image` string: Base64 data URI
  - `size` integer
  - `cache` 'HIT' | 'MISS'
  - `responseTime` string
  - `remainingCredits` integer

## Other responses

- `400`: Invalid parameters
- `401`: Invalid or missing API key
- `429`: Rate limited or quota exceeded

---

[API](https://skmtc.dev/snap-render/apis/snaprender-screenshot-api.md) · [All operations](https://skmtc.dev/snap-render/apis/snaprender-screenshot-api/llms.txt) · [OpenAPI document](https://skmtc.dev/snap-render/apis/snaprender-screenshot-api/revisions/420ff88deeb2?raw)
