Detailed information on all the available parameters for the API.
Parameters
The create image endpoint accepts the following parameters. Accepted as either json or formdata.
Name
Type
Description
html†
String
This is the HTML you want to render. You can send an HTML snippet (<div>Your content</div>) or an entire webpage.
css
String
The CSS for your image. When using with url it will be injected into the page.
url†
String
The fully qualified URL to a public webpage. Such as https://htmlcsstoimage.com. When passed this will override the html param and will generate a screenshot of the url.
Required params
† Either url OR html is required, but not both. css is optional.
Additional parameters
Optional parameters for greater control over your image.
Controls the image resolution by adjusting the pixel ratio. Minimum: 0.1, Maximum: 3. Higher values increase image quality and file size. For example, 2 will double the resolution.
Sets a maximum time limit (500-10000ms) for waiting before taking the screenshot. Unlike ms_delay, this is a cap rather than a fixed delay. Useful when pages load extra irrelevant content.
The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with 500. Large values slow down the initial render time.
Customize PDF output with page size, margins, scale, and background printing. Use this when you plan to request the generated URL with a .pdf extension.