ScreenshotAPI

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 GET endpoint. 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: dark on any page.
  • Smart waiting — Wait for network idle, specific selectors, or custom delays.
  • Ad blocking — Remove ads from pages before capture with blockAds.
  • Cookie banner removal — Auto-dismiss cookie consent dialogs with removeCookieBanners.
  • PDF export — Export pages as PDF documents in addition to PNG, JPEG, and WebP.
  • Response caching — Cache responses with a configurable TTL to speed up repeated captures.
  • HTML rendering — Render raw HTML strings directly without navigating to a URL.
  • Stealth mode — Anti-bot-detection mode for pages that block headless browsers.
  • Subscription plans with credit pack top-ups — Flexible subscriptions and pay-as-you-go credit packs.
  • 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 200 free screenshots per month 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.png
const 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)
req, _ := http.NewRequest("GET",
    "https://screenshotapi.to/api/v1/screenshot?url=https://example.com", nil)
req.Header.Set("x-api-key", "sk_live_your_key_here")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

file, _ := os.Create("screenshot.png")
defer file.Close()
io.Copy(file, resp.Body)
require "net/http"
require "uri"

uri = URI("https://screenshotapi.to/api/v1/screenshot?url=https://example.com")
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = "sk_live_your_key_here"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
  http.request(req)
}

File.binwrite("screenshot.png", response.body)
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://screenshotapi.to/api/v1/screenshot?url=https://example.com",
    CURLOPT_HTTPHEADER => ["x-api-key: sk_live_your_key_here"],
    CURLOPT_RETURNTRANSFER => true,
]);

$image = curl_exec($ch);
curl_close($ch);
file_put_contents("screenshot.png", $image);

Each successful screenshot request consumes 1 credit. Failed requests are not charged.

How It Works

  1. You send a GET request to /api/v1/screenshot with the target URL and optional parameters.
  2. ScreenshotAPI launches a headless Chromium browser, navigates to the URL, and waits for the page to load.
  3. A screenshot is captured with your specified dimensions, format, and rendering options.
  4. 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:

HeaderDescription
Content-TypeImage MIME type (image/png, image/jpeg, or image/webp)
x-credits-remainingYour remaining credit balance after this request
x-screenshot-idUnique identifier for this screenshot (useful for support)
x-duration-msTime 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
  • Integrations — Guides for 30+ frameworks, platforms, and automation tools

On this page