Capture a screenshot from URL, HTML, or Markdown

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.

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

Request body

urlstring

URL to capture (mutually exclusive with html and markdown)

htmlstring

Raw HTML content to render (max 2MB, mutually exclusive with url and markdown)

markdownstring

Markdown content to render with styled template (max 500KB, mutually exclusive with url and html)

format'png' | 'jpeg' | 'webp' | 'pdf'
widthinteger
heightinteger
full_pageboolean
qualityinteger
delayinteger
dark_modeboolean
block_adsboolean
block_cookie_bannersboolean
device'iphone_14' | 'iphone_15_pro' | 'pixel_7' | 'ipad_pro' | 'macbook_pro'
hide_selectorsstring
click_selectorstring
user_agentstring
headersobject

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.

cacheboolean

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_ttlinteger

Cache lifetime in seconds (default 24h). Cached screenshots older than this are recaptured.

response_type'binary' | 'json'

Response

Screenshot captured successfully

urlstring nullable

The captured URL (null for html/markdown)

source'url' | 'html' | 'markdown'

Content source type

formatstring
widthinteger
heightinteger
imagestring

Base64 data URI

sizeinteger
cache'HIT' | 'MISS'
responseTimestring
remainingCreditsinteger

Changes

No recorded changes to this operation across all 1 revision of this API.