API Overview
Access your analytics data programmatically with Databuddy's REST API. All endpoints require authentication and are rate-limited for security.
Try it live! Test all these endpoints interactively in our API Playground with real data and see instant responses.
Base URLs
| Service | URL | Purpose |
|---|---|---|
| Analytics API | https://api.databuddy.cc/v1 | Query analytics data |
| Event Tracking | https://basket.databuddy.cc | Send custom events |
Quick Start
1. Get your API key from Dashboard → Organization Settings → API Keys
2. List your websites:
curl -H "x-api-key: dbdy_your_api_key" \
https://api.databuddy.cc/v1/query/websites3. Query analytics data:
curl -X POST -H "x-api-key: dbdy_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"parameters": ["summary", "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
API keys, scopes, and authentication methods
Query website analytics with flexible parameters
Send custom events programmatically
Query link shortener click data
Build advanced queries with aggregations
Error codes and troubleshooting
Rate limiting by plan and endpoint
Available Query Types
Website Analytics
Query types for website_id:
| Type | Description |
|---|---|
summary | Overall website metrics and KPIs |
pages | Page views and performance by URL |
traffic | Traffic sources and referrers |
browser_name | Browser usage breakdown |
os_name | Operating system breakdown |
device_types | Device category (mobile/desktop/tablet) |
countries | Visitors by country |
cities | Visitors by city |
errors | JavaScript errors |
performance | Web vitals and load times |
sessions | Session-based analytics |
custom_events | Custom event data |
profiles | User profile analytics |
outbound_links | External link clicks |
outbound_domains | External clicks by domain |
engagement | User engagement metrics |
Link Shortener Analytics
Query types for link_id:
| Type | Description |
|---|---|
link_total_clicks | Total click count |
link_clicks_by_day | Daily click breakdown |
link_top_referrers | Top traffic sources |
link_top_countries | Top countries |
link_top_devices | Device breakdown |
link_top_browsers | Browser breakdown |
Health Check
Check API and dependency status:
GET /health{
"clickhouse": true,
"database": true,
"redis": true,
"success": true,
"version": "1.0.0",
"timestamp": "2024-01-01T12:00:00.000Z"
}How is this guide?