HTML/CSS to Image API
Your search for pixel perfect image generation ends here.
Generate high-quality images from HTML/CSS, capture public webpages, or automate social cards across an entire site.
- Converts HTML to
png,jpgorwebp - Screenshot any URL
- No janky fonts or blurry images
Three ways to generate images
From HTML/CSS
Create images programmatically using HTML and CSS. Perfect for social cards, certificates, dynamic graphics, and more.
curl -X POST https://hcti.io/v1/image -u 'UserID:APIKey' \
-d html="<div style='padding:20px;background:#4f46e5;color:white;font-size:24px;'>Hello World</div>"
Learn more about HTML to Image →
From any URL
Take screenshots of any public webpage. Great for archiving, previews, and automated captures.
curl -X POST https://hcti.io/v1/image -u 'UserID:APIKey' \
--data-urlencode url="https://google.com"
Learn more about URL to Image →
Automatic Open Graph images
Connect a website or CMS once, then use one path-based image URL pattern for every page. HCTI can screenshot each page or populate a reusable template from its metadata—without an API request or HMAC signature for every social card.
Set up automatic Open Graph images →
Quick start
Choose your path to get started:
| I want to… | Go here |
|---|---|
| Read the API docs | Using the API |
| Add automatic social cards | Open Graph Images for a website, CMS, or store |
| Design a reusable template | Template Editor |
| See example code | PHP, JavaScript, Ruby, Python, Go, cURL, C#, TypeScript, Java, Rust, Kotlin, Elixir |
| Use with AI assistants | MCP Server for Cursor, Claude, Windsurf, and more |
| Automation options | n8n, Zapier, or Make |
| See use cases | Use Cases & Examples |
Works with any language
Don’t see your language? The API works with anything that can make HTTP requests. See the cURL example and adapt it to your stack.
Trusted by developers worldwide
Companies like Dev.to, Product Hunt, and thousands of developers use HTML/CSS to Image to generate millions of images every month.

Dev.to uses the API to autogenerate thousands of custom social images for Twitter and Facebook.
Get an API key
To use this API, you’ll need an API key. Get started for free: