Full page and element captures
Capture the whole scroll height, a single element, or just the viewport.
Three capture modes, chosen by two parameters.
| Mode | Parameters | Result |
|---|---|---|
| Viewport (default) | none | Exactly the visible area of the chosen device or viewport |
| Full page | full_page=true | The whole scroll height at the chosen width |
| Element | selector=<css> | Only the matched element, cropped tight |
Viewport
The default. The image matches the device preset's screen size, or your width/height
override.
curl -G https://ssnap.cc/api/v1/screenshot \
-H "Authorization: Bearer $SSNAP_API_KEY" \
--data-urlencode "url=https://example.com" \
--data-urlencode "width=1280" \
--data-urlencode "height=720" \
--output viewport.jpgFull page
curl -G https://ssnap.cc/api/v1/screenshot \
-H "Authorization: Bearer $SSNAP_API_KEY" \
--data-urlencode "url=https://example.com" \
--data-urlencode "full_page=true" \
--data-urlencode "network_idle=true" \
--output full.jpgWidth comes from the viewport; height is the document's full scroll height.
Lazy-loaded pages are the usual disappointment here: images below the fold may never
load because nothing scrolls. Pair full_page with network_idle=true and a delay
of a few hundred milliseconds.
A single element
curl -G https://ssnap.cc/api/v1/screenshot \
-H "Authorization: Bearer $SSNAP_API_KEY" \
--data-urlencode "url=https://example.com/pricing" \
--data-urlencode "selector=#pricing-table" \
--output element.pngselector accepts any CSS selector up to 255 characters, and the first match is used.
Good targets: #id, .card, main > section:first-of-type,
[data-testid="chart"].
Rules that bite
selectorbeatsfull_page. If both are set on an image format, the element wins.selectoris ignored forpdf. PDFs always render the document.- A selector that matches nothing fails the render. You get
500withcapture_failed. - An element hidden behind a cookie banner or an overlay is captured as it appears on screen, overlay included.
Timing controls
Both apply to every mode.
| Parameter | Effect |
|---|---|
network_idle=true | Waits for network activity to settle (tolerating up to two in-flight requests) before capturing. |
delay=<ms> | Waits this many milliseconds after load, 0–30000. |
Use network_idle for data-driven pages, delay for animations and transitions. They
combine: idle first, then the delay.
--data-urlencode "network_idle=true" \
--data-urlencode "delay=1000"The overall render timeout is 30 seconds. A long delay eats into it, so a 25-second
delay on a slow page will time out and return capture_failed.
Dark mode
theme=dark emulates prefers-color-scheme: dark, so pages with a media-query dark
theme render dark. Pages that switch themes with a stored user preference or a toggle
class will not follow it.
--data-urlencode "theme=dark"