ScreenshotNeo

BlogHow-to

How to Hide Cookie Banners in PagePeeker Website Screenshots

PagePeeker’s public API does not document a cookie-banner removal setting. Here are the supported options and a clean-capture alternative.

By the ScreenshotNeo team4 October 20266 min read

Short answer: PagePeeker’s public V2 API documentation does not list a setting to hide or remove cookie banners. It also does not document CSS injection or element selectors. Do not add an invented parameter such as hide_cookie_banner. If you need a clean screenshot and still want PagePeeker to capture the page, ask PagePeeker whether it can provide a customer-specific premium configuration, or use a capture tool that documents banner handling.

This guide explains what PagePeeker documents, what you can do as the site owner, and how to capture a clean image with a different workflow.

1. What PagePeeker’s public API supports

PagePeeker identifies its V2 API as the recommended version. Its documented controls cover the target URL, thumbnail size, an optional account code, premium refresh, and waiting for a generated thumbnail. The public API documentation does not list a cookie-banner toggle, CSS injection option, or selector parameter. See PagePeeker’s Website Thumbnails API documentation.

PagePeeker’s premium customization page describes other options, including dimensions, maximum capture height, compression, thumbnail sizes, overlay text, wait times, and Flash detection. It invites premium account holders to contact PagePeeker about their needs, but does not promise cookie-banner suppression. Confirm availability directly before relying on a custom configuration. See PagePeeker’s premium screenshot customization information.

In short: the documentation reviewed does not establish that PagePeeker can remove a banner while keeping the screenshot. That is a bounded statement about its published documentation, not a claim that a private or newer custom feature cannot exist.

2. Pick the right outcome

Your goal Practical next step
Keep a PagePeeker screenshot, but remove the banner Ask PagePeeker whether a customer-specific premium setup can handle the banner. Do not assume a public API parameter exists.
Stop PagePeeker from capturing your own site Add the documented PagePeeker robots.txt disallow rule. This opts out of capture; it does not produce a clean thumbnail.
Capture a third-party site without its banner You cannot change that site’s robots.txt. Use a capture workflow that explicitly supports consent handling or element/CSS control.

Hiding a banner visually is not the same as accepting or rejecting consent. If your task requires a recorded consent choice, use an appropriate consent workflow; a screenshot tool hiding pixels does not, by itself, record the visitor’s choice.

3. If you own the site, opt out with robots.txt

PagePeeker documents this robots.txt rule to disallow its robot:

User-agent: PagePeeker
Disallow: /

Place the rule in the site’s root robots.txt, typically served at https://your-domain.example/robots.txt. Follow your normal deployment process, then check that the published file contains the rule. This instruction applies to the site operator. It prevents PagePeeker’s robot from taking screenshots; it does not hide the cookie banner in an otherwise successful capture. See PagePeeker’s robot information.

4. Capture a clean image with ScreenshotNeo

If you need the screenshot rather than an opt-out, ScreenshotNeo is a website screenshot API and MCP server for developers. Its capture flow accepts cookie/consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture. Each step can be turned off. Its public API also supports CSS selectors and custom CSS when you need page-specific control. See the ScreenshotNeo API documentation for the available parameters.

Use this one-call request, replacing the target URL and API key:

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

The following equivalent examples save the response body. For production use, check the HTTP status and response headers before treating the file as a successful screenshot.

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
with open("shot.webp", "wb") as f:
    f.write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const bytes = new Uint8Array(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', bytes));

The request examples use Stripe as a sample target. Change url to the page you are authorized to capture. ScreenshotNeo supports PNG, JPEG, WebP, or PDF output, full-page capture, element capture by CSS selector, custom CSS and JavaScript, click-before-capture, waiting conditions, and other capture settings; consult the docs for exact parameter names and combinations.

5. Troubleshooting and operating notes

PagePeeker’s thumbnail still shows the banner

That is consistent with the public API’s documented controls: they do not include banner removal. Check the API documentation for changes and ask PagePeeker about a premium configuration. Do not keep guessing parameter names; an undocumented query parameter is not evidence that the service will apply it.

The PagePeeker robot still appears to capture your site

Verify that the rule is in the root robots.txt, that the user-agent line says PagePeeker, and that the published file contains Disallow: /. Robots.txt is an instruction to compliant crawlers, not an access-control mechanism. This rule is for site owners and opts out of capture.

The ScreenshotNeo result is not the expected image

  • A banner or popup remains: it may not be recognized automatically, or it may appear after the initial page load. Use the documented selector/custom CSS controls or wait for the relevant page state.
  • The page looks incomplete: choose a suitable wait condition, such as waiting for a selector, a delay, or network idle. For long pages, use full-page capture so lazy-loaded images can load.
  • The response is not a usable image: check the HTTP status and the X-Page-Verdict and X-Billed response headers. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing according to ScreenshotNeo’s billing rules.
  • The request times out in your client: set a client timeout long enough for page loading and capture, and retry transient network errors with a bounded retry policy. Avoid retrying invalid URLs or persistent site failures indefinitely.

ScreenshotNeo also supports caching with a chosen TTL, async jobs with signed webhooks, and bulk capture of up to 100 URLs per call. Caching can avoid repeated work for unchanged pages; async jobs and bulk requests can suit larger capture runs. Review the docs and response billing headers when estimating usage. Plans are Free with 1,000 shots/month and no card, Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000; yearly billing gives two months free, and every feature is on every plan.

6. Frequently asked questions

Not in the public API documentation described here. Ask PagePeeker directly about any customer-specific premium option.

Can I use robots.txt to remove the banner but keep the screenshot?

No. The documented rule tells PagePeeker not to capture your site. It is an opt-out, not a banner-hiding feature.

Can I hide a banner on a site I do not own by editing robots.txt?

No. Only the site operator can change that site’s robots.txt. For a third-party URL, use a capture tool with documented page-level controls.

No. Visual removal and a consent decision are separate actions. Do not treat a clean screenshot as proof that consent was accepted or rejected.

Or skip the browser setup

Make one API request with ScreenshotNeo:

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

Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. See the API docs and sign up for free.