Screenshot endpoint

Full reference for the core API.

Endpoint

POST https://api.nightglass.xyz/api/v1/screenshot

Request body

ParameterTypeRequiredDescription
urlstringYesThe URL to screenshot. Must include protocol (https://).
formatstringNo"png" (default) or "jpeg"
qualitynumberNoJPEG quality, 1–100. Default: 80. Ignored for PNG.
widthnumberNoViewport width in pixels. Default: 1280.
heightnumberNoViewport height in pixels. Default: 800.
fullPagebooleanNoCapture the full scrollable page. Default: false.
stylestringNo"mockup" to wrap in a browser frame. See mockup mode.
delaynumberNoWait N milliseconds after page load before capturing. Default: 0.
darkModebooleanNoEmulate dark colour scheme. Default: false.
deviceScaleFactornumberNoDevice pixel ratio. Default: 2 (Retina).

Response

On success, the response body is the raw image (PNG or JPEG). The Content-Type header is set to image/png or image/jpeg accordingly.

Headers

HeaderValue
Content-Typeimage/png or image/jpeg
X-Screenshot-WidthActual width of the captured image
X-Screenshot-HeightActual height of the captured image

Example

curl
curl -X POST https://api.nightglass.xyz/api/v1/screenshot \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ng_live_abc123" \
  -d '{
    "url": "https://github.com",
    "width": 1440,
    "height": 900,
    "format": "png",
    "fullPage": false,
    "delay": 1000
  }' \
  --output github.png