Link Search Menu Expand Document

HTML/CSS to Image API

Your search for pixel perfect image generation ends here.

Live demo Get an API Key


The API for generating high quality images from HTML/CSS.

  • Converts HTML to png, jpg or webp
  • Screenshot any URL
  • No janky fonts or blurry images

Two 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 →


Quick start

Choose your path to get started:

I want to… Go here
Read the API docs Using the API
See example code PHP, JavaScript, Ruby, Python, Go, cURL
Use with AI assistants MCP Server for Cursor, Claude, Windsurf, and more
No-code options 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 social card generated from HTML

Dev.to uses the API to autogenerate thousands of custom social images for Twitter and Facebook.

See more use cases →


Get an API key

To use this API, you’ll need an API key. Get started for free:

Get an API Key


Back to top

Built with extensive integration tests and serious care for developer happiness.
© 2018-2025 Code Happy, LLC.

Page last modified: Jan 10 2026 at 06:56 PM.

Edit this page on GitHub.