Authentication

Include your API key in the Authorization header:

Authorization: Bearer sk_your_api_key

Get your API key by registering for free.

POST /api/v1/screenshot

Capture a screenshot of any URL. Returns the image binary directly.

Parameters

ParamTypeDefaultTierDescription
urlstringAllURL to capture (required)
widthnumber1280All (custom sizes: Starter+)Viewport width in pixels
heightnumber720All (custom sizes: Starter+)Viewport height in pixels
formatstringpngpng: All, jpeg: Starter+Output format: png or jpeg
qualitynumber80Starter+JPEG quality (1-100). Only applies when format is jpeg.
fullPagebooleanfalseStarter+Capture the full scrollable page
darkModebooleanfalseStarter+Render page in dark mode (prefers-color-scheme: dark)
deviceScaleFactornumber11x: All, 2x: Pro+, 3x: BusinessDevice pixel ratio for Retina rendering (1, 2, or 3)
hideCookieBannersbooleanfalseAllAuto-hide cookie consent banners
blockAdsbooleanfalsePro+Block ads before capture
cssInjectstringPro+Custom CSS to inject before capture
delaynumber0Pro+Wait this many milliseconds before capture (max 10000)
selectorstringStarter+CSS selector — capture only that element
webhookUrlstringPro+URL to POST the result to when capture is complete
headersobjectBusinessCustom HTTP headers to send with the page request

Code Examples

curl

curl -X POST https://snap.alldevbox.com/api/v1/screenshot \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://github.com", "width": 1920, "height": 1080}' \
  --output screenshot.png

Python

import requests

r = requests.post('https://snap.alldevbox.com/api/v1/screenshot',
    headers={'Authorization': 'Bearer sk_your_api_key'},
    json={
        'url': 'https://github.com',
        'width': 1920,
        'height': 1080,
        'fullPage': True,         # Starter+
        'darkMode': True,         # Starter+
        'blockAds': True,         # Pro+
        'deviceScaleFactor': 2    # Pro+ (2x Retina)
    })

with open('screenshot.png', 'wb') as f:
    f.write(r.content)

Node.js

const fs = require('fs');

const res = await fetch('https://snap.alldevbox.com/api/v1/screenshot', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://github.com',
    format: 'jpeg',
    quality: 90,
    hideCookieBanners: true
  })
});

const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync('screenshot.jpg', buffer);

PHP

$ch = curl_init('https://snap.alldevbox.com/api/v1/screenshot');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer sk_your_api_key',
        'Content-Type: application/json'
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'url' => 'https://github.com',
        'width' => 1920,
        'height' => 1080
    ])
]);
$image = curl_exec($ch);
curl_close($ch);
file_put_contents('screenshot.png', $image);

POST /api/v1/screenshot/html

Render raw HTML as a screenshot. Same parameters as above, but replace url with html.

curl -X POST https://snap.alldevbox.com/api/v1/screenshot/html \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello World</h1>"}' \
  --output screenshot.png

POST /api/v1/pdf — Starter+

Generate a PDF from any URL.

ParamTypeDefaultDescription
urlstringURL to capture (required)
formatstringA4Page size: A4, Letter, Legal, Tabloid
landscapebooleanfalseLandscape orientation
printBackgroundbooleantruePrint background graphics
marginobject{top, right, bottom, left} in CSS units
curl -X POST https://snap.alldevbox.com/api/v1/pdf \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "A4"}' \
  --output page.pdf

POST /api/v1/pdf/html — Starter+

Generate a PDF from raw HTML.

curl -X POST https://snap.alldevbox.com/api/v1/pdf/html \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Invoice #1234</h1><p>Amount: £99.00</p>"}' \
  --output invoice.pdf

POST /api/v1/batch — Business

Capture screenshots across all devices in a single request. Returns a ZIP archive containing one screenshot per device.

ParamTypeDefaultDescription
urlstringURL to capture (required)
formatstringpngOutput format for all screenshots
devicesarrayallOptional array of device keys to capture (omit for all)
curl -X POST https://snap.alldevbox.com/api/v1/batch \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}' \
  --output screenshots.zip

GET /api/v1/usage

Check your current usage and plan details.

curl https://snap.alldevbox.com/api/v1/usage \
  -H "Authorization: Bearer sk_your_api_key"

# Response:
# {"tier":"free","used":42,"limit":100,"remaining":58}

GET /api/v1/tier-info

Get detailed information about your tier's features and allowed devices.

curl https://snap.alldevbox.com/api/v1/tier-info \
  -H "Authorization: Bearer sk_your_api_key"

# Response:
# {
#   "tier": "starter",
#   "features": {
#     "jpeg": true, "fullPage": true, "darkMode": true,
#     "pdf": true, "customDelay": false, "cssInject": false,
#     "blockAds": false, "webhooks": false, "batch": false
#   },
#   "maxDeviceScaleFactor": 1,
#   "allowedDevices": ["1920x1080", "412x915", "430x932", ...],
#   "allDevices": { "1920x1080": "Full HD", ... }
# }

Async Jobs

Submit long-running captures as async jobs.

# Submit job
curl -X POST https://snap.alldevbox.com/api/v1/jobs \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "screenshot", "url": "https://example.com"}'
# {"jobId":"...","status":"queued"}

# Check status
curl https://snap.alldevbox.com/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer sk_your_api_key"

# Download result
curl "https://snap.alldevbox.com/api/v1/jobs/JOB_ID?download" \
  -H "Authorization: Bearer sk_your_api_key" --output result.png

Plans & Limits

PlanScreenshots/moDevicesScaleKey Features
Free $010021xPNG, cookie blocking
Starter $121,000All mobile & tablet1x+ JPEG, full page, PDF, dark mode, custom resolution
Pro $3910,000All + 4K2x+ Ad blocking, CSS injection, delay, webhooks
Business $99100,000All + 4K3x+ Batch capture, custom headers, priority support

Errors

All error responses return JSON with an error field.

CodeMeaningExample
400Invalid request{"error": "url is required"}
401Invalid or missing API key{"error": "Invalid API key"}
403Feature not available on your plan{"error": "CSS injection requires Pro plan or above"}
429Monthly limit reached{"error": "Monthly capture limit reached (100/100)"}
500Server error{"error": "Page failed to load"}

Handling 403 Tier Errors

When you use a feature not available on your plan, you'll get a 403 with a clear message about which plan is required:

# Example: Free tier user trying JPEG format
curl -X POST https://snap.alldevbox.com/api/v1/screenshot \
  -H "Authorization: Bearer sk_free_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "jpeg"}'

# HTTP 403
# {"error": "JPEG format requires Starter plan or above"}