API reference

API overview

Get your website's numbers as JSON with one request and an API key.

curl -X POST "https://api.databuddy.cc/v1/query?website_id=$DATABUDDY_WEBSITE_ID" \
  -H "x-api-key: $DATABUDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parameters":["summary_metrics","top_pages"],"preset":"last_30d"}'
{
  "success": true,
  "requestId": "req_0000000000000001",
  "queryId": "",
  "data": [
    {
      "parameter": "summary_metrics",
      "success": true,
      "data": [{ "pageviews": 240, "unique_visitors": 80, "sessions": 100, "bounce_rate": 25 }]
    },
    {
      "parameter": "top_pages",
      "success": true,
      "data": [{ "name": "/pricing", "pageviews": 90, "visitors": 41 }]
    }
  ],
  "meta": { "parameters": ["summary_metrics", "top_pages"], "total_parameters": 2, "page": 1, "limit": 100, "filters_applied": 0 }
}

Find your website ID with GET /v1/query/websites, or copy it from the dashboard URL.

Pick what you need

ToUsePage
Read traffic, pages, sources, errorsPOST /v1/queryQuery analytics
Ask a question no query type answersPOST /sql/querySQL
Build a scheduled reportPOST /v1/queryReporting script
Send events from your serverPOST https://basket.databuddy.cc/trackSend events
Find and play session recordingsPOST /replays/list, POST /replays/eventsReplays
Count clicks on short linksPOST /v1/query?link_id=Links
Upload, list and delete source mapsPUT, DELETE /source-maps/{websiteId}/{fileName}, GET /source-maps/{websiteId}Source maps
Turn a stack trace into original sourcePOST /source-maps/symbolicateSource maps
Find user actions with no eventnpx @databuddy/scanEvent scanner
Ask from Claude, Cursor or ChatGPThttps://api.databuddy.cc/v1/mcpMCP server

Find the right URL

ServiceURL
Analytics APIhttps://api.databuddy.cc/v1
Replays, SQL, source maps, links and flagshttps://api.databuddy.cc
Scan API, used by @databuddy/scanhttps://api.databuddy.cc/v1/scan
Event ingestionhttps://basket.databuddy.cc
Interactive API referencehttps://api.databuddy.cc/
OpenAPI spechttps://www.databuddy.cc/openapi.json
MCP serverhttps://api.databuddy.cc/v1/mcp
MCP discovery manifesthttps://www.databuddy.cc/.well-known/mcp.json
Health checkGET https://api.databuddy.cc/health returns {"status":"ok"}

Every endpoint except the health check, GET /v1/query/types, public flag evaluation and the scan API needs a key. Send it as x-api-key or Authorization: Bearer. Uploading, listing and deleting source maps needs write:source_maps; symbolicating needs read:data. The scan API allows 600 requests a minute and 5,000 a day per network.

How is this guide?