HTML to Screenshot

    POSThttps://api.peekshot.com/api/v1/html-to-image
    Convert 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

    NameTypeDescription
    x-api-key*
    string

    Your unique API key for authentication

    Content-Type*
    string

    Must be application/json

    Example:application/json

    Body Parameters

    NameTypeDescription
    project_id*
    string

    Unique project identifier

    Example:"1"

    html*
    string

    html to capture

    Example:"<h1> Hello world </h1>"

    width
    string

    Screenshot width (default: 1280)

    Example:"1280"

    height
    string

    Screenshot height (default: 1024)

    Example:"1024"

    file_type
    string

    jpeg, png,webp, avif (default "jpeg")

    Example:"jpeg"

    delay
    string

    Time (in seconds) to wait before capturing

    Example:"10"

    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:"iphone 15 plus"

    retina
    string

    ”true” for high-resolution screenshots

    Example:"false"