Tools API Blog
Sign in Create account

HTML to Image API

Convert HTML and CSS into PNG, JPEG or WebP images with a single call. Send your design (or a template name and your texts) and get the image back, ready to save, send or publish. No servers or headless browsers to run, and ready for n8n, Make, Zapier, your code or your AI assistant.

Create a free account API reference

50 free credits a month, no card. 1 image = 1 credit.

Try it in 10 seconds

Change the text and hit Generate: this is exactly what your automation would receive as an image. No account, no coding.

Social card
Write
Watch
Example generated image
Receipt / ticket
Write
Watch
Example generated receipt

Use it where you already work

What people use it for

  • Open Graph images so every article or product looks good when shared.
  • One social card per spreadsheet row or per new post.
  • Personalized certificates, tickets and receipts with each person's data.
  • YouTube thumbnails, email and newsletter banners.
  • Turning an HTML report or summary into an image for Slack, Telegram or WhatsApp.

What's included

  • PNG, JPEG or WebP, up to 3840 × 2160 pixels, with adjustable quality and full-page capture.
  • Web images and fonts (Google Fonts, logos, background photos) through their https://… link.
  • Templates with data: send template + data and the server applies the design, with your texts escaped.
  • Three ways to get the result: the file, base64 in JSON, or a download link valid for 15 minutes.
  • Privacy: neither your HTML nor the image is stored; they're generated on the fly.
  • One credit pool for all 25 tools: HTML to PDF, website screenshots, QR codes, charts, PDF tools…

Ready-to-use templates

Don't want to design from scratch? We have a gallery of templates (social cards, invoices, certificates, thumbnails…) you can copy with one click and paste straight into your flow. We keep adding more.

See the templates

How it works

This tool turns an HTML design (text describing how it should look) into an image (PNG, JPEG or WebP). You send the design and it returns the image, ready to save, email or post on social media.

It's made to be used from no-code platforms like n8n, Make or Zapier, without coding, and from any programming language.

All you need

  • Your API key (your “password” for the tool). Create it in your dashboard with “+ Create key”. It's shown only once, so copy and save it.
  • In your automation platform, an “HTTP Request” step (n8n, Make, Zapier, Pipedream… all have one).

How to use it in n8n (step by step)

You send your HTML as is and you get the image back directly, ready to use. No conversion steps. In the HTTP Request node:

  • Method: POST
  • URL: https://api.cofferdock.com/capture
  • Send Query Parameters: on, and add the size as separate fields (handy, no editing the URL): width = 1200, height = 630. (You can add more: format, full_page… see the table below.)
  • Send Headers: on → add two: x-api-key = your key, and Content-Type = text/html
  • Send Body: on → Body Content Type: Raw → paste your HTML in Body (or connect it from a previous step)
  • Under Options → Response → Response Format: choose File

The node's output is already the image as a file: connect it straight to Drive, email, Telegram, social… One node and done.

In Make (HTTP → Make a request module): same method and URL, in Query String add width and height, in Headers the two headers, Body type: Raw, Content type: text/html, and paste your HTML into Request content. The response is already the image file.

In short: POST to …/capture, width and height as Query Parameters, the x-api-key and Content-Type: text/html headers, your HTML in Body as Raw, and Response Format as File.

Options (as Query Parameters)

Options you can add as Query Parameters (name/value fields in n8n/Make):

OptionDefaultWhat it does
width1200Image width in pixels.
height630Image height in pixels.
formatpngFormat: png, jpeg or webp.
full_pagefalseIf your design is taller than the height, set it to true to capture all of it.
wait_ms0Wait a few milliseconds before the snapshot (in case something is still loading). Max 5000.
outputimageSet it to url to get a download link (valid 15 minutes) instead of the file.

Internet images and fonts: you can use background photos, logos or fonts hosted online by putting their link (https://…) inside the HTML/CSS, and they'll load into the final image. The design is rendered without running JavaScript, so use HTML and CSS (no scripts).

What you get back

The image itself (a PNG, JPEG or WebP file), ready to save, email or publish. Nothing to convert: the next step of your automation already receives the file. (In technical mode with JSON, the image comes in base64.)

If you get “busy” during a spike

At peak times, the API may reply “busy” (status 503) and ask you to wait a few seconds. It's rare and brief, but to let your automation handle it on its own, turn on retry on the request step:

  • In n8n: on the HTTP Request node, Settings tab, turn on “Retry On Fail”. 2–3 attempts is plenty.
  • In Make: add an error handler to the module (right-click → Add error handler) with the Break directive, which retries automatically.

Our response includes a Retry-After header telling how many seconds to wait. With retry on, your flow won't even notice.

FAQ

What is an HTML to image API?
A service you send a design made with HTML and CSS to, and it returns a picture of that design as an image file. It lets you generate images automatically without opening a design tool.

Does it run JavaScript?
No. The design is rendered with HTML and CSS only, which keeps it fast and safe. If you need a web page with JavaScript, use the website screenshot API.

Can I use Google Fonts or my own fonts?
Yes, by linking them with their https://… address in the CSS. If one loads slowly, add wait_ms.

Do you store my HTML or the images?
No. They're generated on the fly and not stored. Only if you ask for output=url is the image kept in memory for 15 minutes so you can download it.

How much does it cost?
Each image uses 1 credit. The free plan includes 50 credits a month with no card, and paid plans share their credits across all 25 tools.

Is there an n8n node?
You don't need one: the HTTP Request node is enough. There's a ready-to-import workflow and a step-by-step guide.

Related tools