Documentation Index
Fetch the complete documentation index at: https://docs.dema.ai/llms.txt
Use this file to discover all available pages before exploring further.
Fetching Organization Information
To retrieve your organization information and available frontends:sites array contains your frontend information (frontendIds), which you’ll need when querying statistics data.
Fetching Definitions
To retrieve the available metrics, dimensions, and attributionModels for your organization:Fetching Statistics Data
The insights query allows you to retrieve aggregated statistics based on selected dimensions and metrics:insightsParams object accepts the following parameters:
frontendIds(array of strings): List of frontend IDs to query data forstartDate(ISO 8601 string): Start date for the data rangeendDate(ISO 8601 string): End date for the data rangedimensions(array of strings): Dimensions to group data by (e.g.,channelGroup,channel,product)metrics(array of strings): Metrics to retrieve (e.g.,session:count,session:duration,product:inventoryValue)filter(object): Optional filters to apply to the datacompareStartDate(ISO 8601 string, optional): Start date for comparison periodcompareEndDate(ISO 8601 string, optional): End date for comparison periodaggregateDimensions(array of strings, optional): Additional dimensions for aggregation (e.g.,day,week,month)
Pagination
The insights endpoint supports pagination through thepageInfo object in the response:
pageSize: Number of records per pageoffset: Current offset for paginationhasNextPage: Boolean indicating if more data is available
Complete cURL Example
Here’s a complete example of how to make a request using cURL:Integration Tips
- Error Handling: Implement proper error handling for authentication failures, rate limits, and query errors
- Caching: Consider caching frequently accessed data to reduce API calls and improve performance
- Date Formats: Always use ISO 8601 format for dates (e.g.,
2025-11-02T23:00:00.000Z) - Frontend IDs: Use the
OrganizationInfoQueryto programmatically retrieve your frontend information (frontendIds)

