Browser Rendering API: define the result before the browser
A browser rendering API converts a URL into the state a modern browser produces after HTML parsing, stylesheet layout, font loading, JavaScript execution, and asynchronous content work. That process is more than downloading markup.
Snapshot Site keeps the input model deliberately URL-based. Hosting a template or preview gives relative assets and scripts a real origin and prevents the API from pretending an isolated HTML string has the same environment as the application.
The output choice changes the capture policy. A screenshot needs visual stability, a PDF needs print-aware CSS and pagination review, and rendered HTML needs careful downstream sanitization and extraction.
A production workflow
A URL is only the starting input. Browser state, responsive dimensions, asset readiness, consent UI, and dynamic content decide the final pixels or HTML. A useful implementation separates request creation, browser work, result validation, storage, and downstream review. That separation makes failures observable and prevents a rendering option from becoming undocumented business logic.
- Expose the intended page at an approved URL.
- Choose viewport and output format.
- Apply readiness and cleanup options.
- Validate and persist the returned asset.
Version the rendering specification with the artifact: route or document identity, viewport, readiness signal, CSS or JavaScript preparation, output format, and capture time. This turns a visual result into traceable production data.
Controls that determine the output
Asset availability
Fonts, images, and scripts must be reachable from the rendering environment. A local filesystem path in CSS cannot resolve in the hosted browser.
Hydration and data
Client-rendered pages may complete after navigation. Wait for the smallest reliable interval or use a deterministic preview state.
Print behavior
PDF output follows browser print behavior. Test page breaks, backgrounds, fixed elements, and print styles rather than applying screenshot assumptions.
HTML handling
Treat returned HTML as untrusted web content. Parse it in a controlled backend and never inject it blindly into an administrative interface.
Security and product boundary
Snapshot Site renders reachable URLs. It does not accept arbitrary raw HTML as a screenshot input and does not expose a persistent browser session for interactive flows.
Allow only approved rendering destinations and review any preparation code before execution. Credentials stay server-side, while screenshots, HTML, and PDFs inherit the access and retention rules of the content they contain.
Production checklist
- Publish a stable preview URL.
- Make dependent assets reachable.
- Choose output based on the consumer.
- Remove only documented transient regions.
- Store request settings with every artifact.
Follow the API documentation for supported rendering controls, explore JavaScript rendering for dynamic state, and consult pricing before expanding a representative fixture set.