Generating an Image

Using the HTML CSS to Image API, you can generate an image from a URL or using HTML + CSS.

POST https://api.htmlcsstoimg.com/api/v1/generateImage

Captures an image from a Web URL or generates an image from HTML & CSS

Headers

NameTypeDescription

CLIENT-API-KEY*

String

API Key for your account. Will be available on your dashboard.

Request Body

NameTypeDescription

html_content

String

HTML Content to be used for image generation

css_content

String

CSS Content to be used for image generation

font

String

Google Font Name that needs to be imported when generating image from HTML & CSS

url

String

URL of the Webpage whose screenshot is to be captured

viewPortWidth

Number

Height of View Port. Default value is 1080

viewPortHeight

Number

Height of View Port. Default value is 720

quality

Number

Quality of the image should be in the range 30-100. Default value is 30.

generate_img_url

Boolean

Whether the output should return the image or the Image URL. Default value is true.

full_page

Boolean

Whether to capture full-page screenshot of the URL. Default value is false.

wait_till

Number

Number of seconds to wait before capturing a screenshot from the URL. Default value is 0.

Last updated