What it does

Top referring hosts. Attribution metric — counts direct browser visits only ('user' class). AI-mediated traffic (Claude/ChatGPT fetching on a user's behalf) is excluded because the AI sets its own host as referrer or strips it; including it would inflate 'direct' or 'claude.ai' without telling you where the human attention actually came from.

Example prompts

Ask:

"Where is mysite.com traffic coming from this week?"
"Top referrers for the last 30 days, anything new?"
"Show me my top 20 referrers."

A typical response:

Top referrers for mysite.com (last 7 days):

  news.ycombinator.com   1,847 visits
  twitter.com              612 visits
  reddit.com               487 visits
  bluesky.app              312 visits
  dev.to                   258 visits
  google.com (organic)     244 visits
  perplexity.ai            147 visits  (AI-mediated human)
  chatgpt.com              124 visits  (AI-mediated human)
  duckduckgo.com            89 visits
  linkedin.com              71 visits

Returns an array of { referrer_host, visits } objects.

Attribution metric: counts direct browser visits only (the user traffic class). AI-mediated traffic (ai_user_action, i.e. Claude or ChatGPT fetching on a user's behalf) is excluded from this list, because the AI sets its own host as the referrer or strips it. Including it would inflate "direct" or "claude.ai" without telling you where the human attention actually came from. Use traffic_class_breakdown to see the AI-mediated share separately.

The "AI-mediated human" lines above (perplexity.ai, chatgpt.com) ARE included here. Those are humans clicking through from those services in their browser, not the AI fetching for them. That distinction matters for understanding AI's role in your acquisition funnel.

Arguments

Name Type Required Description / Default
site_id string required Site identifier from list_sites (8-character base32, e.g. 'wjxayhdd').
period string optional Time window. Keywords: today, yesterday, last_7_days, last_30_days, last_90_days, last_12_months. Or a custom date range YYYY-MM-DD..YYYY-MM-DD (inclusive).
default: last_7_days
limit integer optional Maximum number of rows to return. Capped at 1000 server-side.
default: 10

How to call it directly

If you're integrating from your own code rather than a chat client, this is the JSON-RPC payload:

curl -X POST https://mcp-analytics.com/mcp \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "top_referrers",
    "arguments": {
      "site_id": "abc12345"
    }
  }
}'

Token comes from /settings after you sign up. Replace any required arguments above.

Related tools