FAQ · JavaScript & SPAs

Can a Screenshot API render JavaScript-heavy SPAs correctly?

Yes. Leading Screenshot APIs run a real Chromium-based headless browser, so React, Vue, Angular, and Svelte apps render exactly as they do for a real user — including client-side routing, data fetching, and dynamic styles.

Why real Chromium matters

Some older or cheaper screenshot services fetch pages with a simple HTTP client — they get the raw HTML source but never execute JavaScript. This means SPAs that fetch their content client-side will appear as empty shells in the screenshot.

SnapshotFlow and other leading APIs use a real headless Chromium process which fully executes JavaScript, handles async data fetching, runs CSS animations, applies web fonts, and renders SVGs — identical to what a visitor sees in Chrome.

Wait strategies to capture fully hydrated pages

The key challenge is knowing when a JavaScript app is done rendering. Use one of these four wait strategies via the wait_for parameter:

Strategy Best for
wait_for=networkidle Pages that load data via API calls — waits until no more network requests fire
wait_for=.my-selector Waiting for a specific DOM element (e.g., a loaded chart or a hero image)
delay=2000 Fixed pause for pages with animations or timers
wait_for=window.__ready===true Custom JavaScript expression — most precise for apps you control
GET https://api.snapshotflow.com/screenshot
  ?url=https://my-react-app.com/dashboard
  &wait_for=networkidle

Common JavaScript rendering issues and fixes

  • Loading spinners captured instead of content. Switch from a delay to a wait_for CSS selector that only appears when data is loaded.
  • Fonts not rendering. Some custom web fonts require additional load time. Add a short delay=500 after the selector wait.
  • Charts blank on first render. Chart libraries (Chart.js, D3) animate on load. Use delay=1000 or detect the canvas completion event.
  • Content behind auth gates showing login screen. Pass session cookies with your API request — see the authenticated pages FAQ.

Capture your SPA today

SnapshotFlow uses real Chromium with all four wait strategies. 200 free screenshots per month — no credit card needed.

Get started free

← Back to all FAQ