# SnapHTML > SnapHTML renders an HTML document, a URL, or a saved template in a real browser and returns the finished PDF, PNG, WebP, or JPG as the response body. One HTTPS request, no SDK, no job queue, no polling. SnapHTML lives at https://snhtml.com. The API is served from https://api.snhtml.com. Create an account at https://snhtml.com/sign-up (free plan, 100 renders a month, no card) and an API key in the dashboard at https://snhtml.com/dashboard under "API Keys". Keys are prefixed `snhtml_` and are shown once, at creation. Authenticate with `Authorization: Bearer snhtml_...` and `Content-Type: application/json`. Two endpoints, both POST: - `POST https://api.snhtml.com/v1/render` — send `html` (a complete document) or `url` (a publicly reachable page). At least one is required; `html` wins if both are sent. - `POST https://api.snhtml.com/v1/render/template` — send `templateId` (a template saved in the dashboard) plus `variables`, an object substituted into the template's `{{ placeholder }}` names. `html` and `url` are not accepted here. A successful response is the raw file bytes, not JSON: `content-type` is `image/png`, `image/webp`, `image/jpeg`, or `application/pdf`, with a `content-disposition` filename. Branch on the HTTP status, never on the body shape. A failure is JSON: `{"error": "..."}`. Common body fields (all optional unless noted): `format` (`png` default, `webp`, `jpg`, `pdf`), `quality` (1-100, jpg and webp only), `width` (1024), `height` (768), `deviceScaleFactor` (2, max 4), `fullPage` (false), `waitUntil` (`domcontentloaded` default, `load`, `networkidle`), `waitForTimeout` (0, max 10000 ms), `media` (`screen` or `print`), `transparentBackground` (false, PNG and WebP), `printBackground` (true, PDF), `margin` (PDF, CSS lengths), `scale` (1, PDF, 0.1-2), `pdfFormat` (e.g. `A4`), `preferCSSPageSize` (false), `fileName` (without extension). Unknown fields are rejected with 400 — the request body is validated strictly. Status codes: 400 invalid body, 401 bad or missing key, 402 monthly render limit reached, 404 template not found, 5xx render failure (retry with backoff). Every render attempt counts against the monthly quota once it starts, including one that fails mid-render; requests rejected for a bad key or an invalid body cost nothing. Relative URLs in `html` have no origin to resolve against — reference styles, fonts, and images by absolute URL, or inline them. For AI agents: prefer the markdown files below over scraping HTML. Any docs page also serves raw markdown by appending `.md` to its URL. ## Docs - [Docs index](https://snhtml.com/docs): all pages, human-readable - [llms.txt (docs)](https://snhtml.com/docs/llms.txt): the docs site's own context map - [llms-full.txt (docs)](https://snhtml.com/docs/llms-full.txt): every docs page as one markdown file - [Introduction (Markdown)](https://snhtml.com/docs/index.md): what it is, sources, output formats - [Quickstart (Markdown)](https://snhtml.com/docs/quickstart.md): key, request, file, in cURL / TypeScript / Python ## HTTP API - [HTTP API (Markdown)](https://snhtml.com/docs/api.md): auth, both endpoints, response headers, per-request limits - [Render options (Markdown)](https://snhtml.com/docs/render-options.md): every request body field, with defaults and ranges - [Errors (Markdown)](https://snhtml.com/docs/errors.md): status codes, causes, and why a render can look wrong ## Templates - [Templates (Markdown)](https://snhtml.com/docs/templates.md): placeholder syntax, the template endpoint, HTML escaping - [Dashboard (Markdown)](https://snhtml.com/docs/dashboard.md): API keys, templates, billing, sandbox ## Plans - [Plans and limits (Markdown)](https://snhtml.com/docs/limits.md): quotas, what counts as a render, per-request caps - [Pricing (HTML)](https://snhtml.com/#pricing): Free 100, Builder 2,000, Pro 10,000, Max 50,000 renders a month ## Product - [Home](https://snhtml.com): product, workflow, pricing - [Sign up](https://snhtml.com/sign-up): free plan, no card - [Sign in](https://snhtml.com/sign-in): existing accounts - [Dashboard](https://snhtml.com/dashboard): API keys, templates, billing, and a render sandbox - [Terms](https://snhtml.com/legal/terms-of-service): terms of service - [Privacy](https://snhtml.com/legal/privacy-policy): privacy policy ## Optional - [GitHub](https://github.com/twendykirn/snhtml): source repository