Skip to content
shotsmith
Features Docs Guides Pricing Changelog Sign inStart free

Running headless Chrome yourself vs using a screenshot API

An honest look at what it takes to run Puppeteer or Playwright in production for screenshots, and when an API is the better trade.

3 min read

Puppeteer and Playwright make the first screenshot easy: ten lines of code and you have a PNG. Running them reliably in production, for pages you don’t control, is a different job. This is an honest look at what that involves, so you can decide whether to build it yourself or use an API like shotsmith.

What the ten-line version leaves out

  • Infrastructure. Chrome needs dozens of system libraries, plenty of shared memory, and 200–500 MB of RAM per tab. Serverless platforms and slim containers often lack all three, so you end up maintaining a custom image.
  • Fonts and emoji. A bare Linux image renders Chinese, Arabic, Hindi and emoji as empty boxes. Broad font coverage adds hundreds of megabytes.
  • Stability. Chrome processes leak memory and occasionally hang. You need recycling, timeouts at several levels, and cleanup of zombie processes.
  • Concurrency. Open too many tabs and the machine runs out of memory; too few and requests queue. You need a pool, a queue and back-pressure.
  • Knowing when a page is “done”. Lazy-loaded images, web fonts, single-page apps and endless network chatter make “ready” a judgement call. Full-page captures need scrolling first so lazy content appears.
  • The clutter. Cookie banners, ads and chat widgets, which takes filter lists and consent handling (here’s why that’s hard).
  • Bot protection. Many sites block headless browsers outright, and getting past checks legitimately is a moving target.
  • Security. A service that fetches any URL a user gives it can be tricked into requesting your internal network or cloud metadata endpoints, a vulnerability known as server-side request forgery (SSRF). Every redirect and DNS lookup needs checking.
  • Everything around it. Storage, signed links, retries, webhooks, caching, PDFs, video encoding, usage limits for your own customers.

When building it yourself makes sense

  • You only capture your own pages, at low volume, and a slow or failed screenshot isn’t a problem.
  • You need deep browser automation (multi-step logins, complex interactions) that goes beyond capturing a page.
  • Pages can’t leave your network, for regulatory reasons.
  • You already run browser infrastructure, for example for end-to-end tests.

When an API is the better trade

  • You capture pages you don’t control, where banners, bot checks and odd layouts are the norm.
  • Screenshots are part of your product, so reliability and speed matter to your customers.
  • You’d rather spend engineering time on your product than on keeping Chrome alive.
  • Your volume is uneven: paying per render beats running servers for peaks.

Compare the cost honestly

A single machine running Chrome is cheap; the engineering time to make it reliable usually isn’t. Count the hours to build the pieces above, plus ongoing maintenance as Chrome and websites change, against per-render pricing. At shotsmith, failed renders and cache hits are free, and the free plan includes 100 renders a month, so you can measure it on your own pages before deciding.

If you do build it yourself, the option reference is a useful checklist of the edge cases a production renderer has to handle.