---
title: "Render image"
method: POST
path: "/render"
tags: ["render"]
---

# Render image

`POST /render`

## Query parameters

- `api_key` string, required — API key for authorization

## Request body

- CreateImageDto
  - `html` string, required — This refers to the HTML content you wish to render. You can submit either a snippet of HTML (for example, <div>Your content</div>) or a full webpage.
  - `css` string — This refers to the CSS styling for your rendered image. If used in conjunction with a URL, it will be incorporated into the webpage.
  - `device_scale` number — Modifies the pixel density of the screenshot. By default, it is set to 2, mirroring the quality of a 4K monitor. The minimum value allowed is 1, while the maximum is 3.
  - `viewport_width` number — This allows you to determine the width of Chrome's viewing area, which will deactivate the auto-cropping feature. If you're using either parameter, both the height and width settings need to be specified.
  - `viewport_height` number — This allows you to specify the height of Chrome's viewing area, which in turn deactivates the auto-cropping feature. Both the height and width parameters need to be established if you choose to use either one.
  - `full_screen` boolean — This parameter allows you take screenshot of entire webpage.
  - `selector` string — Advanced Option: Specify a CSS selector corresponding to an element in the HTML. The image will be cropped precisely to this designated element.
  - `ms_delay` number — Incorporates additional delay to ensure JavaScript execution is complete. This option is useful if you encounter blank images while using JavaScript. The default setting is 0, but you can begin with a 500 millisecond delay if necessary.

## Response `200`

Rendered image URL.

- ImageUrlDto
  - `imageUrl` string, required — URL to generated image

## Other responses

- `400` — Bad Request. The request parameters are invalid.
- `401` — Unauthorized. The requested api_key query parameter is missing or invalid.
- `429` — Too many concurrent requests or reached your monthly quota.
- `500` — The API failed to process your request.
- `503` — The API is temporarily unavailable.

---

[API](https://skmtc.dev/canvasflare/apis/canvasflare-api.md) · [All operations](https://skmtc.dev/canvasflare/apis/canvasflare-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/canvasflare/canvasflare-api/revisions/50feec9902ac/schema)
