Sync Batch Screenshots
Capture screenshots of multiple URLs in one request. Returns base64-encoded images with per-URL success/error status.
POST
/v1/batchBatch screenshots require a Growth+ plan. Max URLs per request depends on your plan.
Parameters
| Parameter | Type | Default | Description |
|---|
Plan limits
| Plan | Max URLs per request |
|---|---|
| Free | ❌ Not available |
| Starter | ❌ Not available |
| Growth | 10 |
| Business | 25 |
| Enterprise | 50 |
Response
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"total": 3,
"succeeded": 2,
"failed": 1,
"results": [
{
"url": "https://example.com",
"success": true,
"image_base64": "iVBORw0KGgo...",
"content_type": "image/png",
"size_bytes": 145230
},
{
"url": "https://another.com",
"success": true,
"image_base64": "iVBORw0KGgo...",
"content_type": "image/png",
"size_bytes": 89400
},
{
"url": "https://blocked-site.com",
"success": false,
"error": "Navigation timeout after 30000ms"
}
]
}Example
curl -X POST https://api.snapsharp.dev/v1/batch \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://github.com",
"https://linear.app",
"https://vercel.com"
],
"width": 1280,
"format": "png",
"dark_mode": true
}'// Each result is independent — one failing URL won't stop the others
const res = await fetch('https://api.snapsharp.dev/v1/batch', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({
urls: ['https://github.com', 'https://linear.app'],
width: 1280,
dark_mode: true,
}),
});
const data = await res.json();
for (const result of data.results) {
if (result.success) {
const buffer = Buffer.from(result.image_base64, 'base64');
// save or process the image
}
}import httpx, base64, os
api_key = os.environ["SNAPSHARP_API_KEY"]
response = httpx.post(
"https://api.snapsharp.dev/v1/batch",
headers={"Authorization": f"Bearer {api_key}"},
json={
"urls": ["https://github.com", "https://linear.app", "https://vercel.com"],
"width": 1280,
"format": "png",
"dark_mode": True,
},
timeout=60.0,
)
response.raise_for_status()
data = response.json()
for result in data["results"]:
if result["success"]:
img = base64.b64decode(result["image_base64"])
with open(f"screenshot_{data['results'].index(result)}.png", "wb") as f:
f.write(img)
else:
print(f"Failed: {result['url']} — {result.get('error')}")<?php
$apiKey = getenv('SNAPSHARP_API_KEY');
$payload = json_encode([
'urls' => ['https://github.com', 'https://linear.app', 'https://vercel.com'],
'width' => 1280,
'format' => 'png',
'dark_mode' => true,
]);
$ch = curl_init('https://api.snapsharp.dev/v1/batch');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $apiKey",
'Content-Type: application/json',
],
]);
$body = curl_exec($ch);
curl_close($ch);
$data = json_decode($body, true);
foreach ($data['results'] as $i => $result) {
if ($result['success']) {
file_put_contents("screenshot_$i.png", base64_decode($result['image_base64']));
}
}Errors
| Code | Error | Description |
|---|---|---|
| 400 | validation_error | Invalid parameters or empty urls array |
| 401 | unauthorized | Missing or invalid API key |
| 403 | plan_required | Growth+ plan required |
| 429 | rate_limited | Rate limit exceeded |
| 500 | — | Internal server error |