HTML to Screenshot
POST
https://api.peekshot.com/api/v1/html-to-imageConvert raw HTML content into a rendered screenshot image using PeekShot’s HTML to Screenshot API. Send the HTML body directly in your request and receive a high-resolution screenshot output in your desired format. Ideal for previewing dynamically generated content, rendering email templates, or capturing visuals from HTML without hosting it publicly.
Headers
| Name | Type | Description |
|---|---|---|
x-api-key* | string | Your unique API key for authentication |
Content-Type* | string | Must be application/json Example: |
Body Parameters
| Name | Type | Description |
|---|---|---|
project_id* | string | Unique project identifier Example: |
html* | string | html to capture Example: |
width | string | Screenshot width (default: 1280) Example: |
height | string | Screenshot height (default: 1024) Example: |
file_type | string | jpeg, png,webp, avif (default "jpeg") Example: |
delay | string | Time (in seconds) to wait before capturing Example: |
full_page | string | ”true” to capture the entire page, “false” for viewport only |
emulate_device | string | how your html content appears on different devices Example: |
retina | string | ”true” for high-resolution screenshots Example: |
curl --location 'https://api.peekshot.com/api/v1/html-to-image' \
--header 'x-api-key: your-api-key' \
--header 'Content-Type: application/json' \
--data '{
"project_id": "1",
"html": "<h1>Hello World</h1>"
}'Responses
201Success Response
{
"status": "success",
"message": "screenshot request added in queue",
"data": {
"requestId": 1,
"creditRequired": 1,
"organizationId": 1
},
"statusCode": 201
}