Screenshot endpoint
Full reference for the core API.
Endpoint
POST https://api.nightglass.xyz/api/v1/screenshot
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL to screenshot. Must include protocol (https://). |
format | string | No | "png" (default) or "jpeg" |
quality | number | No | JPEG quality, 1–100. Default: 80. Ignored for PNG. |
width | number | No | Viewport width in pixels. Default: 1280. |
height | number | No | Viewport height in pixels. Default: 800. |
fullPage | boolean | No | Capture the full scrollable page. Default: false. |
style | string | No | "mockup" to wrap in a browser frame. See mockup mode. |
delay | number | No | Wait N milliseconds after page load before capturing. Default: 0. |
darkMode | boolean | No | Emulate dark colour scheme. Default: false. |
deviceScaleFactor | number | No | Device 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
| Header | Value |
|---|---|
Content-Type | image/png or image/jpeg |
X-Screenshot-Width | Actual width of the captured image |
X-Screenshot-Height | Actual height of the captured image |
Example
curlcurl -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