Skip to content
API referenceScreenshot

Screenshot

Stable

Capture any web page as an image. Render the full scroll height, a fixed viewport, or a single element — at any device scale, in PNG, JPEG, or WebP. Costs 1 credit.

Endpoint

POSThttps://api.renderkit.tech/v1/screenshot

url or html

Send exactly one of url or html. Requests with neither — or both — are rejected with 400 INVALID_PARAMS. Unknown fields are silently stripped before they reach the engine.

Screenshot parameters

ParameterDescription
formatstringOutput image format. Options: png, jpeg, webp. Defaults to png.
qualityintegerCompression quality 1–100. Applies to jpeg and webp. Defaults to 80.
full_pagebooleanCapture the entire scroll height instead of just the viewport. Defaults to false.
selectorstringCapture only the element matching this CSS selector.
clipobjectCrop to a fixed region: { x, y, width, height } in pixels.
viewport_widthintegerViewport width in pixels (320–3840). Defaults to 1440.
viewport_heightintegerViewport height in pixels (240–2160). Defaults to 900.
device_scalenumberDevice pixel ratio 1–3. Use 2 for retina captures. Defaults to 1.
mobilebooleanEmulate a mobile device (touch + mobile UA). Defaults to false.
thumbnail_widthintegerResize the screenshot proportionally to this width in pixels (1–5000).
dark_modehobby+booleanRender with prefers-color-scheme: dark. Defaults to false.
omit_backgroundbooleanTransparent background (PNG/WebP only). Defaults to false.
hide_selectorsarrayCSS selectors to hide before capture (up to 50).
clickstringClick this selector before capturing (e.g. open a menu).
scroll_tostringScroll this selector into view before capturing.
block_resourcesarrayResource types to block. Any of image, stylesheet, font, media, script.
block_adsbooleanStrip ads with a maintained filter list. Defaults to false.
block_cookie_bannersbooleanDismiss cookie-consent banners. Defaults to false.
block_chatsbooleanHide chat/support widgets. Defaults to false.
meta_titlebooleanInclude the page <title> in the response meta.
meta_ogbooleanInclude Open Graph tags in the response meta.

Common parameters

ParameterDescription
urlstringFully-qualified URL to render. Max 4096 chars. Provide this or html, not both.
htmlstringRaw HTML to render instead of fetching a URL. Up to 2 MB. Provide this or url.
wait_untilstringNavigation lifecycle event to wait for before rendering. Options: load, domcontentloaded, networkidle. Defaults to networkidle.
delayintegerExtra wait after the page is ready, in milliseconds (0–10000). Defaults to 0.
timeoutintegerHard navigation timeout in milliseconds (5000–60000). Clamped to your plan's maximum. Defaults to 30000.
wait_for_selectorstringBlock until this CSS selector appears in the DOM.
user_agentstringOverride the browser User-Agent string.
countrygrowth+stringRender from a US or GB IP so geo-restricted and region-walled pages load correctly. Options: us, gb.
cookieshobby+arrayCookies to set before navigation. Up to 50 entries.
headershobby+objectExtra HTTP request headers, e.g. an Authorization header for gated pages.
inject_csshobby+stringCSS injected into the page before rendering (max 100 KB).
inject_jsgrowth+stringJavaScript executed in the page before rendering (max 100 KB).
cachebooleanServe an identical prior render from cache when available. Cache hits are free. Defaults to true.
cache_ttlintegerCache lifetime in seconds (0–2592000, i.e. up to 30 days). Defaults to 3600.
cache_keystringOverride the automatic cache key to force-share or force-separate renders.
asynchobby+booleanQueue the render and return a job immediately instead of blocking. See Webhooks & async. Defaults to false.
webhook_urlhobby+stringHTTPS URL that receives a signed render.done / render.failed callback when an async render finishes.
webhook_secrethobby+stringSecret used to HMAC-sign the webhook payload (X-RenderKit-Signature).

Request

curl https://api.renderkit.tech/v1/screenshot \
  -H "x-api-key: $RK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://stripe.com",
    "full_page": true,
    "format": "png",
    "block_ads": true,
    "device_scale": 2
  }'

Response

200 · application/json
{
  "success": true,
  "data": {
    "id": "rnd_8fk2m1c4",
    "type": "screenshot",
    "status": "done",
    "url": "https://cdn.renderkit.tech/renders/3a7b9c…e9.png",
    "url_expires_at": "2027-06-14T10:24:01.000Z",
    "meta": { "width": 2880, "height": 9720, "format": "png" },
    "render_ms": 842,
    "credits_used": 1,
    "cached": false,
    "created_at": "2026-06-14T10:24:00.000Z",
    "completed_at": "2026-06-14T10:24:00.842Z"
  },
  "message": "Success"
}

Capture a single element

Pass a selector to crop to one element — ideal for og-image generation or component snapshots.

POST /v1/screenshot
curl https://api.renderkit.tech/v1/screenshot \
  -H "x-api-key: $RK_KEY" -H "Content-Type: application/json" \
  -d '{ "url": "https://github.com/renderkit", "selector": "main .h-card", "omit_background": true }'

Hosted, content-addressed URLs

Image bytes are stored by SHA-256, so identical renders share one immutable, permanently-cacheable URL. Artifacts are retained for 365 days (url_expires_at).