> For the complete documentation index, see [llms.txt](https://docs.htmlcsstoimg.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.htmlcsstoimg.com/html-to-image-api/html-css-to-image-api.md).

# HTML/CSS to Image API

Convert HTML/CSS Code into Image using this flexible API

<mark style="color:green;">`POST`</mark> `https://api.htmlcsstoimg.com/api/v1/generateImage`

Convert HTML & CSS Code to an Image

#### Headers

| Name                                             | Type   | Description                                                    |
| ------------------------------------------------ | ------ | -------------------------------------------------------------- |
| CLIENT-API-KEY<mark style="color:red;">\*</mark> | String | API Key for your account. Will be available on your dashboard. |

#### Request Body

| Name               | Type    | Description                                                                                                                     |                                |              |
| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------ |
| html\_content      | String  | HTML Content to be used for image generation                                                                                    |                                |              |
| css\_content       | String  | CSS Content to be used for image generation                                                                                     |                                |              |
| font               | String  | <p>Google Font Name that needs to be imported when generating image from HTML & CSS. To pass multiple fonts, separate them with | sign.<br><br>Example - "Roboto | Georgia"</p> |
| quality            | Number  | <p>Quality of the image should be in the range 30-100. <br><br>Default value is 30.</p>                                         |                                |              |
| generate\_img\_url | Boolean | <p>Whether the output should return the image or the Image URL. <br><br>Default value is true.</p>                              |                                |              |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}
