Screenshot API vs Puppeteer and Playwright
By URLBooth · Published · Last updated
A screenshot API is usually the better choice when screenshots are a feature rather than your product: you send a URL and get an image, without operating browsers. Running Puppeteer or Playwright yourself wins when you need full control of the browser, must keep data inside your own network, or already run browser infrastructure.
What is the real difference?
Both approaches drive a real Chromium browser. The difference is who runs it. With Puppeteer or Playwright you own the code, the browser binary, the machines and everything that goes wrong between them. With a screenshot API you own one HTTP call.
import puppeteer from "puppeteer";const browser = await puppeteer.launch();try {const page = await browser.newPage();await page.setViewport({ width: 1440, height: 900 });await page.goto("https://example.com", { waitUntil: "networkidle2" });await page.screenshot({ path: "screenshot.png" });} finally {await browser.close();}
curl --fail-with-body "https://urlbooth.com/v1/screenshots" \-H "Authorization: Bearer $URLBOOTH_API_KEY" \-H "Content-Type: application/json" \-d '{"url":"https://example.com","device":"macbook-pro-14","format":"png"}' \-o screenshot.png
The Puppeteer snippet looks short because it only shows the happy path on one machine. The questions below are what it leaves out.
What do you take on when you run it yourself?
| Concern | Self-hosted Puppeteer or Playwright | Hosted screenshot API |
|---|---|---|
| Infrastructure | You provision servers or containers with the browser's system libraries and fonts, and keep Chromium patched. | Provided. You call an endpoint. |
| Memory and browser lifecycle | Browsers are heavy. You manage concurrency limits, crashed or leaked processes and zombie tabs. | Handled by the provider. |
| Cold starts | Launching a browser per request is slow; keeping browsers warm costs idle compute and adds state to manage. | Not your problem, though each request still takes a few seconds to load a real page. |
| Cookie banners and ads | You write and maintain selectors and request blocklists per site, and they break when sites change. | Built in on URLBooth and best effort. See the cleanup guide. |
| Scaling | Bursts need more machines or a queue. You decide how to back-pressure and retry. | Limits are published (Pro: 60 requests per minute, 10 concurrent). Beyond that you need a larger plan or your own capacity. |
| Cost of ownership | Compute is only part of it. Add engineering time for upgrades, on-call and debugging flaky pages. | A flat subscription (URLBooth Pro is $20 per month for up to 10,000 captures a day). |
| Control | Full: scripts, logins, clicks, custom headers, any Chromium flag. | Limited to the documented options: url, device, format, fullPage, cleanup, frame. |
| Data location | Pages are fetched from your own network. | Pages are fetched by the provider and stored privately for two days. |
Why are consent banners and ads the hidden cost?
A clean screenshot needs more than page.screenshot(). Cookie dialogs, newsletter pop-ups and ad slots cover the content you wanted, and every site does it differently. Self-hosting means keeping a rule list current. A hosted API shares that maintenance across all its users, but it is still best effort: pages that block automated browsers will fail either way. See how URLBooth removes cookie banners.
Which one should you choose?
| If this describes you | Choose |
|---|---|
| Screenshots are a side feature and you want it working this week | Screenshot API |
| You capture public pages and want banners and ads removed | Screenshot API |
| You have no one to maintain browser infrastructure | Screenshot API |
| You need to log in, click through flows or run custom scripts before capturing | Puppeteer or Playwright |
| Pages are on a private network or must not leave your infrastructure | Puppeteer or Playwright |
| You already run browser fleets, or capture volume is large and steady enough to justify the work | Puppeteer or Playwright |
| You test your own app in CI | Playwright (it is a test tool first) |
Many teams start with the API and only move to self-hosting if they outgrow its options. The reverse migration is harder, because you also have to retire the infrastructure you built.
Where to go next
- How to take a website screenshot with an API, with curl, Node.js and Python.
- Compare screenshot APIs side by side.
- Pricing and plan limits.
- API reference.