Screenshot API for Developers

Replace self-hosted Puppeteer with a single GET endpoint. Capture any URL as PNG, WebP, PDF. Free tier, Bearer auth, no SDK required.

Vitalii Holben Updated

Puppeteer flies on your laptop. Problems start in production. In Docker it eats 400MB per instance, fonts look wrong on Linux, and the cookie popup you never saw locally covers half the page in production. At some point you realize the screenshot code has more error handling than the feature it supports.

The alternative is an HTTP call. ScreenshotRun takes a URL and gives back an image - PNG, WebP, PDF, whatever you need. One GET request with query parameters, Bearer token auth, done. Everything below that layer - the browser pool, the font packages, the memory limits, the zombie process cleanup - is somebody else's problem.

One endpoint, every capture

Everything works through one GET request with query parameters. No SDK to install, no client library to keep updated. Version bumps do not break your integration. Test with curl, integrate in any language that makes HTTP calls:

curl -G "https://api.screenshotrun.com/v1/screenshots/capture"   -H "Authorization: Bearer $SCREENSHOTRUN_KEY"   --data-urlencode "url=https://example.com"   --data-urlencode "format=webp"   --data-urlencode "width=1280"   --data-urlencode "height=800"   --data-urlencode "response_type=image"   -o screenshot.webp

That is the simplest call. Add parameters for what you need - full_page=true for the entire scrollable page, device=mobile for a phone viewport, dark_mode=true for the dark color scheme. Every parameter is a query string key. No request body, no JSON payload, no multipart form. You can build the URL in a spreadsheet if you wanted to.

Pick your response format: raw image bytes (response_type=image) or a JSON object (response_type=json) with the screenshot URL and optional metadata. Pick whichever fits your pipeline.

Why not just run Puppeteer yourself

If you need one screenshot a day, Puppeteer on your laptop is fine. The problems start when you scale. Each headless Chrome instance consumes a few hundred MB of RAM. Ten concurrent captures need a machine with several GB free just for browsers. Chrome processes sometimes hang and need to be force-killed. The page.goto timeout fires differently on slow pages depending on the waitUntil strategy you pick.

Then there is the rendering environment. Fonts on macOS are absent on Ubuntu, and emoji render as blank boxes on some Linux distros. Sites that check navigator.platform detect headless Chrome and serve degraded content. Full-page screenshots stitch multiple viewport captures together, and the stitching breaks on pages with position: sticky elements that duplicate across segments.

Self-hosting is a full infrastructure project: Dockerfile with Chrome, process manager for zombie cleanup, font packages, memory limits, health checks, restart policies. The API replaces all of that with a URL you call.

Handling the hard rendering problems

Lazy-loaded images are the most common issue. A page shows placeholder boxes below the fold because the Intersection Observer never fired - your headless browser captured before the user "scrolled." The full_page=true parameter handles this by scrolling the page internally before capture, triggering lazy load observers along the way.

Cookie consent banners cover 30-60% of the viewport on EU-targeted sites. block_cookies=true removes them. Chat widgets sit in the bottom-right corner of everything. block_chats=true removes those. Ad placements inject unpredictable content. block_ads=true. For anything else, hide_selectors takes a list of CSS selectors to set display: none on before capture.

Single-page apps that render client-side need extra time. React, Vue, Next.js - they all hydrate after initial load. The delay parameter waits a specified number of milliseconds after the page reports "loaded" before taking the screenshot. For more precision, wait_for_selector pauses until a specific DOM element appears - useful when you know the data table or chart component has a predictable class name.

Sites behind bot detection (Cloudflare, DataDome, PerimeterX, Akamai) block standard headless Chrome. The stealth parameter masks the signals those systems look for. It is not perfect on every site, but it handles the vast majority of protected pages that would return a CAPTCHA challenge to raw Puppeteer.

Language examples

Same endpoint, same parameters, any language. The examples below all capture a full-page screenshot with cookie banners removed:

Python

import httpx, os

resp = httpx.get(
    "https://api.screenshotrun.com/v1/screenshots/capture",
    params={
        "url": "https://example.com",
        "format": "webp",
        "full_page": "true",
        "block_cookies": "true",
        "response_type": "image",
    },
    headers={"Authorization": f"Bearer {os.environ['SCREENSHOTRUN_KEY']}"},
    timeout=60,
)

with open("screenshot.webp", "wb") as f:
    f.write(resp.content)

Node.js

const params = new URLSearchParams({
    url: "https://example.com",
    format: "webp",
    full_page: "true",
    block_cookies: "true",
    response_type: "image",
});

const res = await fetch(
    `https://api.screenshotrun.com/v1/screenshots/capture?${params}`,
    { headers: { Authorization: `Bearer ${process.env.SCREENSHOTRUN_KEY}` } }
);

const buffer = Buffer.from(await res.arrayBuffer());
await fs.writeFile("screenshot.webp", buffer);

PHP

$params = http_build_query([
    "url" => "https://example.com",
    "format" => "webp",
    "full_page" => "true",
    "block_cookies" => "true",
    "response_type" => "image",
]);

$ch = curl_init("https://api.screenshotrun.com/v1/screenshots/capture?" . $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer " . getenv("SCREENSHOTRUN_KEY"),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$image = curl_exec($ch);
curl_close($ch);

file_put_contents("screenshot.webp", $image);

Go, Ruby, Rust, Java - anything that can make an HTTP GET request works. The Python and Node.js integration pages have more detailed examples with error handling and batch processing.

Serverless and edge functions

Lambda functions have a 250MB package limit. Chromium alone exceeds that. Cloudflare Workers cap at 1MB and Vercel edge functions timeout after 25 seconds. None of these can run a headless browser, but all of them can make an HTTP request.

The API is built for serverless. Call it from your Lambda, Cloudflare Worker, Vercel function, or any runtime that speaks HTTP. The response comes back as either raw bytes or a JSON payload with a hosted URL. For functions that need to stay under response size limits, the JSON response with a URL is the better choice - your function returns the URL, the client fetches the image directly.

Async processing with webhooks

Some pages take 10-15 seconds to render. A chart-heavy dashboard, a page that loads data via multiple API calls, a site with heavy JavaScript that takes seconds to initialize. Your application should not block a user request waiting for that.

The webhook parameter decouples the capture from the response. Fire the API request, get back a 202 immediately, and receive a POST to your webhook URL when the screenshot is ready:

curl -G "https://api.screenshotrun.com/v1/screenshots/capture"   -H "Authorization: Bearer $SCREENSHOTRUN_KEY"   --data-urlencode "url=https://heavy-dashboard.example.com"   --data-urlencode "format=png"   --data-urlencode "full_page=true"   --data-urlencode "delay=5000"   --data-urlencode "webhook_url=https://your-app.com/api/screenshot-ready"   --data-urlencode "response_type=json"

Your webhook endpoint receives the screenshot URL and metadata when the capture completes. Process it on your own schedule - store it, resize it, attach it to a record in your database. This pattern scales to hundreds of concurrent captures without blocking your application threads.

Caching and cutting costs

Set cache_ttl to avoid re-rendering pages that have not changed. Set it to 3600 (one hour) for frequently accessed URLs. If the same URL was captured within the TTL window, the API returns the cached result instantly - no rendering, no credit consumed.

For thumbnail grids and directory pages where many users see the same set of URLs, caching cuts your usage by 80-90%. A link preview feature where users paste popular URLs (GitHub repos, Twitter profiles, YouTube videos) benefits enormously from even a short cache window.

WebP at quality 80-85 produces files 30-40% smaller than PNG at visually equivalent quality. Unless you need pixel-perfect lossless output for visual regression testing, WebP is the better default. AVIF is even smaller but slower to encode and not universally supported in image tags yet.

Beyond URL captures

The API accepts HTML directly through the html parameter. Render a custom template to an image without hosting a page. This is how developers build dynamic OG image generators, certificate templates, invoice layouts, email header images, ticket designs - pass HTML with inline styles, get back a pixel-perfect PNG or WebP.

Markdown content works the same way. The markdown parameter accepts raw Markdown text for Markdown content. Pass raw Markdown, the API renders it with sensible defaults and returns an image. Useful for turning README files or documentation snippets into shareable images.

With extract_metadata, the response includes the page title, description, and other meta information alongside the screenshot. One API call gives you everything needed for a link preview card - thumbnail image plus text - without a separate scraping step.

What the API does not do

It does not run your JavaScript test suite. Captures come back as images - pixel diffing falls outside its scope. Pixel diffing is your responsibility. Tools like Pixelmatch and reg-suit handle the comparison side. BackstopJS does the same at a higher level. The API produces the images they consume.

Rendering parity with your local Chrome is not guaranteed either. The rendering environment uses a specific Chromium version with a specific set of system fonts. If your page depends on a commercial font that is not web-loaded, the fallback font will render instead. Web fonts loaded via Google Fonts, Adobe Fonts, Bunny Fonts, self-hosted WOFF2 files work normally.

And not every bot protection system yields to stealth mode. Stealth mode handles most common anti-bot tools, but some sites with aggressive JavaScript challenges or mandatory human interaction (reCAPTCHA v3 score thresholds, hCaptcha) may still block automated access.

Start building

You get 200 screenshots per month on the free tier. No credit card, no approval process, no "schedule a demo" form. Sign up and grab your API key from the dashboard. Your first capture takes under a minute. The curl example at the top of this page works as-is once you have a key.

When the free tier runs out, paid plans start at $9/month. Usage scales with your application - a hobby project stays on the free tier, a production feature with real traffic upgrades when it needs to. No annual contracts, cancel anytime.

FAQ#

No. The API is a single GET endpoint with query parameters. Any language or tool that makes HTTP requests works - curl, Python requests, Node.js fetch, Go net/http, PHP curl. No package to install, no dependency to maintain.

Two options. Set response_type=image to get raw image bytes in the format you specified (PNG, WebP, JPEG, AVIF, TIFF, PDF). Set response_type=json to get a JSON object with the hosted screenshot URL, file size, dimensions, and optional page metadata.

Yes. The API is an HTTP GET call with no binary dependencies. It works from Lambda, Cloudflare Workers, Vercel functions, Deno Deploy, Fly.io - any environment that can make an outbound HTTP request. No headless Chrome needed on your side.

Use the webhook_url parameter. The API returns a 202 immediately and sends a POST to your webhook URL when the capture finishes. For synchronous calls, the delay parameter waits a specified number of milliseconds after page load. The wait_for_selector parameter pauses until a specific DOM element appears.

API calls return a 429 status code when you hit the monthly limit. Paid plans start at nine dollars per month with higher limits. Upgrade or downgrade anytime from the dashboard. No annual contracts.

It handles most common bot detection systems including Cloudflare, DataDome, PerimeterX. Sites with aggressive JavaScript challenges or mandatory CAPTCHA interaction may still block automated access. For standard business websites and SaaS products, stealth works reliably.

Written by

Vitalii Holben

Co-founder and CEO of ScreenshotRun. Full-stack developer building screenshot API tools that help developers capture, automate, and monitor web pages at scale. Based in Europe, shipping code since 201...

Screenshot API in a few clicks

Free plan includes 200 screenshots every month. No credit card required.

Sign up → copy your key → make your first call