Analytics
Aggregate Post Metrics
Retrieve aggregated analytics metrics for your social media posts across a time period.
The aggregatePostMetrics query returns aggregated analytics data for posts, providing both sum totals and average values for each metric across the specified time period.
Query
query aggregatePostMetrics(
$socialAccountIds: [ID]
$startDate: DateTime!
$endDate: DateTime!
$subreddits: [String]
$metrics: [String]
) {
aggregatePostMetrics(
socialAccountIds: $socialAccountIds
startDate: $startDate
endDate: $endDate
subreddits: $subreddits
metrics: $metrics
) {
metrics {
metric
value
aggregation
}
}
}
{
"socialAccountIds": ["123"],
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-01-31T23:59:59Z",
"metrics": ["likes", "comments", "impressions"]
}
{
"data": {
"aggregatePostMetrics": {
"metrics": [
{
"metric": "posts",
"value": 45,
"aggregation": "sum"
},
{
"metric": "posts",
"value": 1.5,
"aggregation": "avg"
},
{
"metric": "likes",
"value": 8420,
"aggregation": "sum"
},
{
"metric": "likes",
"value": 187.1,
"aggregation": "avg"
},
{
"metric": "comments",
"value": 612,
"aggregation": "sum"
},
{
"metric": "comments",
"value": 13.6,
"aggregation": "avg"
},
{
"metric": "impressions",
"value": 125300,
"aggregation": "sum"
},
{
"metric": "impressions",
"value": 2784.4,
"aggregation": "avg"
}
]
}
}
}
Parameters
socialAccountIds
[ID]
An array of social account IDs to retrieve metrics for. All accounts must be from the same platform. See how to retrieve your social accounts.
startDate
DateTime required
The start date for the analytics period. Must be in ISO 8601 format.
endDate
DateTime required
The end date for the analytics period. Must be in ISO 8601 format.
subreddits
[String]
Filter metrics by specific subreddits (Reddit only). Pass subreddit names without the "r/" prefix.
metrics
[String]
An array of metric names to retrieve. The
posts metric is always included automatically. See Available Metrics for platform-specific options.Response Structure
The response includes both sum and avg aggregations for each metric:
- sum: The total count across all posts in the time period
- avg: The average value per post
The posts metric is always included automatically and represents the total number of posts published during the period.
Available Metrics
The available metrics are platform-specific. See the Platform Metrics documentation for a complete list of metrics available for each platform.
All social accounts in a single query must be from the same platform. To retrieve metrics for multiple platforms, make separate queries.
Examples
Instagram Account Summary
Get aggregated metrics for an Instagram account to display in a dashboard:
{
"socialAccountIds": ["789"],
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-03-31T23:59:59Z",
"metrics": ["likes", "comments", "impressions", "reach", "shares"]
}
TikTok Monthly Report
Generate a monthly report for multiple TikTok accounts:
{
"socialAccountIds": ["101", "102", "103"],
"startDate": "2025-10-01T00:00:00Z",
"endDate": "2025-10-31T23:59:59Z",
"metrics": ["likes", "comments", "shares", "impressions"]
}
Twitter Engagement Analysis
Calculate average engagement metrics for a Twitter account:
{
"socialAccountIds": ["555"],
"startDate": "2025-06-01T00:00:00Z",
"endDate": "2025-06-30T23:59:59Z",
"metrics": ["likes", "replies", "retweets", "impressions", "quotes"]
}
Use Cases
This query is ideal for:
- Dashboard Widgets: Display high-level KPIs and summary statistics
- Performance Reports: Generate monthly or quarterly performance reports
- Comparison Analysis: Compare performance across different time periods
- Goal Tracking: Monitor progress toward engagement targets
- ROI Calculations: Calculate average returns per post for campaign analysis