ai

Render a URL as a screenshot.

Render a URL as a screenshot. POST { url, width?, height?, fullPage?, format?, quality?, waitUntil?, timeoutMs?, deviceScaleFactor?, blockAds? }. Returns raw image bytes (no JSON envelope) with X-2s-Render-Ms and X-2s-Image-Bytes headers. Viewport clamped 320-3840 × 320-2160. Timeout clamped 1-15s. Defaults: 1280×720 PNG, networkidle2 wait, ad-blocking on. Use cases: visual verification, archival, change detection, OG-card generation, RSS thumbnails. Billing: payment settles before this endpoint runs (paid upstream), so an error after settlement IS charged — the error response then carries the payment receipt (PAYMENT-RESPONSE) and X-2s-Charged: true.

post/api/ai/screenshot

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/ai/screenshot
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Request body

urlstring uri required

HTTPS URL to render.

widthinteger

Viewport width (320-3840). Default 1280.

heightinteger

Viewport height (320-2160). Default 720.

fullPageboolean

Capture the full scrollable page instead of the viewport.

format'png' | 'jpeg' | 'webp'

Image format. Default png.

qualityinteger

JPEG/WebP quality 1-100. Ignored for PNG.

waitUntil'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2'

Wait condition before snap. Default networkidle2.

timeoutMsinteger

Render timeout in milliseconds (1000-15000). Default 8000.

deviceScaleFactorinteger

Pixel density multiplier 1-3. Default 1.

blockAdsboolean

Block ads + trackers. Default true.

Response

Raw image bytes (PNG / JPEG / WebP per format). X-2s-Render-Ms + X-2s-Image-Bytes response headers describe the render. No JSON envelope on success.

Changes

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