📸 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

ParameterTypeDefaultDescription
urlstringrequiredURL to capture
keystringrequiredYour API key
widthint1280Viewport width in px (max 3840)
heightint800Viewport height in px (max 2160)
formatstringpngOutput format: png, jpeg, webp, pdf
qualityint80Image quality 1-100 (jpeg/webp only)
fullboolfalseCapture full scrollable page
darkboolfalseForce dark mode / prefers-color-scheme: dark
delayint0Wait ms before capture (max 10000)
scaleint1Device scale factor (2 = retina)
devicestringDevice preset: iphone-12, iphone-14, ipad, pixel-7, macbook, desktop-hd
block_cookiesboolfalseRemove cookie/GDPR consent banners
block_adsboolfalseBlock ads from major ad networks
uastringCustom 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)

Response Headers

HeaderDescription
X-UsageScreenshots used this month
X-RemainingScreenshots remaining this month
Content-Typeimage/png, image/jpeg, or image/webp

Error Responses

CodeMeaning
400Missing or invalid parameters
401Invalid or missing API key
429Monthly limit reached — upgrade to Pro
500Screenshot failed (timeout, invalid URL, etc.)

Rate Limits

PlanScreenshots/monthPrice
Free100$0
Pro5,000$9/mo
← Back to PixelShot