# Crawlmetry

> Real-time web analytics, AI-to-human attribution, and Agent Readiness Optimization for AI Agents, Bots, and Humans. Built on Cloudflare Workers + SQLite Durable Objects.

## What Crawlmetry Does
- Tracks 100% of web traffic by combining a <2KB privacy-first client script with a zero-latency Edge Observer (Cloudflare Worker, Next.js Middleware, Vercel Edge, Express).
- Classifies every request into 4 live layers: Humans, Real-Time AI Retrieval/Action Agents (ChatGPT-User, OAI-SearchBot, Perplexity-User, Claude-User, Browser-Use), AI Training Crawlers (GPTBot, ClaudeBot, Google-Extended, Meta-ExternalAgent), and Search/Other Bots.
- Audits any website's Agent Readiness Score (0-100) across robots.txt AI policies, /llms.txt, SSR readability, JSON-LD structured data, token efficiency, and edge latency.
- Attributes AI retrieval reads to downstream human referrals from chatgpt.com, perplexity.ai, claude.ai, and gemini.google.com.
- Exposes a native Model Context Protocol (MCP) server at /api/mcp.

## Key URLs
- [Home & Free Agent Readiness Grader](https://crawlmetry.com/)
- [Live Interactive Demo Dashboard](https://crawlmetry.com/app)
- [Full Machine-Readable Documentation](https://crawlmetry.com/llms-full.txt)
- [MCP Endpoint](https://crawlmetry.com/api/mcp)
- [Public Audit API](https://crawlmetry.com/api/v1/audit)

## Pricing
- Starter: $0/month (50,000 events/month, 3 sites, Live Stream, Agent Readiness Grader)
- Pro: $29/month (500,000 events/month, 10 sites, Edge Observer, AI Attribution, MCP Server)
- Growth: $99/month (3,000,000 events/month, unlimited sites, custom policies & priority support)


## Integration Quickstart

### 1. Client Tracker (<2KB, Cookie-Free)
```html
<script defer src="https://crawlmetry.com/t.js" data-key="YOUR_PUBLIC_KEY"></script>
```

### 2. Cloudflare Worker Edge Observer (Zero Latency via waitUntil)
```typescript
export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext) {
    const start = Date.now();
    const response = await fetch(request);
    ctx.waitUntil(
      fetch("https://crawlmetry.com/api/v1/ingest", {
        method: "POST",
        headers: { "Content-Type": "application/json", "x-crawlmetry-key": env.CRAWLMETRY_KEY },
        body: JSON.stringify({
          path: new URL(request.url).pathname,
          method: request.method,
          statusCode: response.status,
          latencyMs: Date.now() - start,
          userAgent: request.headers.get("user-agent") || "",
          referrer: request.headers.get("referer") || "",
          country: request.cf?.country || "US",
          sourceType: "edge"
        })
      })
    );
    return response;
  }
};
```

### 3. Native MCP Server Tools (/api/mcp)
- `get_traffic_overview`: Fetch Humans vs AI Agents vs Bots breakdown for a site.
- `get_top_ai_agents`: List top AI retrieval agents and training crawlers with latency and error rates.
- `get_ai_referrals`: Inspect human visits and conversions referred from ChatGPT, Perplexity, Claude, and Gemini.
- `run_agent_audit`: Run a live 0-100 Agent Readiness audit on any public URL.
