Capture a specific element

Pass a CSS selector to capture just one element — a pricing card, a chart, a hero — instead of the whole page. The image is cropped to the element's bounding box.

Example

curl -X POST https://screenshotforweb.com/api/v1/screenshot \
  -H "X-API-Key: sk_live_your_key" -H "Content-Type: application/json" \
  -d '{"url":"https://en.wikipedia.org/wiki/Screenshot","selector":"#firstHeading"}'
Element-only screenshot
selector: '#firstHeading' — cropped to the element

Tips

  • Combine with waitFor to make sure the element exists before capture.
  • If the element loads late, add a wait interaction or increase timeout.