Render HTML to image
POST
/render
const url = 'http://localhost:8080/render';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"html":"example","baseUrl":"example","format":"example","width":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/render \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "html": "example", "baseUrl": "example", "format": "example", "width": 1 }'Renders HTML to a PNG or JPEG image, or uploads it when X-Upload-Url is provided.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ” X-Upload-Url
string
Presigned PUT URL that receives the generated document.
Request Body required
Section titled “Request Body required ” Media type application/json
RenderImageRequest
object
html
required
string
baseUrl
string | null
format
string
width
integer
Example generated
{ "html": "example", "baseUrl": "example", "format": "example", "width": 1}Responses
Section titled “ Responses ”Rendered image
string format: binary
string format: binary
Image uploaded successfully
Invalid request or upload URL
Rendering failed
Upload target rejected the request or was unreachable