Custom Cookies
Set custom cookies to capture screenshots of authenticated pages or specific user states.
Basic usage
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
| Field | Type | Description |
|---|
name | string | Cookie name |
value | string | Cookie value |
domain | string | Cookie domain |
Optional fields
| Field | Type | Description |
|---|
path | string | Cookie path (default: /) |
httpOnly | boolean | HTTP-only flag (default: false) |
secure | boolean | Secure flag (default: false) |
sameSite | string | SameSite policy: Strict, Lax, or None |
Multiple cookies
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
| Parameter | Type | Description |
|---|
customCookies | string | JSON array of cookie objects |
See also