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.
Use it where you already work
- n8n: one HTTP Request node. Step-by-step guide and a ready-to-import workflow.
- Make: the HTTP → Make a request module. Step-by-step guide.
- Zapier: Webhooks by Zapier. Step-by-step guide.
- Your code: curl, JavaScript or Python (examples below, in Technical mode), or the interactive reference with OpenAPI and Postman.
- AI assistants: Claude, ChatGPT or Cursor through MCP. How to connect it.
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+dataand 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.
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, andContent-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):
| Option | Default | What it does |
|---|---|---|
width | 1200 | Image width in pixels. |
height | 630 | Image height in pixels. |
format | png | Format: png, jpeg or webp. |
full_page | false | If your design is taller than the height, set it to true to capture all of it. |
wait_ms | 0 | Wait a few milliseconds before the snapshot (in case something is still loading). Max 5000. |
output | image | Set 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).
API overview
- Endpoint:
POST https://api.cofferdock.com/capture - Auth: header
x-api-key: YOUR_KEY. - Input: the HTML goes in the body as
text/html(raw) or asapplication/jsonin thehtmlfield. In JSON you can also sendtemplate+data(list at /templates.json). - Output: by default, with
text/htmlit returns the image binary (image/png,image/jpegorimage/webp); with JSON it returns base64. Addoutput=imageto force the binary either way, oroutput=urlto get a temporary download link (valid 15 minutes; great for Zapier, Bubble or AI assistants). - Full reference: all 25 tools with their options and a form to try them at /api (also as OpenAPI and a Postman collection).
- Options: via Query Parameters or in the JSON (JSON wins if both are set).
- Limits: HTML max 5 MB; 30 s timeout; JavaScript disabled (HTML/CSS only); calls per minute depend on your plan (30 on the free plan).
Options
| Option | Default | Description |
|---|---|---|
width | 1200 | Width in px (100–3840). |
height | 630 | Height in px (100–2160). |
format | png | png, jpeg or webp. |
quality | 90 | Quality (1–100). Applies to jpeg and webp only. |
full_page | false | Capture the full content height. |
wait_ms | 0 | Wait before capturing, in ms (max 5000). |
output | per mode | image (binary), json (base64) or url (15-minute link). |
Examples
curl (raw HTML, saves the image to a file):
curl -X POST "https://api.cofferdock.com/capture?width=1200&height=630" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: text/html" \
--data-binary "<h1 style='color:#8a5210'>Hello</h1>" \
-o image.png
JavaScript (Node 18+):
const r = await fetch('https://api.cofferdock.com/capture?width=1200&height=630', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'text/html' },
body: '<h1>Hello</h1>',
});
const buffer = Buffer.from(await r.arrayBuffer());
require('fs').writeFileSync('image.png', buffer);
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/capture',
params={'width': 1200, 'height': 630},
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'text/html'},
data='<h1>Hello</h1>'.encode('utf-8'),
)
open('image.png', 'wb').write(r.content)
JSON mode (base64 response)
With Content-Type: application/json, the HTML goes in html and the options in the same object. The response carries the image in base64:
{ "html": "<h1>Hello</h1>", "width": 1200, "height": 630 }
→ { "success": true, "image": "iVBORw0KGgo…", "mime_type": "image/png",
"meta": { "used": 12, "remaining": 488, "size_bytes": 8421 } }
Add "output": "image" to the JSON to receive the binary instead of base64.
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
- HTML to PDF: the same HTML, turned into a PDF (invoices, reports).
- Website screenshot: a picture of any web page from its URL.
- JSON to chart: bar, line or pie charts as images.
- Images: resize, convert and compress the resulting image.