Introduction
ScreenshotAPI is a fast, reliable API for capturing web page screenshots on demand. Get started in under a minute.
What is ScreenshotAPI?
ScreenshotAPI lets you capture pixel-perfect screenshots of any web page with a single HTTP request. Send a URL, get back an image — PNG, JPEG, or WebP. It's built for developers who need programmatic screenshot generation for OG images, thumbnails, visual regression testing, archival, and more.
Key features:
- Simple REST API — One
GETendpoint. Pass a URL, receive an image. - Multiple formats — PNG, JPEG, and WebP with configurable quality.
- Full-page captures — Scroll the entire page or capture the viewport.
- Dark mode support — Force
prefers-color-scheme: darkon any page. - Smart waiting — Wait for network idle, specific selectors, or custom delays.
- Credit-based pricing — Pay only for what you use. No monthly subscriptions.
- Auto top-up — Never run out of credits with automatic replenishment.
Quick Start
Create an account
Sign up at screenshotapi.to/sign-up. You'll receive 5 free credits to start.
Generate an API key
Navigate to your dashboard and create a new API key. Copy it — you'll only see the full key once.
Take your first screenshot
curl "https://screenshotapi.to/api/v1/screenshot?url=https://example.com" \
-H "x-api-key: sk_live_your_key_here" \
--output screenshot.pngconst response = await fetch(
'https://screenshotapi.to/api/v1/screenshot?url=https://example.com',
{
headers: { 'x-api-key': 'sk_live_your_key_here' }
}
)
const imageBuffer = await response.arrayBuffer()import requests
response = requests.get(
"https://screenshotapi.to/api/v1/screenshot",
params={"url": "https://example.com"},
headers={"x-api-key": "sk_live_your_key_here"}
)
with open("screenshot.png", "wb") as f:
f.write(response.content)Each successful screenshot request consumes 1 credit. Failed requests are not charged.
How It Works
- You send a
GETrequest to/api/v1/screenshotwith the target URL and optional parameters. - ScreenshotAPI launches a headless Chromium browser, navigates to the URL, and waits for the page to load.
- A screenshot is captured with your specified dimensions, format, and rendering options.
- The binary image data is returned directly in the response body.
Screenshots are generated in real time and are not stored on our servers. The image is streamed back to you, and no copy is retained.
Response Headers
Every successful response includes useful metadata:
| Header | Description |
|---|---|
Content-Type | Image MIME type (image/png, image/jpeg, or image/webp) |
x-credits-remaining | Your remaining credit balance after this request |
x-screenshot-id | Unique identifier for this screenshot (useful for support) |
x-duration-ms | Time taken to generate the screenshot in milliseconds |
Next Steps
- Authentication — Learn how to create and manage API keys
- Credits — Understand the credit system and pricing
- Screenshot API — Full parameter reference for the screenshot endpoint
- JavaScript SDK — Use the typed JavaScript/TypeScript client