Developer + AI Operator Docs
Use LegalKit from your app, terminal, or AI agent. Scan a site, generate the compliance layer, fetch install assets, verify what is live, and keep proof current.
API
Drive the workflow from your app or CI: scan, generate, install, verify, and monitor.
CLI
Operate LegalKit from a terminal for one-shot previews, install assets, and deploy verification.
MCP
Connect Claude Code or Codex and let the agent run the workflow with human publish guardrails.
What Claude Code can already do
Publish remains gated behind explicit human review confirmation.
CLI Quickstart
The CLI is the fastest way to operate LegalKit from a terminal or from an AI coding loop.
npm install -g @legalkit/cli
export LEGALKIT_API_KEY=lk_live_xxxxxxxxxxxxx
legalkit one-shot --site-id site_xxx --contact-email [email protected]
legalkit install --site-id site_xxx --snippet banner
legalkit verify --site-id site_xxx --mode hostedUse preview mode by default. Publishing generated policies still requires explicit human review confirmation.
MCP + Claude Code
Start the MCP server from the CLI when you want Claude Code or another agent to drive the workflow directly.
export LEGALKIT_API_KEY=lk_live_xxxxxxxxxxxxx
legalkit mcpCurrent MCP tools cover site listing, site detail, scans, reports, install assets, verification, and one-shot flows.
Authentication
Most API endpoints require authentication using an API key. Include your key in theAuthorization header.
Get your API key from the dashboard settings.
Rate Limits
| Plan | Requests/min | Scans/day |
|---|---|---|
| Free | 10 | 50 |
| Pro | 60 | 500 |
| Enterprise | 300 | Unlimited |
Scanner
Code Example
Request
const response = await fetch("https://legalkit.io/api/scan", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://example.com",
"deepScan": true
}),
});
const data = await response.json();Body Parameters
urlstringrequiredThe URL to scan
deepScanbooleanEnable JavaScript tracker detection
multiPagebooleanScan multiple pages
Response
{
"result": {
"domain": "example.com",
"complianceScore": 78,
"summary": {
"totalServices": 12,
"requiresConsent": 8,
"criticalFindings": 1
},
"services": [...],
"recommendations": [...]
}
}Webhook Events
Subscribe to these events to receive real-time notifications.
scan.completedWebsite scan finished successfully
scan.failedScan encountered an error
tracker.newNew tracker detected on site
fingerprinting.detectedBrowser fingerprinting found
score.decreasedCompliance score dropped
score.increasedCompliance score improved
alert.triggeredMonitoring alert fired
consent.acceptedUser accepted cookies
consent.rejectedUser rejected cookies