Overview
The Analytics API provides comprehensive metrics for your projects and affiliate codes, including views, downloads, playtime statistics, and revenue data. All analytics data is aggregated into time slices for efficient querying.Fetch Analytics Data
Request Body
object
required
Defines the time period and resolution for analytics data.
object
required
Specify which metrics to return and how to group them.
Response Format
Returns an array of time slices, where each slice contains analytics data for that time period.array
Array of time slices (length determined by resolution).
Examples
Basic Views and Downloads
Downloads by Version
Views by Referrer
Playtime Statistics
Revenue Data
Example Response
Bucketing Behavior
Bucketing allows you to group analytics data by specific dimensions:No Bucketing
No Bucketing
When
bucket_by is empty, all data for that metric is aggregated:Single Bucket
Single Bucket
Bucketing by one field creates separate entries:
Multiple Buckets
Multiple Buckets
Multiple bucket fields create combinations:
Data Sources
Clickhouse
Views, downloads, playtime, and affiliate click data is stored in Clickhouse for high-performance querying
PostgreSQL
Revenue and conversion data comes from PostgreSQL transaction records
Privacy & Anonymization
Country data is automatically anonymized when counts are below 50 to protect user privacy. Low-traffic countries are reported as “XX”.
Best Practices
Resolution Selection
Resolution Selection
Choose resolution based on your time range:
- Hours: Use minute-based resolution
- Days/Weeks: Use 24-96 slices
- Months: Use 30-31 slices
- Years: Use 12 or 52 slices
Bucket Strategy
Bucket Strategy
Only bucket by fields you need:
- Fewer buckets = faster queries
- More buckets = more detailed data
- Consider client-side aggregation for flexibility
Time Range Limits
Time Range Limits
Keep queries reasonable:
- Maximum 1024 time slices
- Minimum 60-minute resolution
- Larger ranges need coarser resolution
Multiple Metrics
Multiple Metrics
Request multiple metrics in one call for efficiency:
Permissions
Analytics data is filtered by project permissions:- You can only view analytics for projects where you have
VIEW_ANALYTICSpermission - This includes:
- Projects you own
- Projects where you’re a team member with analytics access
- Projects in organizations where you have the appropriate role
