Media

Screenshot a page

Capture a full-page PNG screenshot of a rendered page.

post/v1/web/screenshot

Request

  • Base URL: https://api.hydrafetch.com
  • URL: https://api.hydrafetch.com/v1/web/screenshot
  • Auth: API key in header X-API-Key

Request body

urlstring required

The URL to screenshot. Must be http(s).

fullPageboolean

Capture the entire scrollable page instead of just the viewport. Default off.

waitFornumber

Extra milliseconds to let the page settle before capture.

timeoutnumber

Overall time budget for the request, in milliseconds.

maxAgenumber

Reuse a stored screenshot if it is younger than this many milliseconds. Defaults to 7 days, so a repeated request returns the stored PNG with cached: true without re-rendering — which also means it returns immediately and does not apply waitFor. Pass 0 to force a fresh capture.

viewport'desktop' | 'laptop' | 'tablet' | 'mobile'

Screen size to render at. Defaults to desktop (1920x1080). Ignored when width/height are given explicitly.

viewportWidthnumber

Exact viewport width in pixels. Overrides viewport.

viewportHeightnumber

Exact viewport height in pixels. Overrides viewport. With fullPage the capture still extends to the full page height.

Example request

{
  "url": "https://example.com",
  "fullPage": true,
  "viewport": "desktop"
}

Response

Example response

{
  "data": {
    "url": "https://example.com",
    "finalUrl": "https://example.com/",
    "status": 200,
    "screenshot": "https://media.hydrafetch.com/screenshots/a1/a1b2c3.png",
    "screenshotType": "viewport",
    "width": 1920,
    "height": 1080
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.