# Cookie CMP Scanner (`junipr/cookie-cmp-scanner`) Actor

Inventory cookies, consent banners, CMP vendor hints, Consent Mode signals, tracker categories, and privacy risk recommendations from supplied page snapshots.

- **URL**: https://apify.com/junipr/cookie-cmp-scanner.md
- **Developed by:** [junipr](https://apify.com/junipr) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 browser page checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Cookie CMP Scanner

### Store Positioning

**Store title:** Cookie CMP Scanner

**Short description:** Inventory cookies, consent banners, CMP vendor hints, Consent Mode signals, tracker categories, and privacy risk recommendations from supplied page snapshots.

**SEO title:** Cookie CMP Scanner — browser, screenshot, and rendered-page audit

**SEO description:** Inventory cookies, consent banners, CMP vendor hints, Consent Mode signals, tracker categories, and privacy risk recommendations from supplied page snapshots. Use it when rendered pages, screenshots, dynamic UI, or browser-visible evidence matters, with explicit caps and cost controls.

**Categories:** SEO\_TOOLS, AUTOMATION

**Keywords:** cookie, cmp, scanner, browser/screenshot/rendered-page actor

### Fixed-Inclusive PPE Pricing

This actor uses pay-per-event pricing. Event prices include Apify platform usage; users are not expected to pay a separate platform-usage pass-through charge for the configured pricing model.

- Tier: B1 — Browser/screenshot/rendered-page actor
- Primary event: `browser-page-checked` at $0.01500 base
- Default max charge: $50.00
- Store discounts: FREE/BRONZE base, SILVER discounted, GOLD deepest approved discount

Event set:

- `actor-start`: base $0.05000, GOLD $0.04400. Cookie Cmp Scanner: charged when actor start is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `browser-page-checked`: base $0.01500, GOLD $0.01320. Cookie Cmp Scanner: charged when browser page checked is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `screenshot-captured`: base $0.01000, GOLD $0.00880. Cookie Cmp Scanner: charged when screenshot captured is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `issue-detected`: base $0.01300, GOLD $0.01140. Cookie Cmp Scanner: charged when issue detected is completed. The price includes Apify platform usage; no separate usage pass-through is intended.
- `report-generated`: base $0.10000, GOLD $0.08800. Cookie Cmp Scanner: charged when report generated is completed. The price includes Apify platform usage; no separate usage pass-through is intended.

### Public Task Concepts

- Audit Cookie CMP controls with capped supplied targets
- Find high-priority Cookie CMP issues before release
- Validate Cookie CMP evidence from supplied pages
- Prioritize Cookie CMP fixes with severity and proof
- Export Cookie CMP QA rows for client review

Inventory cookies, consent banners, CMP vendor hints, Google Consent Mode signals, tracker categories, and privacy risk recommendations from supplied page snapshots.

This actor is fixture-first by default: it analyzes HTML, headers, cookie banner text, and cookie snapshots supplied in the input. It does not launch a browser, run Playwright, or fetch URLs unless `fetchUrls` is explicitly set to `true`.

### What It Checks

- CMP vendor hints for OneTrust, Cookiebot, Didomi, TrustArc, Quantcast Choice, Osano, CookieYes, iubenda, Sourcepoint, and Termly.
- Google Consent Mode signals such as `ad_storage`, `analytics_storage`, `ad_user_data`, and `ad_personalization`.
- IAB TCF indicators including `__tcfapi`, `__cmp`, `euconsent-v2`, and `IABTCF_*` cookies.
- Cookie categories: necessary, analytics, marketing, preferences, functional, and unknown.
- Banner controls for accept, reject, preferences, and privacy policy links.
- Privacy risk signals such as tracking without a detected CMP, missing reject controls, long-lived marketing cookies, and consent granted by default.

### Input Example

Set `maxChargeUsd` to a finite run budget. It defaults to `$10`; the actor stops before paid work or withholds uncharged reports when the next event would exceed the cap.

```json
{
  "targets": [
    {
      "sourceId": "home-page-snapshot",
      "sourceUrl": "https://example.com",
      "html": "<script src=\"https://cdn.cookielaw.org/scripttemplates/otSDKStub.js\"></script><script>gtag('consent','default',{ad_storage:'denied',analytics_storage:'denied'});</script><div id=\"onetrust-banner-sdk\"><button>Accept all</button><button>Reject all</button><button>Preferences</button><a href=\"/privacy\">Privacy Policy</a></div>",
      "headers": {
        "set-cookie": [
          "OptanonConsent=1; Max-Age=31536000",
          "_ga=GA1; Max-Age=63072000",
          "_fbp=fb.1; Max-Age=7776000"
        ]
      }
    }
  ],
  "fetchUrls": false,
  "includeReport": true,
  "maxTargets": 1
}
```

### Output

Each dataset item represents one scanned snapshot:

```json
{
  "sourceId": "home-page-snapshot",
  "status": "warn",
  "severity": "low",
  "privacyHealthScore": 88,
  "cmpVendorNames": ["OneTrust"],
  "consentModeDetected": true,
  "cookieCategoryCounts": {
    "necessary": 1,
    "analytics": 1,
    "marketing": 1,
    "preferences": 0,
    "functional": 0,
    "unknown": 0
  },
  "riskSignalCodes": ["marketing-cookies-present"],
  "recommendations": ["Confirm marketing cookies are blocked until valid consent is collected."]
}
```

When `includeReport` is enabled, the actor also writes:

- `COOKIE_CMP_RESULTS.json`
- `COOKIE_CMP_SUMMARY.json`
- `COOKIE_CMP_REPORT.md`

### Optional Live Fetch

Set `fetchUrls` to `true` and provide `urls` to fetch HTML and response headers with Node `fetch`. This path is capped by `maxTargets`, `fetchTimeoutMs`, and `maxHtmlBytes`. It still does not run a browser, execute scripts, accept banners, or inspect post-interaction cookies.

Use supplied snapshots when you need deterministic QA, before/after comparisons, or scans collected by your own browser/testing stack.

### Limitations

- This is not legal advice and does not certify privacy-law compliance.
- Static snapshots cannot prove whether cookies are blocked before consent unless the supplied snapshot captures that state.
- Optional live fetch does not execute JavaScript, so it may miss CMPs injected only after client-side rendering.
- Browser rendering, banner interaction, and post-consent comparison are intentionally out of scope for this package.

### Safe Use

Scan only pages you are authorized to test. Avoid collecting personal data in supplied snapshots. Redact session identifiers or user-specific cookie values before uploading input.

# Actor input Schema

## `targets` (type: `array`):

HTML/header/cookie snapshots to scan. Defaults to a small OneTrust fixture that finishes locally without network or browser work.

## `urls` (type: `array`):

Optional URLs to fetch only when fetchUrls is true. Leave empty for fixture/local runs.

## `fetchUrls` (type: `boolean`):

Fetch page HTML and headers over HTTP. Default is false to avoid browser/network work and Apify cloud credits.

## `maxItems` (type: `integer`):

Alias for Max Targets/Maximum Records used by the Junipr actor baseline. When both are provided, actor-specific limits still apply.

## `includeReport` (type: `boolean`):

Write summary JSON and Markdown report artifacts to the key-value store.

## `maxTargets` (type: `integer`):

Maximum snapshots or URLs to scan.

## `fetchTimeoutMs` (type: `integer`):

HTTP timeout for optional URL fetches.

## `maxHtmlBytes` (type: `integer`):

Maximum HTML bytes to read or analyze per page.

## `maxChargeUsd` (type: `number`):

Hard local spending cap for actor-start, per-item, and report events. The actor stops before work or withholds uncharged output when the next event would exceed this amount.

## `dryRun` (type: `boolean`):

Validate input and write a dry-run summary without PPE charges or dataset output.

## `debug` (type: `boolean`):

Enable debug logs.

## Actor input object example

```json
{
  "targets": [
    {
      "sourceId": "sample-onetrust-consent-mode",
      "sourceUrl": "https://example.com",
      "html": "<!doctype html><html><head><meta name=\"privacy-policy\" content=\"https://example.com/privacy\"><script src=\"https://cdn.cookielaw.org/scripttemplates/otSDKStub.js\"></script><script>gtag('consent','default',{ad_storage:'denied',analytics_storage:'denied',ad_user_data:'denied',ad_personalization:'denied',wait_for_update:500});</script><script src=\"https://www.googletagmanager.com/gtm.js?id=GTM-TEST\"></script></head><body><div id=\"onetrust-banner-sdk\">We use cookies. <button>Accept all</button><button>Reject all</button><button>Preferences</button><a href=\"/privacy\">Privacy Policy</a></div></body></html>",
      "headers": {
        "set-cookie": [
          "OptanonConsent=isGpcEnabled=0; Path=/; Max-Age=31536000; SameSite=Lax",
          "_ga=GA1.1.123; Path=/; Max-Age=63072000; SameSite=Lax",
          "_fbp=fb.1.123; Path=/; Max-Age=7776000; SameSite=Lax"
        ]
      }
    }
  ],
  "urls": [],
  "fetchUrls": false,
  "maxItems": 10,
  "includeReport": true,
  "maxTargets": 10,
  "fetchTimeoutMs": 10000,
  "maxHtmlBytes": 750000,
  "maxChargeUsd": 10,
  "dryRun": false,
  "debug": false
}
```

# Actor output Schema

## `results` (type: `string`):

Cookie/CMP scan results in the default dataset.

## `summary` (type: `string`):

JSON summary in the key-value store when includeReport is enabled.

## `markdownReport` (type: `string`):

Markdown report in the key-value store when includeReport is enabled.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/cookie-cmp-scanner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("junipr/cookie-cmp-scanner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call junipr/cookie-cmp-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=junipr/cookie-cmp-scanner",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/7EVQ2j1crjLmzHxPe/builds/ydzhEwfeqIWpY6B9a/openapi.json
