Overview
The Databuddy Analytics API provides privacy-first access to your website analytics data. Query pageviews, custom events, user sessions, and conversion funnels using a flexible REST API.Base URL
Authentication
All analytics API requests require authentication using either:- API Key: Include in the
Authorizationheader asBearer <api_key> - Session Cookie: Authenticated user session
read:data scope to access analytics endpoints.
Query Endpoint
The main analytics endpoint accepts flexible query requests:Query Parameters
The website ID to query analytics for. Required for website-specific queries.
The uptime schedule ID for uptime monitor queries.
The link ID for link shortener analytics.
The organization ID for organization-level queries (e.g., LLM analytics).
Timezone for date calculations (e.g.,
America/New_York).Request Body
Array of query types to execute. Can be strings (e.g.,
"top_pages") or objects with additional configuration:Start date in
YYYY-MM-DD format or ISO datetime (e.g., 2024-01-01 or 2024-01-01T00:00:00Z).End date in
YYYY-MM-DD format or ISO datetime.Date preset to use instead of explicit dates. Options:
today, yesterday, last_7d, last_14d, last_30d, last_90d, this_week, last_week, this_month, last_month, this_year.Time granularity for time-series queries:
hourly, daily, hour, or day. Hourly queries support up to 30 days.Array of filters to apply to queries:Available operators:
eq, ne, contains, not_contains, starts_with, in, not_in.Maximum number of results per query (1-10000).
Page number for pagination (1-based).
Response
Indicates if the request was successful.
Unique request ID for tracking and debugging.
Query ID from the request (if provided).
Array of query results, one per parameter:
Query metadata including parameters, pagination, and filter counts.
Available Query Types
Retrieve available query types and their configurations:Array of available query type names.
Configuration for each query type including allowed filters, limits, and customization options.
Available date presets.
List Accessible Websites
Get websites accessible with your credentials:Array of websites you have access to query.
Total number of accessible websites.
Batch Queries
Execute multiple queries in a single request by passing an array of query objects:Error Handling
Error responses include detailed information:AUTH_REQUIRED(401): Authentication requiredACCESS_DENIED(403): No access to the resourceVALIDATION_ERROR(400): Invalid request parametersMISSING_PROJECT_ID(400): Missing website_id or other project identifier
Example Request
Next Steps
Pageview Analytics
Query pageview data and top pages
Custom Events
Track and query custom events
Session Analytics
Analyze user sessions and behavior
Funnel Analytics
Track conversion funnels