Pay-per-use · No subscriptions

Turn Any HTML Into a High-Quality Image in Milliseconds

Generate full-page screenshots, thumbnails, and social images via REST API.

HTML2DocHub's HTML to Image API uses Chromium to capture pixel-perfect PNG screenshots of any HTML or URL. Ideal for social media cards, invoice thumbnails, automated reports, and web archiving. Fully pay-per-use — no subscriptions, no minimums.

Why developers choose HTML2DocHub

Full-page and viewport-clipped screenshots
Custom viewport width (320px to 3840px)
Retina/HiDPI output at 2x pixel ratio
Transparent background support
Clip to specific DOM element via CSS selector
Delay capture (wait for animations / lazy loads)
Pass raw HTML string or live URL
Sync or async (webhook) delivery
Pay per screenshot — from ₹0.10

Code Examples

cURLbash
curl -X POST https://api.html2dochub.com/v1/jobs \
  -H "X-API-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "image",
    "html": "<body style=\"background:#fff;padding:40px\"><h1>Screenshot</h1></body>",
    "options": { "width": 1200 }
  }'
Pythonpython
import requests

response = requests.post(
    "https://api.html2dochub.com/v1/jobs",
    headers={"X-API-Key": "sk_live_your_key"},
    json={
        "type": "image",
        "url": "https://your-app.com/invoice/123",
        "options": {"width": 1200, "full_page": True}
    }
)
download_url = response.json()["download_url"]
print(download_url)
Node.jsjavascript
const response = await fetch("https://api.html2dochub.com/v1/jobs", {
  method: "POST",
  headers: {
    "X-API-Key": "sk_live_your_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    type: "image",
    html: "<h1 style='font-size:80px'>Hello!</h1>",
    options: { width: 800 }
  }),
});
const { download_url } = await response.json();

Simple, transparent pricing

Pay only for pages rendered. No subscriptions. No minimum monthly fee.

1 page PDF:~₹0.10
10 page PDF:~₹0.80
100 pages/day:~₹8/day
See full pricing details

Frequently Asked Questions

What image formats are supported?+
Currently PNG is supported. JPEG and WebP support is coming in the next release.
Can I capture only part of the page?+
Yes — pass a CSS selector in `options.clip_selector` to capture only that element.
Can I capture a live URL instead of raw HTML?+
Yes. Pass `url` instead of `html`. The API will navigate to the URL and capture a screenshot.
How is pricing different from PDF?+
Same usage-based model as PDFs: you pay for successful image output, with a clear total per job in the API and dashboard.
Is Retina (2x) output supported?+
Yes. Set `options.device_scale_factor: 2` for Retina-quality output.

Start rendering PDFs today

Free account. No credit card required. API ready in minutes.

Get your free API key