Need to capture website screenshots automatically? Whether you're building link previews, archiving pages, or generating thumbnails, a screenshot API is the fastest way to do it. This guide shows you how, with code examples in cURL, JavaScript, and Python.
Running your own headless browser (Puppeteer/Playwright) works for small-scale use, but it comes with overhead:
A screenshot API handles all of this. You send a URL, you get back an image. Simple.
curl -X POST https://snap.michaelcli.com/api/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "name": "My App"}'
Response:
{
"key": "snap_abc123...",
"tier": "free",
"message": "API key created. 50 free requests/month."
}
curl -X POST https://snap.michaelcli.com/api/screenshot \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://github.com"}' \
--output screenshot.png
That's it. You'll get a PNG screenshot of the page.
Control the viewport, format, and capture behavior:
curl -X POST https://snap.michaelcli.com/api/screenshot \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"width": 1920,
"height": 1080,
"full_page": true,
"format": "jpeg",
"quality": 80
}' \
--output full-page.jpg
const fs = require('fs');
const res = await fetch('https://snap.michaelcli.com/api/screenshot', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'https://github.com', width: 1280 })
});
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync('screenshot.png', buffer);
import requests
response = requests.post(
'https://snap.michaelcli.com/api/screenshot',
headers={'X-API-Key': 'YOUR_KEY'},
json={'url': 'https://github.com', 'width': 1280}
)
with open('screenshot.png', 'wb') as f:
f.write(response.content)
SnapAPI also extracts metadata and generates PDFs from the same API:
curl -X POST https://snap.michaelcli.com/api/metadata \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://github.com"}'
curl -X POST https://snap.michaelcli.com/api/pdf \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": "A4"}' \
--output page.pdf
50 free requests/month. No credit card. Set up in 30 seconds.
Get Free API KeyUse code LAUNCH50 for 50% off paid plans