VisitorType

API reference

Three public endpoints power the snippet and server-side tracking. All are CORS-open and scoped to a container's public id. The MCP endpoint additionally requires an API key.

POST /api/c/:publicId/collect

Called by the snippet on each page view. Classifies the request's user agent (plus optional client signals), stores an event, and returns the classification together with the published config — one round trip.

curl -X POST https://visitortype.ai/api/c/AITM-XXXXXXX/collect \
  -H "Content-Type: application/json" \
  -H "User-Agent: GPTBot/1.2" \
  -d '{"path": "/pricing", "url": "https://example.com/pricing", "signals": {"webdriver": false}}'

// → { "eventId": "...", "classification": { "visitorType": "ai_crawler",
//     "agentName": "GPTBot", "vendor": "OpenAI", ... }, "config": { "version": 3, "tags": [...] } }

POST /api/c/:publicId/server-collect

Server-side ingestion; single events or batches up to 500.

curl -X POST https://visitortype.ai/api/c/AITM-XXXXXXX/server-collect \
  -H "Content-Type: application/json" \
  -d '{"events": [
        {"userAgent": "ClaudeBot/1.0", "path": "/pricing"},
        {"userAgent": "PerplexityBot/1.0", "path": "/docs"}
      ]}'

// → { "accepted": 2, "classifications": [
//     { "visitorType": "ai_crawler", "agentName": "ClaudeBot" },
//     { "visitorType": "ai_search",  "agentName": "PerplexityBot" } ] }

GET /api/c/:publicId/config

The currently published configuration — useful for debugging what's live.

curl https://visitortype.ai/api/c/AITM-XXXXXXX/config
// → { "containerId": "AITM-XXXXXXX", "version": 3, "tags": [ ... ] }

POST /api/mcp

The MCP server (JSON-RPC over Streamable HTTP, stateless). Requires Authorization: Bearer aitm_…. See Connect your AI.

Event fields

FieldDescription
classificationVisitor type at collection time
agentName / agentCategoryIdentified agent and its category, when matched
sourcesnippet (browser) or server (server-collect)
path / referrer / userAgentRequest context (truncated to sane lengths)
firedTagsTag ids the snippet fired for this event