# GDPR & Privacy Cookie Scanner (`andok/gdpr-cookie-scanner`) Actor

Scan websites to identify tracking cookies and third-party scripts. Automate privacy compliance and GDPR audits.

- **URL**: https://apify.com/andok/gdpr-cookie-scanner.md
- **Developed by:** [Andok](https://apify.com/andok) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 25 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.47 / 1,000 site scanneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GDPR Cookie Compliance Scanner

Scan any website for GDPR cookie compliance violations in seconds. Privacy audits and consent banner checks are time-consuming when done manually — run bulk scans across client portfolios and get a clear Pass/Warning/Fail grade for each site. Built on a real browser engine to catch JavaScript-set cookies that static scanners miss.

### Features

- **Pre-consent cookie detection** — identifies analytics, marketing, and tracking cookies set before user consent
- **Cookie categorization** — classifies every cookie as necessary, analytics, marketing, functional, or unknown
- **Consent banner detection** — recognizes major CMPs including OneTrust, Cookiebot, and Cookie Notice
- **Compliance grading** — assigns Pass, Warning, or Fail based on GDPR best practices
- **Third-party cookie analysis** — flags cookies from external domains (Facebook, Google, HubSpot, Hotjar, etc.)
- **Post-consent comparison** — captures cookies before and after accepting consent to show what changes
- **Bulk scanning** — process hundreds of URLs in a single run for agency-scale audits

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `urls` | `array` | Yes | — | Website URLs to scan for cookie compliance. Each URL is loaded in a real browser to capture all cookies, including those set by JavaScript. |
| `waitForBanner` | `boolean` | No | `true` | When enabled, the scanner waits for a cookie consent banner to appear and attempts to click "Accept" to compare pre- and post-consent cookies. Disable if you only want the pre-consent snapshot. |
| `timeout` | `integer` | No | `30000` | Maximum time in milliseconds to wait for page load and banner detection. Increase for slow-loading sites or complex single-page applications. Range: 5,000–120,000 ms. |

#### Input Example

```json
{
  "urls": [
    { "url": "https://crawlee.dev" },
    { "url": "https://example.com" }
  ],
  "waitForBanner": true,
  "timeout": 30000
}
```

### Output

Each scanned URL produces a detailed compliance report with cookie inventories, categorization, consent banner status, and a compliance grade.

Key output fields:

- `url` — the scanned page URL
- `complianceGrade` — `Pass`, `Warning`, or `Fail`
- `issues` — list of specific compliance problems found
- `preConsentCookies` — cookies present before any user interaction
- `postConsentCookies` — cookies added after accepting the consent banner
- `cookiesSetWithoutConsent` — non-necessary cookies loaded before consent (the main GDPR risk)
- `consentBannerDetected` — whether a cookie consent banner was found
- `consentManagementPlatform` — detected CMP (OneTrust, Cookiebot, etc.)
- `totalCookies` — total cookie count across the session
- `trackingCookies` — number of identified tracking cookies
- `thirdPartyCookies` — cookies from external domains

#### Output Example

```json
{
  "url": "https://example.com",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "complianceGrade": "Fail",
  "issues": [
    "3 non-necessary cookies set before consent",
    "2 tracking cookies set before consent"
  ],
  "consentBannerDetected": true,
  "consentManagementPlatform": "OneTrust",
  "totalCookies": 12,
  "trackingCookies": 5,
  "preConsentCookies": [
    {
      "cookie": { "name": "_ga", "domain": ".example.com", "path": "/", "expires": 1737000000 },
      "category": "analytics",
      "isTracker": true,
      "trackerType": "Google Analytics"
    }
  ],
  "thirdPartyCookies": [
    {
      "cookie": { "name": "_fbp", "domain": ".facebook.com", "path": "/", "expires": 1737000000 },
      "category": "marketing",
      "isTracker": true,
      "trackerType": "Facebook Pixel"
    }
  ]
}
```

### Pricing

| Event | Cost |
|-------|------|
| Site Scanned | $0.01 per URL |

Free tier available — pay only for Apify platform usage beyond free limits.

### Use Cases

- **Privacy compliance audits** — scan client websites before GDPR audits and generate evidence-ready reports showing cookie violations
- **Agency client reporting** — run bulk scans across all client domains on a schedule and flag new compliance issues automatically
- **Vendor due diligence** — verify that third-party SaaS tools and marketing platforms are not setting tracking cookies without consent
- **Pre-launch QA** — check new websites or redesigns for cookie compliance before going live
- **Competitive benchmarking** — compare cookie practices across competitors to identify industry-standard consent implementations

### Related Actors

| Actor | What it adds |
|-------|-------------|
| [Security Headers Analyzer](https://apify.com/andok/security-headers-analyzer) | Audit HTTP security headers alongside cookie compliance for a full privacy and security review |
| [Tech Stack Analyzer](https://apify.com/andok/tech-stack-analyzer) | Identify the CMS, frameworks, and third-party scripts that may be setting the cookies you found |
| [Broken Links Checker](https://apify.com/andok/broken-links-checker) | Combine cookie compliance with broken-link detection for a comprehensive site health audit |

### Notes

- The scanner uses a real Chromium browser via Playwright, so it captures JavaScript-set cookies that HTTP-only scanners miss.
- Consent banner detection relies on common CMP selectors (OneTrust, Cookiebot, generic patterns). Custom or uncommon banners may not be detected.
- Compliance grading is advisory — it highlights common GDPR issues but does not constitute legal advice.

# Actor input Schema

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

Website URLs to scan for cookie compliance. Each URL is loaded in a real browser to capture all cookies, including those set by JavaScript.

## `waitForBanner` (type: `boolean`):

When enabled, the scanner waits for a cookie consent banner to appear and attempts to click "Accept" to compare pre- and post-consent cookies. Disable to capture only the pre-consent snapshot.

## `timeout` (type: `integer`):

Maximum time in milliseconds to wait for page load and banner detection. Increase for slow-loading sites or complex single-page applications.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "waitForBanner": true,
  "timeout": 30000
}
```

# Actor output Schema

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

No description

# 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 = {
    "urls": [
        {
            "url": "https://crawlee.dev"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("andok/gdpr-cookie-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 = { "urls": [{ "url": "https://crawlee.dev" }] }

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

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

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

```

## CLI example

```bash
echo '{
  "urls": [
    {
      "url": "https://crawlee.dev"
    }
  ]
}' |
apify call andok/gdpr-cookie-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andok/gdpr-cookie-scanner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FqWVLTQVAarSWAGaZ/builds/ptU1sb80dsLUwuw8N/openapi.json
