Authentication (HTTP & Basic)

Use the AddScreenshots Screenshot API to capture pages protected by HTTP Basic authentication or endpoints that expect headers such as Authorization or Cookie. Provide credentials directly in the request so our renderer can log in before taking the screenshot.

How to Pass Credentials

  • username & password parameters: Ideal for HTTP Basic or Digest challenge prompts.
  • header parameter: Supply additional headers (e.g., header=Authorization:Bearer%20TOKEN) to pass API tokens, session cookies, or custom auth values.
  • cookie parameter: Inject cookies before the page loads to simulate logged-in sessions.

Basic Authentication Valid Credentials

The example below shows a screenshot of a website using HTTP authentication:

// Line breaks added for readability https://api.addscreenshots.com/screenshots
?apikey=
YOUR_API_KEY
&username=guest
&password=guest

&url=https://jigsaw.w3.org/HTTP/Basic/

Screenshot with Authentication

Authentication with Custom Headers

When an endpoint expects bearer tokens or session cookies, combine the header parameter with your credentials. Multiple headers can be supplied by repeating the parameter.

// Add a bearer token and custom cookie before capturing
https://api.addscreenshots.com/screenshots
?apikey=
YOUR_API_KEY
&header=Authorization:Bearer%20TOKEN_VALUE
&cookie=sessionid=SESSION_VALUE
&url=https://secure.example.com/dashboard

Basic Authentication Invalid Credentials

The example below shows a screenshot of a website with invalid credentials:

// Line breaks added for readability https://api.addscreenshots.com/screenshots
?apikey=
YOUR_API_KEY
&username=guest
&password=invalid

&url=https://jigsaw.w3.org/HTTP/Basic/

Screenshot with access denied

Securely capture your authenticated pages today—explore plans or manage API keys to begin.