I benchmarked screenshot APIs on RapidAPI. The fastest took 6 seconds. Most took 14-21 seconds. Some had 74% uptime.
So I built my own. It does screenshots in 2.1 seconds and PDFs in 1.2 seconds.
The Problem
If you've ever tried to programmatically capture a webpage, you know the pain:
- Self-hosted Puppeteer = server maintenance, memory leaks, Chrome crashes
- Screenshot-as-a-service APIs = slow (6-21 seconds), expensive ($50-300/month), unreliable (74-94% uptime)
- Playwright in CI = fine for tests, terrible for production APIs
I needed something fast, reliable, and cheap. So I built it on Apify's Standby infrastructure.
The Architecture
The secret to sub-3-second delivery is browser pre-warming:
- On startup, launch Chromium via Puppeteer and keep it running
- For each request, create a new page (not a new browser)
- Navigate, wait for network idle, capture
- Close the page, return the result
- Cache results for 10 minutes (same URL + same params = instant)
This avoids the 3-5 second cold start that kills most screenshot APIs.
Benchmarks
| API | Screenshot Time | PDF Time | Uptime |
|---|---|---|---|
| This API | 2.1s | 1.2s | 100% |
| Competitor A | 8.4s | N/A | 94% |
| Competitor B | 14.2s | N/A | 90% |
| Competitor C | 21s | 15s | 74% |
Endpoints
Screenshot
GET /screenshot?url=https://github.com&width=1920&height=1080&format=png&fullPage=true
Parameters: url, width (320-3840), height (200-2160), format (png/jpeg/webp), fullPage, quality (1-100), delay (ms).
GET /pdf?url=https://github.com&format=A4&landscape=false
Parameters: url, format (A4/Letter/Legal), landscape, printBackground.
Batch (up to 20 URLs)
POST /batch
{
"urls": ["https://google.com", "https://github.com"],
"width": 1280,
"format": "jpeg"
}
Response Formats
Binary (default): Raw image/PDF bytes with Content-Type header.
Base64 JSON (set Accept: application/json):
{
"base64": "iVBORw0KGgo...",
"mimeType": "image/png",
"size": 15856,
"latencyMs": 2172
}
Use Cases
- Visual QA Testing — Screenshot every page after deployment, diff against baselines
- Social Media Cards — Generate OG images for link previews
- Competitive Monitoring — Daily screenshots of competitor pricing pages
- PDF Reports — Convert web dashboards to downloadable PDFs
- Web Archiving — Capture pages before they change
Pricing
- Screenshots: $0.005 each ($5 per 1,000)
- PDFs: $0.008 each ($8 per 1,000)
- Only charged on success (failed captures = free)
Try It
- Apify Store: Screenshot & PDF API
- Also on RapidAPI: Search "Website Screenshot PDF"
- Built with Puppeteer on Apify Standby (always-on HTTP, no queue)
The code uses apify/actor-node-puppeteer-chrome as the base image. Spec was generated using OpenSpec + Codex.
Questions? @ai_in_it on X.
Top comments (0)