Screenshot one element of a page
To screenshot one element of a web page, add a CSS selector to a CurlShot request, for example selector=h1 or selector=.pricing-table. CurlShot opens the page, finds the first element that matches and returns an image of that element alone, cropped to its edges. To cut out a fixed area instead, give its position and size in pixels.
curl "https://curlshot.com/api/v1/screenshot?access_key=YOUR_ACCESS_KEY&url=https://example.com&selector=h1" \
--output element.pngHow to do it, in three steps
- 1
Create a free account and copy your access key.
- 2
Find the CSS selector of the element: its id, its class or its tag.
- 3
Add selector to the request and save the image that comes back.
What people use it for
- A chart or a dashboard tile as an image for a report or an email
- A pricing table, a testimonial or a product card on its own
- One component of your app for the docs
- Watching one part of a page for changes
For developers: one request
The same thing from your own code. It is a plain HTTP request, so it works from any language. Create a free account to get an access key.
Questions people ask
How do I take a screenshot of a specific element?
Add selector to a CurlShot request with the CSS selector of the element. The image contains that element and nothing else.
What if the element appears late?
Add wait_for_selector with the same selector. The screenshot is taken only after the element is visible.
Can I capture an area by coordinates?
Yes. clip_x, clip_y, clip_width and clip_height cut out a rectangle of the page, measured in pixels from its top left corner.
Can I hide things inside or around the element?
Yes. hide_selectors hides any elements you name, and styles adds your own CSS to the page before the screenshot.
Related tools
- Screenshot APIA screenshot API for developers. One HTTP request turns a URL, HTML or Markdown into a PNG, JPEG, WebP or PDF. Full page, devices, blocking, cache, MCP.
- Full-page screenshotTake a screenshot of a whole web page, from the top to the very bottom, as one image. Paste the address, nothing to install. Also available as an API.
- HTML to imageRender your own HTML, CSS or Markdown into an image or a PDF with one API request. For social cards, certificates, receipts and reports.