Copy-paste ready cURL commands for every SnapAPI endpoint. No SDK required — works from any terminal, CI/CD pipeline, or shell script.
All requests require your API key in the X-Api-Key header. Get your key from the dashboard.
export SNAPAPI_KEY="your_api_key_here"
curl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
--output screenshot.pngcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "png",
"fullPage": true,
"width": 1280
}' \
--output full-page.pngcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "avif",
"width": 1440,
"height": 900
}' \
--output screenshot.avifcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"devicePreset": "iPhone15",
"format": "png"
}' \
--output mobile.pngcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "png",
"blockAds": true,
"blockCookies": true
}' \
--output clean.pngcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "png",
"responseType": "url"
}'
# Response:
# {"url": "https://cdn.snapapi.pics/screenshots/abc123.png"}curl -X POST "https://api.snapapi.pics/v1/pdf" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
--output page.pdfcurl -X POST "https://api.snapapi.pics/v1/pdf" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "A4",
"printBackground": true,
"margin": {
"top": "20mm",
"bottom": "20mm",
"left": "15mm",
"right": "15mm"
}
}' \
--output document.pdfcurl -X POST "https://api.snapapi.pics/v1/pdf" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Invoice #1234</h1><p>Total: $99.00</p>",
"format": "A4",
"printBackground": true
}' \
--output invoice.pdfcurl -X POST "https://api.snapapi.pics/v1/extract" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/blog-post",
"format": "markdown"
}'
# Response:
# {"markdown": "# Blog Post Title\n\nArticle content..."}curl -X POST "https://api.snapapi.pics/v1/extract" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/product",
"format": "structured",
"schema": {
"title": "string",
"price": "number",
"description": "string"
}
}'curl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/dashboard",
"format": "png",
"headers": {
"Authorization": "Bearer your-token",
"Cookie": "session=abc123"
}
}' \
--output dashboard.pngcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "png",
"css": "body { background: #1a1a2e; color: white; }",
"js": "document.querySelector(\".popup\")?.remove();"
}' \
--output styled.pngcurl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "png",
"delay": 3000,
"waitForSelector": "#main-content"
}' \
--output delayed.pngCheck HTTP status codes to handle errors:
# Check response status
response=$(curl -s -w "\n%{http_code}" -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
--output screenshot.png)
http_code=$(echo "$response" | tail -1)
case $http_code in
200) echo "Success! Screenshot saved." ;;
400) echo "Bad request - check your parameters" ;;
401) echo "Invalid API key" ;;
429) echo "Rate limit exceeded - slow down" ;;
500) echo "Server error - try again later" ;;
*) echo "Unexpected status: $http_code" ;;
esacX-RateLimit-Remaining response header. Upgrade for higher limits.
#!/bin/bash
# batch-screenshots.sh — Capture screenshots for a list of URLs
URLS=(
"https://example.com"
"https://github.com"
"https://news.ycombinator.com"
)
for i in "${!URLS[@]}"; do
echo "Capturing ${URLS[$i]}..."
curl -s -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d "{\"url\": \"${URLS[$i]}\", \"format\": \"png\"}" \
--output "screenshot_$i.png"
echo " → screenshot_$i.png"
done
echo "Done! Captured ${#URLS[@]} screenshots."#!/bin/bash
# timestamped-screenshot.sh — Capture with date-based filename
URL="${1:-https://example.com}"
FILENAME="screenshot_$(date +%Y%m%d_%H%M%S).png"
curl -s -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d "{\"url\": \"$URL\", \"format\": \"png\"}" \
--output "$FILENAME"
echo "Saved: $FILENAME"#!/bin/bash
# monitor.sh — Take periodic screenshots for visual monitoring
URL="https://example.com"
INTERVAL=3600 # seconds (1 hour)
while true; do
FILENAME="monitor_$(date +%Y%m%d_%H%M%S).png"
curl -s -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: $SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d "{\"url\": \"$URL\", \"format\": \"png\", \"fullPage\": true}" \
--output "$FILENAME"
echo "[$(date)] Captured → $FILENAME"
sleep $INTERVAL
done