October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Add Authentication Cookies to Apify Website Screenshot Requests

Use the Actor’s cookies array for target-site session cookies, keep them separate from your Apify API token, and verify the screenshot shows authenticated content.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For Apify’s josh99smith/website-screenshot-api Actor, pass the target website’s session cookies in the Actor input’s cookies array. The Actor documents Playwright-style cookie objects and says it sets them before navigating to the requested page. Keep these separate from the Apify API token, which authenticates your request to Apify.

Pass the target site’s cookies in the Actor input

Use a cookie object with the session cookie’s name, current value, domain, and path. Replace the example values with cookies for a session you are authorized to use:

As an Amazon Associate I earn from qualifying purchases.

{
  "urls": ["https://www.example.com/account"],
  "cookies": [
    {
      "name": "session",
      "value": "<YOUR_SESSION_COOKIE>",
      "domain": ".example.com",
      "path": "/"
    }
  ]
}

This is an input template, not a tested request against a live authenticated site. Do not place a real session value in published code or shared examples. The Actor’s exact schema and current calling examples are on its documentation page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose how to run the Actor

Apify Console

Open the Actor in Apify Console, enter the screenshot URL, and expand Advanced options to find Cookies. Supply the cookie objects there. The input JSON property is named cookies. Other Actors may use different schemas, so use the page for the exact Actor you are running.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

JavaScript client

The Actor page documents calling it with client.actor("josh99smith/website-screenshot-api").call(input). Initialize the client with your Apify token and pass the same object shown above as the input:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('josh99smith/website-screenshot-api').call({
  urls: ['https://www.example.com/account'],
  cookies: [
    {
      name: 'session',
      value: process.env.SITE_SESSION_COOKIE,
      domain: '.example.com',
      path: '/',
    },
  ],
});

console.log(run.id, run.status);

Set APIFY_TOKEN and SITE_SESSION_COOKIE in the runtime environment rather than hard-coding them. The client call starts the Actor run; inspect its result and page records to confirm the captured page actually shows the authenticated content.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

REST API

Apify’s REST pattern runs an Actor with a POST request whose JSON body is the Actor input. Authenticate that request with an Apify bearer token; put the website cookies in the body’s cookies array, not in the Authorization header. See Apify API documentation for the current run endpoint and request form.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -X POST 
  -H "Authorization: Bearer $APIFY_TOKEN" 
  -H "Content-Type: application/json" 
  --data '{
    "urls": ["https://www.example.com/account"],
    "cookies": [
      {
        "name": "session",
        "value": "'"$SITE_SESSION_COOKIE"'",
        "domain": ".example.com",
        "path": "/"
      }
    ]
  }' 
  "https://api.apify.com/v2/acts/josh99smith~website-screenshot-api/runs"

For production scripts, prefer a JSON serializer or a protected secret store over shell string interpolation: session values can contain characters that require JSON escaping. Apify documents bearer-token authentication for API requests at docs.apify.com/api.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Keep website cookies and Apify credentials distinct

The cookies array represents the browser session for the site being captured. The Apify API token identifies and authorizes the caller to Apify; it does not belong in the target site’s cookies. A bad or missing Apify token prevents starting the run, while a bad or inapplicable site cookie can result in an unauthenticated capture. Apify’s API documentation describes API authentication, and the Apify Security Whitepaper discusses application-secret distinctions; that whitepaper is dated 2020 and is not a current, exhaustive security assessment.

What cookie handling does—and does not—mean

The Actor documentation says it sets supplied cookies before navigation and that cookies are never logged. Treat this as a statement about the Actor’s documented behavior, not a guarantee about the target site, Apify platform storage, or every log in your own workflow. Use only sessions you are entitled to use; do not commit live values to source control, print them in logs, or paste them into shared tickets. If a value is exposed, remove or rotate that session as appropriate for the site.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Cookie-banner handling is separate. The Actor’s hideCookieBanners option hides consent banners visually with CSS; it does not accept consent for you and does not authenticate the page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the captured page when authentication fails

  1. Verify cookie scope. Confirm the cookie’s domain matches the requested host and its path covers the requested URL. A cookie scoped to another domain or path may not apply.
  2. Confirm the session is current. The Actor can set the supplied value before navigation, but cannot make an expired or revoked session valid.
  3. Look for additional login requirements. The Actor documentation does not promise that every authentication system accepts a supplied cookie alone; the site may require another step or challenge.
  4. Inspect per-page output. The Actor returns page records with a success state and screenshot URL when successful; its example output also includes status and warnings. Open the screenshot and check the visible content instead of assuming that a successful run means the account page was authenticated.
  5. Separate request failures from page failures. If Apify cannot start the Actor, check the Apify token and request. If the run starts but the page is logged out, investigate the website cookie and authentication flow.
  6. Check the Actor schema. This example is for josh99smith/website-screenshot-api. Confirm the current input reference if you use another Actor or if the documented interface changes.

The Actor also documents controls such as waitForSelector, load waiting, delay, scrolling, and retry parameters. These may help when content renders after initial navigation, but they do not bypass a login challenge or guarantee authenticated capture.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return an image or PDF. Its clean-shot flow accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf.

For example, this cURL call saves a WebP capture:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options and authentication. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Frequently Asked Questions

Does adding a cookie banner-hiding option log me in?

No. Hiding a banner changes its visual display; authentication requires an applicable target-site session cookie or another supported login method.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can the Actor guarantee that a supplied session cookie will work?

No. The cookie must be valid and applicable, and the target site may require additional authentication steps.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.