Image Render Cloud

This page contains documentation for our Image Render Cloud API service. This services lets you render images with Google Chrome using HTML and CSS. Alternatively, the service can also be used to screenshot any webpage.

Create an Image

Images are created by making request to:

POST https://api.imagerender.cloud/v1/images

Request Parameters

Either an html or a url parameter is required at a minimum.

  • Name
    html
    Type
    string
    Description

    HTML template to render. This can include links to CSS and JavaScript assets.

  • Name
    url
    Type
    string
    Description

    A publicly accessible URL to screenshot. This parameter is mutually exclusive with the html parameter.

Additional parameters

  • Name
    device_scale
    Type
    float
    Description

    Set the browser's scaling factor. This must be a value between 1.0 and 3.0. By default, requests rendering an image with the html will use value of 2.0 while url screenshots will use a value of 1.0. Learn more about image size.

  • Name
    viewport_width
    Type
    intger
    Description

    Set the browser's viewport width. Requests must include a height value.

  • Name
    viewport_height
    Type
    intger
    Description

    Set the browser's viewport height. Requests must include a width value.

Full Example

A very basic request using the html parameter would look like:

curl -X POST https://api.imagerender.cloud/v1/images \
  -H "Authorization: $IMGRC_TOKEN" \
  -d '{"html":"<div><h1>This is a test</h1></div>"}'

The response would contain:

{
  "url":"https://imagerender.cloud/i/149c0f96-7d58-4091-409c-958811034b00"
}

CDN Hosting

Resulting images are hosted on Cloudflare's Images and you are free to link directly to these images. We even offer a way to resize your images on-the-fly.