Capture Website Screenshots with a Simple API Call
Need to generate thumbnails, create visual previews, or capture website screenshots programmatically? The Website Screenshot API lets you do it in one HTTP request.
Quick Start
curl -X POST https://screenshot-api-rouge-zeta.vercel.app/api/screenshot \
-H "Content-Type: application/json" \
-d '{"url": "https://github.com", "width": 1280, "height": 720}' \
--output screenshot.png
That's it. You get a pixel-perfect PNG screenshot back.
Options
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
string | — | URL to capture |
html |
string | — | Raw HTML to render |
format |
string | "png" | png, jpeg, or webp |
width |
number | 1280 | Viewport width (max 3840) |
height |
number | 720 | Viewport height (max 2160) |
fullPage |
boolean | false | Capture full scrollable page |
deviceScaleFactor |
number | 1 | Retina scaling (1-3) |
delay |
number | 0 | Wait ms after page load |
Python Example
import requests
response = requests.post(
"https://screenshot-api-rouge-zeta.vercel.app/api/screenshot",
json={"url": "https://example.com", "format": "jpeg", "width": 1920, "height": 1080},
)
with open("screenshot.jpg", "wb") as f:
f.write(response.content)
Node.js Example
const response = await fetch("https://screenshot-api-rouge-zeta.vercel.app/api/screenshot", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://example.com", fullPage: true }),
});
const buffer = await response.arrayBuffer();
require("fs").writeFileSync("screenshot.png", Buffer.from(buffer));
Use Cases
- Social media previews: Generate OG images from URLs
- Visual regression testing: Compare screenshots across deployments
- Thumbnail generation: Create previews for link directories
- Archiving: Save webpages as images
- Monitoring: Capture visual state of websites periodically
Try It
Available on RapidAPI with a free tier.
Built by @ShotaTanikawa. Feedback welcome!
Top comments (0)