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"}'
Tips
- Combine with
waitForto make sure the element exists before capture. - If the element loads late, add a
waitinteraction or increasetimeout.