HTML in. Binary out.

Generate pixel-perfect documents from raw HTML asPDFPNG

SnapHTML accepts HTML payloads, renders them in a browser context, and returns the final file as a binary response. Send one document per request and receive a PDF or PNG directly in the response body.

POST /v1/render
await fetch("https://api.snhtml.com/v1/render", {
  method: "POST",
  headers: {
    "authorization": "Bearer sn_live_...",
    "content-type": "application/json"
  },
  body: JSON.stringify({
    html: "<main><h1>Invoice #1842</h1></main>",
    format: "png",
    width: 1024,
    height: 900,
    fullPage: false,
    fileName: "invoice-1842"
  })
});

What you specify

The request describes the browser, the output, and the document.

Send raw HTML

Post the exact markup you already generate. Inline styles, external stylesheets, and Tailwind CSS classes can all render with it.

Choose PDF or PNG

Return a print-ready PDF for documents or a pixel-perfect PNG for previews, invoices, cards, and visual exports.

Set the viewport

Choose width, height, and full-page capture settings for each individual render.

API-first access

A small JSON request gives you one binary response. No SDK, browser automation, or rendering worker required.

Keep the integration small enough to remember.

The API is designed for server-side use from billing systems, CRMs, email pipelines, and screenshot workers. You control the HTML template and receive bytes ready to store, stream, or attach.

1

Create an API key.

2

POST HTML with render settings.

3

Read the response body as a PDF or PNG binary.

Request body

Every render option you can send.

FieldTypeRequiredDescription
htmlstringRequiredRaw HTML document to render.
format"png" | "pdf"OptionalOutput format. Defaults to png.
widthnumberOptionalViewport width in pixels. Defaults to 1024.
heightnumberOptionalViewport height in pixels. Defaults to 768.
fullPagebooleanOptionalCapture the full page for PNG output.
deviceScaleFactornumberOptionalViewport scale factor from 1 to 4.
waitUntil"load" | "domcontentloaded" | "networkidle"OptionalPage load state before rendering.
waitForTimeoutnumberOptionalExtra wait in milliseconds before capture.
media"screen" | "print"OptionalCSS media mode used during render.
reducedMotion"reduce" | "no-preference"OptionalMotion preference used by the browser.
transparentBackgroundbooleanOptionalUse a transparent PNG background.
omitBackgroundbooleanOptionalAlias for transparent PNG background.
printBackgroundbooleanOptionalInclude CSS backgrounds in PDF output.
marginobjectOptionalPDF margins with top, right, bottom, and left strings.
scalenumberOptionalPDF scale from 0.1 to 2.
pdfFormatstringOptionalPDF paper format such as A4 or Letter.
preferCSSPageSizebooleanOptionalUse CSS @page size for PDF output.
fileNamestringOptionalAttachment filename without extension.

Pricing

Start tiny, then pay for the render volume you actually need.

Starter

$1/mo

For low-volume automation and tests.

  • 100 renders / month
  • PNG and PDF output
  • Direct binary response

Builder

$9/mo

For apps generating customer-facing documents.

  • 2,000 renders / month
  • PNG and PDF output
  • Direct binary response

Pro

$29/mo

For production queues and higher throughput.

  • 10,000 renders / month
  • PNG and PDF output
  • Direct binary response

Max

$99/mo

For larger production workloads.

  • 50,000 renders / month
  • PNG and PDF output
  • Direct binary response

Get started

Ship your first render in seconds.

Request API key