Skip to main content

Custom Cookies

Set custom cookies to capture screenshots of authenticated pages or specific user states.

Basic usage

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&customCookies=%5B%7B%22name%22%3A%22session%22%2C%22value%22%3A%22abc123%22%2C%22domain%22%3A%22example.com%22%7D%5D" \
  --output screenshot.png
[
  {
    "name": "session",
    "value": "abc123",
    "domain": "example.com",
    "path": "/",
    "httpOnly": false,
    "secure": true,
    "sameSite": "Lax"
  }
]

Required fields

FieldTypeDescription
namestringCookie name
valuestringCookie value
domainstringCookie domain

Optional fields

FieldTypeDescription
pathstringCookie path (default: /)
httpOnlybooleanHTTP-only flag (default: false)
securebooleanSecure flag (default: false)
sameSitestringSameSite policy: Strict, Lax, or None

Multiple cookies

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&customCookies=%5B%7B%22name%22%3A%22session%22%2C%22value%22%3A%22abc123%22%7D%2C%7B%22name%22%3A%22theme%22%2C%22value%22%3A%22dark%22%7D%5D" \
  --output screenshot.png
Never expose sensitive authentication data in URLs that might be logged. Consider using environment variables for sensitive data.

Parameters

ParameterTypeDescription
customCookiesstringJSON array of cookie objects

See also