API Reference

API Overview

Access your analytics data programmatically with Databuddy's REST API. Most endpoints require authentication and are rate-limited for security. Public exceptions: /health, GET /v1/query/types, the public feature-flag routes under /public/v1/flags/*, and the /.well-known/* discovery routes.

Try it live! Test all these endpoints interactively in our API Playground with real data and see instant responses.

Base URLs

ServiceURLPurpose
Analytics APIhttps://api.databuddy.cc/v1Query analytics data
Event Trackinghttps://basket.databuddy.ccSend custom events
OpenAPI spechttps://www.databuddy.cc/openapi.jsonMachine-readable Databuddy REST API schema
API referencehttps://api.databuddy.cc/Interactive Databuddy API reference
MCP serverhttps://api.databuddy.cc/v1/mcp/Streamable HTTP MCP endpoint for AI agents
MCP manifesthttps://www.databuddy.cc/.well-known/mcp.jsonMachine-readable MCP discovery manifest

Quick Start

1. Get your API key from Dashboard → Organization Settings → API Keys

2. List your websites:

bash
curl -H "x-api-key: dbdy_your_api_key" \
https://api.databuddy.cc/v1/query/websites

3. Query analytics data:

bash
curl -X POST -H "x-api-key: dbdy_your_api_key" \
-H "Content-Type: application/json" \
-d '{
  "parameters": ["summary_metrics", "top_pages"],
  "preset": "last_30d"
}' \
"https://api.databuddy.cc/v1/query?website_id=web_123"

Use date presets like last_7d, last_30d, this_month instead of explicit dates for convenience.

API Sections

Available Query Types

Website Analytics

Query types for website_id:

TypeDescription
summary_metricsOverall website metrics and KPIs
top_pagesPage views and visitors by path
traffic_sourcesTraffic source breakdown
top_referrersTop referrers
browser_nameBrowser usage breakdown
os_nameOperating system breakdown
device_typesDevice category (mobile/desktop/tablet)
countryVisitors by country
cityVisitors by city
recent_errorsLatest JavaScript errors
error_summaryError counts and impact
vitals_overviewCore Web Vitals overview
page_performanceLoad performance by page
session_metricsSession metrics over time
session_listIndividual sessions
custom_eventsCustom event data
profile_listUser profile analytics
outbound_linksExternal link clicks
outbound_domainsExternal clicks by domain
scroll_depth_summaryScroll depth engagement
interaction_summaryInteraction engagement

This is a subset. Use GET /v1/query/types for the full list.

Query types for link_id:

TypeDescription
link_total_clicksTotal click count
link_clicks_by_dayDaily click breakdown
link_referrers_by_dayDaily clicks by referrer
link_countries_by_dayDaily clicks by country
link_top_referrersTop traffic sources
link_top_countriesTop countries
link_top_regionsTop regions
link_top_citiesTop cities
link_top_devicesDevice breakdown
link_top_browsersBrowser breakdown

Health Check

Check API availability:

http
GET /health
json
{
"status": "ok"
}

How is this guide?