📸 PixelShot API Documentation
Base URL: https://pixelshot.dev
Authentication
Every request requires an API key. Pass it as a query parameter or header:
?key=YOUR_API_KEY
# or
X-Api-Key: YOUR_API_KEY
Get a free API key at pixelshot.dev.
Endpoints
GET /api/screenshot
Capture a screenshot of any URL.
GET https://pixelshot.dev/api/screenshot?key=YOUR_KEY&url=https://example.com
Returns the image directly (binary). Content-Type matches the requested format.
GET /api/usage
Check your current usage and remaining quota.
GET https://pixelshot.dev/api/usage?key=YOUR_KEY
Response:
{"plan":"free","usage":5,"limit":100,"remaining":95,"month":"2026-02"}
POST /api/checkout
Create a Stripe Checkout session to upgrade to Pro.
POST https://pixelshot.dev/api/checkout
Content-Type: application/json
{"apiKey":"YOUR_KEY"}
Response:
{"url":"https://checkout.stripe.com/..."}
Parameters
| Parameter | Type | Default | Description |
url | string | required | URL to capture |
key | string | required | Your API key |
width | int | 1280 | Viewport width in px (max 3840) |
height | int | 800 | Viewport height in px (max 2160) |
format | string | png | Output format: png, jpeg, webp, pdf |
quality | int | 80 | Image quality 1-100 (jpeg/webp only) |
full | bool | false | Capture full scrollable page |
dark | bool | false | Force dark mode / prefers-color-scheme: dark |
delay | int | 0 | Wait ms before capture (max 10000) |
scale | int | 1 | Device scale factor (2 = retina) |
device | string | — | Device preset: iphone-12, iphone-14, ipad, pixel-7, macbook, desktop-hd |
block_cookies | bool | false | Remove cookie/GDPR consent banners |
block_ads | bool | false | Block ads from major ad networks |
ua | string | — | Custom User-Agent string |
Code Examples
cURL
curl "https://pixelshot.dev/api/screenshot?key=YOUR_KEY&url=https://github.com" -o screenshot.png
# Full page, dark mode, JPEG
curl "https://pixelshot.dev/api/screenshot?key=YOUR_KEY&url=https://github.com&full=true&dark=true&format=jpeg&quality=90" -o github-dark.jpg
# Retina (2x)
curl "https://pixelshot.dev/api/screenshot?key=YOUR_KEY&url=https://example.com&scale=2&width=1440" -o retina.png
Python
import requests
response = requests.get("https://pixelshot.dev/api/screenshot", params={
"key": "YOUR_KEY",
"url": "https://github.com",
"width": 1280,
"format": "png"
})
with open("screenshot.png", "wb") as f:
f.write(response.content)
print(f"Usage: {response.headers.get('X-Usage')}")
print(f"Remaining: {response.headers.get('X-Remaining')}")
JavaScript (Node.js)
const fs = require('fs');
const params = new URLSearchParams({
key: 'YOUR_KEY',
url: 'https://github.com',
width: '1280',
format: 'png'
});
const res = await fetch(`https://pixelshot.dev/api/screenshot?${params}`);
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync('screenshot.png', buffer);
console.log('Usage:', res.headers.get('x-usage'));
console.log('Remaining:', res.headers.get('x-remaining'));
JavaScript (Browser / Fetch)
const params = new URLSearchParams({
key: 'YOUR_KEY',
url: 'https://github.com',
format: 'png'
});
const res = await fetch(`https://pixelshot.dev/api/screenshot?${params}`);
const blob = await res.blob();
const imgUrl = URL.createObjectURL(blob);
// Display in an img tag
document.getElementById('preview').src = imgUrl;
PHP
$url = "https://pixelshot.dev/api/screenshot?"
. http_build_query([
'key' => 'YOUR_KEY',
'url' => 'https://github.com',
'width' => 1280,
'format' => 'png'
]);
$image = file_get_contents($url);
file_put_contents('screenshot.png', $image);
Ruby
require 'net/http'
require 'uri'
uri = URI.parse("https://pixelshot.dev/api/screenshot")
uri.query = URI.encode_www_form(
key: "YOUR_KEY",
url: "https://github.com",
format: "png"
)
response = Net::HTTP.get_response(uri)
File.write("screenshot.png", response.body)
| Header | Description |
X-Usage | Screenshots used this month |
X-Remaining | Screenshots remaining this month |
Content-Type | image/png, image/jpeg, or image/webp |
Error Responses
| Code | Meaning |
400 | Missing or invalid parameters |
401 | Invalid or missing API key |
429 | Monthly limit reached — upgrade to Pro |
500 | Screenshot failed (timeout, invalid URL, etc.) |
Rate Limits
| Plan | Screenshots/month | Price |
| Free | 100 | $0 |
| Pro | 5,000 | $9/mo |
← Back to PixelShot