<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
# Cookie Consent Compliance — API Reference

## Scan Pre-Consent Cookies

```bash
node scripts/agent.js --action scan-preconsent --url https://example.com
```

## Audit Cookie Declarations

```bash
node scripts/agent.js --action audit-declarations --url https://example.com \
  --declarations /tmp/cookie_policy.json
```

## Check Banner Compliance

```bash
node scripts/agent.js --action check-banner --url https://example.com
```

## Generate Report

```bash
node scripts/agent.js --action report --audit /tmp/audit.json
```

## Cookie Categories

| Category | Consent Required | Common Patterns |
|----------|-----------------|-----------------|
| Necessary | No | PHPSESSID, csrftoken, session |
| Analytics | Yes | _ga, _gid, _hjid, mp_ |
| Advertising | Yes | _fbp, IDE, _gcl_ |
| Functional | Yes | lang, locale, theme |

## Banner Compliance Checks

| ID | Check | Regulation |
|----|-------|------------|
| CB-01 | Banner on first visit | ePrivacy Art. 5(3) |
| CB-02 | Equal prominence reject/accept | EDPB Guidelines |
| CB-03 | Granular category selection | GDPR Art. 7 |
| CB-04 | No pre-checked boxes | Planet49 (C-673/17) |
| CB-05 | No cookie wall | EDPB Guidelines 05/2020 |

## Output Format

```json
{
  "tool": "cookie-auditor",
  "action": "check-banner",
  "url": "https://example.com",
  "total_checks": 7,
  "results": [...]
}
```
