Capture one element instead of the whole page
A chart in an image is a chart. A chart inside a full-page screenshot is a chart plus a navigation bar, a cookie notice and a footer.
selectorselector_algorithmselector_scroll_into_viewerror_on_selector_not_foundcapture_beyond_viewportcurl --fail-with-body "https://api.pagecapture.dev/v1/take" \
-H "X-Access-Key: $PAGECAPTURE_KEY" \
-H "Content-Type: application/json" \
--data '{"url":"https://example.com","format":"png","selector":"main","selector_scroll_into_view":true}' \
-o capture.pngVerified 2026-08-13 by running the published code against a fixture.
Configure it in the playgroundWhat it does
- Captures the bounding box of the matched element, scrolling it into view first by default.
- Offers two strategies through `selector_algorithm`: `default` uses the browser's element capture API, `clip` converts the bounding box into a clip rectangle.
- Falls back to a viewport capture when the selector misses — unless you ask for the opposite.
What it does not do
- Does not accept XPath. The selector is always CSS.
- Does not fail by default on a missing selector. That default is asymmetric with `click` and `hover`, which do fail, and copying the wrong one breaks a migration silently.
- Does not compose with `clip`: the element defines the rectangle, so a manual one would have to win or lose, and neither is a good surprise.
Every limit on this page is the one the API enforces
These rows are read from the same parameter table that validates your request. Nothing here is transcribed, so a number cannot drift from the behaviour it describes.
| Parameter | Type | Default | Range | Endpoints | Cache key |
|---|---|---|---|---|---|
selectorCapture only the element matching this CSS selector. | string | — | — | /v1/take | In |
selector_algorithmHow the element is captured: `default` uses the browser element API, `clip` converts the bounding box into a clip rectangle. The selector is always CSS. | enum | default | — | /v1/take | In |
selector_scroll_into_viewScroll the selected element into view before capturing. | boolean | true | — | /v1/take | In |
error_on_selector_not_foundFail when the capture, hide or wait selector does not match, instead of skipping it. | boolean | false | — | /v1/take, /v1/animate | In |
capture_beyond_viewportAllow the capture to extend past the viewport bounds. | boolean | true | — | /v1/take | In |
How it behaves next to the rest of the request
selector_algorithmHow the element is captured: `default` uses the browser element API, `clip` converts the bounding box into a clip rectangle. The selector is always CSS.
`clip` is the escape hatch for elements the browser's own element capture handles badly — transformed containers, elements inside a scroll region. Same selector, different mechanics.
error_on_selector_not_foundFail when the capture, hide or wait selector does not match, instead of skipping it.
Set it to `true` in a pipeline. A viewport capture standing in for a missing chart is worse than a failure, because the failure costs nothing and the wrong image gets published.
wait_for_selectorWait until this CSS selector appears.
If the element is rendered by client-side code, wait for it with the same selector. Otherwise the capture starts before it exists and the fallback quietly takes over.
Errors this option can produce
selector_not_foundHTTP 400The requested selector was not found.
resulting_image_too_largeHTTP 400The resulting image exceeds the maximum allowed size.
None of them is billable. No error code in the catalog is.
Related capabilities
All capabilities100 successful captures a month, every feature unlocked, no card.
Get an API keyPageCapture Engineering · reviewed by PageCapture API maintainers · Verified 2026-08-13 by running the published code against a fixture.