Element Interaction
Click, hover, scroll, hide, or capture a single element using CSS selectors before the screenshot is taken.
These parameters let you manipulate the page before capture: dismiss overlays, open dropdowns, scroll to the right position, or isolate a single component.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
selector | string | optional | CSS selector to capture only this element instead of the full page. |
scroll_to | string | optional | CSS selector to scroll to this element before capture. |
scroll_into_view | string | optional | CSS selector to scroll this element into the viewport before capture. |
adjust_top | integer | optional | Pixel offset applied after scroll_into_view (positive = scroll down, -9999 to 9999). |
hide_selectors | string | optional | Comma-separated CSS selectors to hide (visibility: hidden) before capture. |
click | string | optional | CSS selector to click this element before capture (triggers state changes, dismisses overlays). |
hover | string | optional | CSS selector to hover this element before capture (reveals :hover styles / tooltips). |
Code Examples
# Capture only the #hero element
curl "https://screenshotcore.com/api/v1/screenshot?access_key=KEY&url=https://example.com&selector=%23hero" -o hero.png
# Click cookie accept, hide nav bar
curl "https://screenshotcore.com/api/v1/screenshot?access_key=KEY&url=https://example.com&click=.accept-cookies&hide_selectors=nav,.footer" -o out.png
# Scroll to pricing section
curl "https://screenshotcore.com/api/v1/screenshot?access_key=KEY&url=https://example.com&scroll_to=%23pricing&delay=300" -o pricing.pngResponse
(Raw PNG bytes clipped to the matched element, Content-Type: image/png)