Generate Image API for Developers

    New

    Generate Image API built for teams that need reliable document automation at scale. Convert and process files with simple REST requests, predictable output quality, and production-grade uptime. Use it for webpage snapshots, HTML rendering, and preview generation workflows. Includes clear docs, SDK-ready endpoints, and quick testing in your browser.

    What it does

    Capture images from public URLs or raw HTML/CSS payloads.

    Control viewport dimensions, full-page behavior, quality, and output mode.

    Useful for snapshots, social previews, reports, and visual regression workflows.

    Endpoint & Parameters

    POST /v1/generateImage

    URL Mode

    url
    required

    Public URL to screenshot.

    viewPortWidth / viewPortHeight
    optional

    Browser viewport size. Defaults: 1280 × 720.

    full_page
    optional

    Capture full scrollable page (boolean).

    wait_until
    optional

    load, domcontentloaded, networkidle, or commit.

    wait_for_timeout
    optional

    Extra delay in ms after page load before capture.

    cookie_accept_text
    optional

    Text of cookie consent button to click before screenshot.

    HTML Mode

    html_content
    required

    HTML markup to render.

    css_content
    optional

    CSS to inject after HTML.

    width / height
    optional

    Output image dimensions. Defaults: 1280 × 720.

    font
    optional

    Google Font names, pipe-separated. e.g. "Inter|Roboto".

    dynamic_params
    optional

    Key-value object for {{placeholder}} substitution in HTML.

    Common

    output_format
    optional

    url (default), base64, both, image/png/binary/file.

    quality
    optional

    Image quality 30–100. Default 80.

    deviceScaleFactor
    optional

    Device pixel ratio 1–3. Use 2 for retina quality.

    curl -X POST https://pdfapihub.com/api/v1/generateImage \
      -H "CLIENT-API-KEY: your_api_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://example.com",
        "viewPortWidth": 1920,
        "viewPortHeight": 1080,
        "full_page": false,
        "output_format": "url"
      }'

    Sandbox