Free plan

HTML to Image

Take a picture of a web page or your own HTML code
POST
/v1/render/html-to-image

About this tool

HTML is the code that web pages are made of. This tool shows your HTML code, or a public web page, in a hidden browser and takes a picture of it, like a screenshot. You can set the size, the picture format and whether to capture the whole page.
For example, you make a social share image from your own HTML design.

How to use it

  1. Choose this tool. You do not need to add a file.
  2. Paste your HTML, or enter a public web address.
  3. Set the width, height and picture format.
  4. Press Generate.
  5. Download the picture.

What you get back

You get a picture of the page. Download it.
GOOD TO KNOW
With `records` every document counts as one unit unless the plan says otherwise (records per unit); the answer is { results: [{ url, format, sizeBytes, record, ... }] }.
TEST IT LIVE

Try HTML to Image in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Render
Plan
Free
Method
POST
Endpoint
/v1/render/html-to-image
Tool ID
render.html-to-image
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Render
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/render/html-to-image" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"width":1000,"height":1500,"format":"png"}'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.render.htmlToImage({
    "width": 1000,
    "height": 1500,
    "format": "png"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->render()->htmlToImage([
    'width' => 1000,
    'height' => 1500,
    'format' => 'png',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Take a picture of a web page or your own HTML code.

HTML to Image works from text and settings, so no file is needed. Every input is optional.

HTML to Image is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/render/html-to-image with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.