On this page

    Get started

    Choose the Right Preset

    Pick the preset that fits the job: share images, X cards, link previews, phones, full pages or PDFs. See each result and change one setting.

    Time
    5 minutes
    Plan
    Free
    You need
    • An API key in RS_API_KEY (see the first screenshot guide)

    What you will have at the end

    One parameter, preset: mobile, gives a phone-sized render with touch emulation at 3× pixel density.

    A preset sets the window size, the image format and the cache time in one parameter. You will pick a preset for your job, render a page with it, and change one setting without losing the rest.

    Find the preset for your job

    You are building Preset Size Format
    Share images for Facebook, LinkedIn, Slack og_card 1200×630 PNG
    Share images for X (summary card) twitter_card 1200×600 PNG
    Share images for X (large image card) twitter_card_large 1200×628 PNG
    Link previews in your own app or chat link_preview 800×600 PNG
    How the page looks on a phone mobile 390×844 at 3× PNG
    A phone held sideways mobile_landscape 844×390 at 3× PNG
    A desktop monitor desktop_hd 1920×1080 PNG
    A large monitor desktop_4k 3840×2160 PNG
    The whole page, top to bottom full_page 1280 wide, full height PNG
    A printable document pdf_document US Letter, 1 cm margins PDF

    If nothing fits, leave out preset and set the size yourself with viewport.

    Add the preset to your request

    The preset is one field next to the URL. This request renders a phone view:

    curl -X POST https://api.renderscreenshot.com/v1/screenshot \
      -H "Authorization: Bearer $RS_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"url": "https://renderscreenshot.com", "preset": "mobile"}' \
      --output mobile.png
    

    In an SDK, it is the preset method:

    Node.js

    const image = await client.take(
      TakeOptions.url('https://renderscreenshot.com').preset('mobile')
    );
    

    Python

    image = client.take(TakeOptions.url('https://renderscreenshot.com').preset('mobile'))
    

    Ruby

    image = client.take(
      RenderScreenshot::TakeOptions.url('https://renderscreenshot.com').preset('mobile')
    )
    

    GET request

    curl "https://api.renderscreenshot.com/v1/screenshot?url=https%3A%2F%2Frenderscreenshot.com&preset=mobile" \
      -H "Authorization: Bearer $RS_API_KEY" --output mobile.png
    

    Compare the results

    Here is the same page with five presets. Click an image to see it at full size.

    og_card: 1200×630. The default choice for og:image tags.
    twitter_card_large: 1200×628, for the summary_large_image card on X.
    link_preview: 800×600. A narrower window, so pages often switch to their tablet layout.
    desktop_hd: 1920×1080, the first screen of a desktop monitor.
    full_page: the whole page, 1280 pixels wide. It scrolls first so lazy images load.

    The mobile result is at the top of this guide. The image is 1170×2532 pixels, because the preset renders at 3× pixel density, like an iPhone.

    Change one setting

    Add a field to replace one value of the preset. Everything else stays. This request keeps og_card (1200×630) and turns on dark mode:

    {
      "url": "https://renderscreenshot.com",
      "preset": "og_card",
      "browser": { "dark_mode": true }
    }
    
    og_card
    og_card + dark_mode
    Dark mode works on pages that support prefers-color-scheme. Pages without a dark theme look the same.

    Other common changes:

    Change Add
    Smaller files "output": { "format": "webp", "quality": 85 }
    JPEG instead of PNG "output": { "format": "jpeg" }
    A thumbnail from the same render "output": { "resize": { "width": 600 } }
    A different height "viewport": { "height": 800 }

    Next steps

    Try RenderScreenshot free

    150 free credits every month, no credit card required.