Web

Capture website screenshot

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

GET/v1/web/screenshot
x-api-keystringheader

API key (`sfk_...`)

Parameters
18
urlstringrequiredquery

Web page URL to fetch.

min 1 chars · max 2083 chars

fullPagebooleanoptionalquery

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

viewportWidthintegeroptionalquery

Viewport width in CSS pixels. Default: 1280.

≥ 320 · ≤ 3840

viewportHeightintegeroptionalquery

Viewport height in CSS pixels. Default: 800.

≥ 320 · ≤ 3840

deviceScaleFactorintegeroptionalquery

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

≥ 1 · ≤ 3

selectorstringoptionalquery

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

min 1 chars · max 500 chars

formatstringoptionalquery

Output image format. Default: png.

one of: png, jpeg, webp

qualityintegeroptionalquery

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

≥ 1 · ≤ 100

delayintegeroptionalquery

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

≥ 0 · ≤ 10000

waitForstringoptionalquery

CSS selector to wait for before capturing.

min 1 chars · max 500 chars

waitUntilstringoptionalquery

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

one of: load, domcontentloaded, networkidle

blockCookieBannersbooleanoptionalquery

Dismiss/block cookie consent banners. Default: true.

blockAdsbooleanoptionalquery

Block ads and trackers during render. Default: true.

darkModebooleanoptionalquery

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

regionstringoptionalquery

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

cacheModestringoptionalquery

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`.

one of: enabled, bypass, write_only

cacheTtlintegeroptionalquery

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

≥ 60 · ≤ 604800

responsestringoptionalquery

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

one of: url, base64

Response fields
20

Endpoint-specific response payload.

datalookupStatus
string

Whether page content could be extracted. Restricted means bot protection or similar access controls blocked automated fetching.

one of: found, restricted

dataurl
string

URL that was rendered.

datafinalUrl
stringoptional

Final URL after redirects, when available.

datastatus
integernullable

HTTP status of the main document when available; null when restricted.

datatitle
stringnullableoptional

Document title when available.

Hosted screenshot artifact when capture succeeded (found or restricted). Null only when no image was produced.

dataartifacturl
string

Public HTTPS URL of the artifact on the media CDN. Valid until expiresAt.

dataartifactformat
string

Encoded image format of the artifact.

one of: png, jpeg, webp

dataartifactmime
string

MIME type of the artifact, e.g. image/png.

min 1 chars

dataartifactbytes
integer

Artifact size in bytes.

≥ 0

dataartifactwidth
integernullable

Pixel width when known; null for non-raster artifacts.

≥ 0

dataartifactheight
integernullable

Pixel height when known; null for non-raster artifacts.

≥ 0

dataartifactexpiresAt
string

ISO 8601 timestamp when the hosted URL expires and the object is deleted.

database64
stringoptional

Base64-encoded image bytes when response=base64 and the payload is within size limits.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metacached
booleanoptional

True when served from shared response cache. Credits still apply (full endpoint price); Age header may be present.

Code example

curl "https://api.socialfetch.dev/v1/web/screenshot?url=https://www.socialfetch.dev" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Screenshot capture result.