Request Context

Pass custom cookies, headers, and a user-agent to the browser when it loads the target page.

Use these parameters to access pages that require session cookies, custom auth headers, or a specific browser identity.

Cookies format

Semicolon-separated name=value pairs: session=abc123;theme=dark

Headers format

Newline-separated Name: Value pairs: X-Custom: foo\nX-Other: bar

The authorization parameter injects an Authorization HTTP header on the request to the target page, separate from your own API key.

Parameters

NameTypeRequiredDescription
user_agentstringoptionalCustom browser User-Agent string (max 500 chars).
authorizationstringoptionalValue injected as the Authorization header on the request to the target page (max 1000 chars).
cookiesstringoptionalSemicolon-separated cookie pairs. Format: name=value;name2=value2.
headersstringoptionalNewline-separated custom request headers. Format: Header-Name: value (one per line).

Code Examples

# Pass a session cookie to access a protected page
curl -X POST "https://screenshotcore.com/api/v1/screenshot" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://app.example.com/dashboard","cookies":"session=abc123;role=admin"}' \
  -o dashboard.png

# Custom User-Agent
curl "https://screenshotcore.com/api/v1/screenshot?access_key=KEY&url=https://example.com&user_agent=MyBot/1.0" -o out.png

Response

(Raw PNG bytes of the authenticated page, Content-Type: image/png)