ScreenshottyScreenshotty
FeaturesDocumentationPricingBlog
HTML to Image

Render HTML & CSS to Images

POST your markup, get back a pixel-perfect image. Open Graph images, social cards, certificates, and dynamic banners — generated from templates you control.

The most reliable way to generate dynamic images is to design them as HTML and CSS — the layout tools you already know — and render them in a real browser. Screenshotty accepts raw HTML in the html field, applies your CSS (inline, embedded, or injected via css_code), executes JavaScript, and returns the rendered image.

This is the engine behind Open Graph image pipelines, personalized social cards, email banners, and certificate generators.

Node.js — generate an OG image
const html = `
<div style="width:1200px;height:630px;display:flex;align-items:center;
justify-content:center;background:#0f172a;color:white;
font-family:sans-serif;font-size:64px;">
Hello, ${user.name}!
</div>`;
const response = await fetch("https://api.screenshotty.link/api/v1/screenshot", {
method: "POST",
headers: {
"X-Api-Key": process.env.SCREENSHOTTY_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
html,
format: "image/png",
viewport_width: 1200,
viewport_height: 630,
}),
});

Everything You Need, Built In

Real browser rendering

Web fonts, flexbox, grid, gradients, and emoji render exactly as in Chrome — no half-supported CSS subset.

JS and CSS injection

Inject javascript_code or css_code to tweak templates per request without rebuilding the HTML.

Transparent PNG output

Render components or badges on transparent backgrounds for compositing into other designs.

Exact dimensions

Set the viewport to your target size (e.g. 1200×630 for OG images) and capture precisely that box.

Frequently Asked Questions

How do I convert HTML to an image with an API?

POST your markup in the html field to https://api.screenshotty.link/api/v1/screenshot with the format you want (image/png, image/jpeg, image/webp). The HTML is rendered in headless Chrome and returned as an image. Get a free API key at screenshotty.link — 100 screenshots per month, no credit card required.

Can I use web fonts and external stylesheets?

Yes. External stylesheets, Google Fonts, and image assets referenced in your HTML are fetched and rendered just like in a normal browser tab. Use wait_ms or ready_event to ensure fonts finish loading before capture.

Is there a free tier?

Yes. Screenshotty includes 100 screenshots per month for free with no credit card required. Paid plans start at $9/month for 2,500 screenshots, with pay-as-you-go overage at $0.004 per screenshot.

Does it render JavaScript-heavy pages?

Yes. Every capture runs in a real headless Chrome browser, so single-page apps, lazy-loaded images, and dynamic content render exactly as they do for a real visitor. You can also wait for a specific ready event or add a custom delay with wait_ms.

Start Capturing in Minutes

100 free screenshots per month. No credit card required.

ScreenshottyScreenshotty

Most cost-effective Screenshot API

Product

  • Features
  • Pricing
  • Documentation
  • Blog
  • Compare
  • Alternatives

Free Tools

  • Website Screenshot Tool
  • Website Responsivity Check
  • Website Text Extractor
  • Website to PDF Converter
  • Website Markdown Converter
  • All Free Tools

Developers

  • Python Screenshot API
  • Node.js Screenshot API
  • PHP Screenshot API
  • Full Page Screenshots
  • URL to PDF API
  • API Parameters
  • MCP Server

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Screenshotty. All rights reserved.