Render API

HTML to Image API

Turn any HTML string into a pixel-perfect PNG, JPEG, or WebP โ€” OG cards, email previews, reports, charts.

What you can render

Any HTML you can write, we can render to a pixel-perfect image.

๐Ÿ–ผ๏ธ

OG Cards

Generate dynamic Open Graph social share images at 1200ร—630. Inject titles, descriptions, and branding โ€” one render per page, automated.

๐Ÿ“ง

Email Previews

Render HTML email templates to PNG before sending. Catch layout bugs without spinning up a real email client.

๐Ÿ“Š

Dashboard Exports

Render charts, tables, and KPI dashboards as images for reports, Slack digests, or PDF attachments.

๐Ÿ“‘

PDF Covers

Generate custom, branded cover pages as images to prepend to PDF documents. Full CSS support including web fonts.

๐Ÿงพ

Invoice PDFs

Render invoice HTML to a pixel-perfect image, then convert to PDF โ€” or send as PNG for instant preview without download.

API Example

POST any HTML. Receive raw image bytes.

curl

curl -X POST 'https://snapapi.tech/v1/render' \
  -H 'Content-Type: application/json' \
  -d '{
    "html": "<div style=\"background:#0f172a;color:#22c55e;padding:40px;font-size:32px;font-family:monospace\">Hello, SnapAPI</div>",
    "width": 1200,
    "height": 630,
    "format": "png",
    "api_key": "YOUR_KEY"
  }' \
  --output og-card.png

Response is raw PNG bytes โ€” pipe directly to a file, return from your API, or base64-encode for inline use.

Node.js

const fs = require('fs');

const html = `
  <div style="background:#0f172a;color:#f1f5f9;padding:80px;
              font-family:sans-serif;width:1200px;height:630px;
              display:flex;flex-direction:column;justify-content:center">
    <h1 style="font-size:52px;font-weight:800;margin-bottom:16px">
      My Blog Post Title
    </h1>
    <p style="font-size:24px;color:#94a3b8">A short description goes here</p>
  </div>
`;

const res = await fetch('https://snapapi.tech/v1/render', {
  method: 'POST',
  headers: { 'x-api-key': process.env.SNAPAPI_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ html, width: 1200, height: 630, format: 'png' })
});

fs.writeFileSync('og-card.png', Buffer.from(await res.arrayBuffer()));

Standard dimensions

Set any width and height โ€” or use these proven sizes for common formats.

FormatWidthHeightUsed for
OG Image1200px630pxTwitter, Facebook, LinkedIn link previews
Twitter Card1200px600pxTwitter summary_large_image card
Instagram Square1080px1080pxInstagram posts, Pinterest
Email Header600px200pxEmail template header images
CustomanyanyReports, dashboards, certificates

Pricing

Free tier: 100 renders/month โ€” no credit card required. Each render costs one API call, same as any other endpoint. Render is available on Starter plans and above ($9/mo for 1,000 calls). The render endpoint is not available on the free tier for hosted use โ€” but the free API key unlocks all other endpoints. See full pricing โ†’

Start rendering in 60 seconds

Free API key โ€” no credit card, no setup, active in 30 seconds.

Get Free API Key โ†’