Creating an image

Last updated last month

Converting HTML/CSS to an Image with the API

To create an image, send an HTTP POST request to the /v1/image endpoint. This can be done with any language or framework.

This API endpoint will return the URL to your newly created image.

Take a look at our examples for ways to make use of the API.

post
Create an image

https://hcti.io
/v1/image
This endpoint allows you to create a new image.
Request
Response
Headers
Authentication
required
string
HTTP Basic Authentication. Your username is your User ID and your password is your API Key. See Authentication for details.
Body Parameters
html
required
string
HTML markup. An entire page or an HTML snippet.
css
optional
string
CSS styles for your image
google_fonts
optional
string
Google fonts to be loaded. Example: Roboto. Multiple fonts delimited by |. Roboto|Open Sans
200: OK
Image successfully created
example_response.json
{
"url": "https://hcti.io/v1/image/6e253850-736c-487a-8dc8-b6950ca94703"
}
400: Bad Request
Missing parameter
bad_request.json
{
"statusCode": 400,
"error": "Bad Request",
"message": "child \"html\" fails because [\"html\" is required]"
}
401: Unauthorized
Invalid authorization token
bad_token.json
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Bad username or password",
"attributes": {
"error": "Bad username or password"
}
}
429: Too Many Requests
Plan limit exceeded
{
"statusCode": 429,
"error": "Plan limit exceeded",
"message": "You've used 3102 of your 3000 renders. Upgrade via the Dashboard: https://htmlcsstoimage.com/dashboard"
}

Visit this page for more information about using Google Fonts.