Capture a screenshot of a public web page URL as a hosted image artifact.
Endpoint
/v1/web/screenshot
Query
Web page URL to fetch.
When true, capture the full scrollable page. Default: false (viewport).
Viewport width in CSS pixels. Default: 1280.
Viewport height in CSS pixels. Default: 800.
Device scale factor (1–3). Default: 1.
CSS selector to clip the screenshot to a single element. Cannot be combined with fullPage.
Output image format. Default: png.
JPEG/WebP quality 1–100. Invalid when format is png.
Extra settle delay in milliseconds after load (0–10000).
CSS selector to wait for before capturing.
Navigation wait condition. `networkidle` is bounded and resolves on idle or a short cap, whichever comes first. Default: load.
Dismiss/block cookie consent banners. Default: true.
Block ads and trackers during render. Default: true.
Request prefers-color-scheme: dark. Default: false.
Optional ISO 3166-1 alpha-2 country for geo-located rendering (+1 credit).
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`.
Optional Redis artifact-cache TTL in seconds (60–604800). Must stay strictly below the 7-day object lifetime.
Delivery mode. `url` (default) returns a hosted CDN URL valid for 7 days. `base64` returns the image bytes inline when small enough.
const response = await fetch( "https://api.socialfetch.dev/v1/web/screenshot?url=https://www.socialfetch.dev", { headers: { "x-api-key": "YOUR_API_KEY" } } ); const data = await response.json(); console.log(data);