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.
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 }
}'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)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();Pay only for pages rendered. No subscriptions. No minimum monthly fee.
Free account. No credit card required. API ready in minutes.
Get your free API key