Capture Element Screenshot
Capture a screenshot of a specific DOM element
POST
15 credits
/v1/screenshot/element
curl -X POST "https://scrape.toolkitapi.io/v1/screenshot/element" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_KEY" \
-d '{"url":"https://toolkitapi.io","selector":"main"}'
import httpx
resp = httpx.post(
"https://scrape.toolkitapi.io/v1/screenshot/element",
json={"url":"https://toolkitapi.io","selector":"main"},
)
print(resp.json())
const resp = await fetch("https://scrape.toolkitapi.io/v1/screenshot/element", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"url":"https://toolkitapi.io","selector":"main"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"object_name": "screenshots/example-main.png"
}
Try It Live
Live Demo
Response
Description
Capture a screenshot of a specific DOM element
How to Use
1
1. Provide target URL and CSS selector. 2. Download or reference the generated artifact.
About This Tool
Captures only the element matching a selector rather than the full page.
Start using Capture Element Screenshot now
Get your free API key and make your first request in under a minute.