Web

Capture a website screenshot

Capture a screenshot of a public web page URL as a hosted image artifact.

get/v1/web/screenshot

Request

  • Base URL: https://api.socialfetch.dev
  • URL: https://api.socialfetch.dev/v1/web/screenshot
  • Auth: one of:
    • API key in header x-api-key
    • none

Query parameters

urlstring required

Web page URL to fetch.

fullPageboolean

When true, capture the full scrollable page. Default: false (viewport).

viewportWidthinteger

Viewport width in CSS pixels. Default: 1280.

viewportHeightinteger

Viewport height in CSS pixels. Default: 800.

deviceScaleFactorinteger

Device scale factor (1–3). Default: 1.

selectorstring

CSS selector to clip the screenshot to a single element. Cannot be combined with fullPage.

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

Output image format. Default: png.

qualityinteger

JPEG/WebP quality 1–100. Invalid when format is png.

delayinteger

Extra settle delay in milliseconds after load (0–10000).

waitForstring

CSS selector to wait for before capturing.

waitUntil'load' | 'domcontentloaded' | 'networkidle'

Navigation wait condition. networkidle is bounded and resolves on idle or a short cap, whichever comes first. Default: load.

blockCookieBannersboolean

Dismiss/block cookie consent banners. Default: true.

blockAdsboolean

Block ads and trackers during render. Default: true.

darkModeboolean

Request prefers-color-scheme: dark. Default: false.

regionstring

Optional ISO 3166-1 alpha-2 country for geo-located rendering (+1 credit).

cacheMode'enabled' | 'bypass' | 'write_only'

Cache behavior. enabled: read from cache if present, else fetch and write to cache. bypass: always fetch fresh, ignoring and not updating the cache. write_only: always fetch fresh, but write the result to cache without reading from it first. Default: enabled.

cacheTtlinteger

Optional Redis artifact-cache TTL in seconds (60–604800). Must stay strictly below the 7-day object lifetime.

response'url' | 'base64'

Delivery mode. url (default) returns a hosted CDN URL valid for 7 days. base64 returns the image bytes inline when small enough.

Response

Screenshot capture result.

Changes

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