Aggregate Social Account Post Metrics
The aggregateSocialAccountPostMetrics query returns aggregated analytics data for posts, grouped by social account. This allows you to compare performance across multiple accounts or platforms.
Query
query aggregateSocialAccountPostMetrics(
$socialAccountIds: [ID]!
$startDate: DateTime!
$endDate: DateTime!
$metrics: [String]!
) {
aggregateSocialAccountPostMetrics(
socialAccountIds: $socialAccountIds
startDate: $startDate
endDate: $endDate
metrics: $metrics
) {
socialAccount {
id
username
formattedUsername
avatarUrl
platform
}
metrics {
metric
value
aggregation
}
}
}
{
"socialAccountIds": ["123", "456", "789"],
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-01-31T23:59:59Z",
"metrics": ["likes", "comments", "followers"]
}
{
"data": {
"aggregateSocialAccountPostMetrics": [
{
"socialAccount": {
"id": "123",
"username": "myinstagram",
"formattedUsername": "@myinstagram",
"avatarUrl": "https://example.com/avatar1.jpg",
"platform": "instagram"
},
"metrics": [
{
"metric": "likes",
"value": 12450,
"aggregation": "sum"
},
{
"metric": "likes",
"value": 276.7,
"aggregation": "avg"
},
{
"metric": "comments",
"value": 892,
"aggregation": "sum"
},
{
"metric": "comments",
"value": 19.8,
"aggregation": "avg"
},
{
"metric": "followers",
"value": 15300,
"aggregation": "sum"
}
]
},
{
"socialAccount": {
"id": "456",
"username": "mytiktok",
"formattedUsername": "@mytiktok",
"avatarUrl": "https://example.com/avatar2.jpg",
"platform": "tiktok"
},
"metrics": [
{
"metric": "likes",
"value": 45200,
"aggregation": "sum"
},
{
"metric": "likes",
"value": 1506.7,
"aggregation": "avg"
},
{
"metric": "comments",
"value": 3104,
"aggregation": "sum"
},
{
"metric": "comments",
"value": 103.5,
"aggregation": "avg"
},
{
"metric": "followers",
"value": 28500,
"aggregation": "sum"
}
]
},
{
"socialAccount": {
"id": "789",
"username": "mytwitter",
"formattedUsername": "@mytwitter",
"avatarUrl": "https://example.com/avatar3.jpg",
"platform": "twitter"
},
"metrics": [
{
"metric": "likes",
"value": 8920,
"aggregation": "sum"
},
{
"metric": "likes",
"value": 148.7,
"aggregation": "avg"
},
{
"metric": "comments",
"value": 412,
"aggregation": "sum"
},
{
"metric": "comments",
"value": 6.9,
"aggregation": "avg"
},
{
"metric": "followers",
"value": 8450,
"aggregation": "sum"
}
]
}
]
}
}
Parameters
"likes" instead of "upvotes").Response Structure
The response includes an array of results, one per social account, each containing:
- socialAccount: Details about the social account including username, platform, and avatar
- metrics: An array of metric values with both sum and avg aggregations
For each requested metric, you'll receive:
- sum: The total count across all posts in the time period
- avg: The average value per post
Special Metric: Followers
The followers metric is special and returns the most recent follower count for the account during the specified time period (not a sum or average of follower changes).
Platform-Agnostic Metrics
This query uses platform-agnostic metric names that map to platform-specific equivalents:
- likes: Maps to likes (most platforms), upvotes (Reddit), or notes (Tumblr)
- comments: Maps to comments (most platforms), replies (Twitter, Threads, Bluesky)
- followers: Returns the current follower count
- impressions: Available for platforms that track impressions
- views: Available for platforms that track views
- shares: Available for platforms that track shares
- reach: Available for platforms that track reach
postTimeSeriesMetrics and aggregatePostMetrics, this query supports querying multiple platforms at once. This makes it ideal for cross-platform comparison dashboards.Examples
Compare Instagram and TikTok Performance
{
"socialAccountIds": ["instagram-123", "tiktok-456"],
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-03-31T23:59:59Z",
"metrics": ["likes", "comments", "shares", "followers"]
}
Multi-Platform Dashboard
Get metrics for all connected accounts across all platforms:
{
"socialAccountIds": ["123", "456", "789", "101", "102"],
"startDate": "2025-10-01T00:00:00Z",
"endDate": "2025-10-31T23:59:59Z",
"metrics": ["likes", "comments", "followers"]
}
Client Reporting
Generate a report showing performance across all accounts managed for a specific client:
{
"socialAccountIds": ["client-ig-1", "client-tw-1", "client-tk-1"],
"startDate": "2025-06-01T00:00:00Z",
"endDate": "2025-06-30T23:59:59Z",
"metrics": ["likes", "comments", "impressions", "followers"]
}
Follower Growth Tracking
Track follower counts across all platforms:
{
"socialAccountIds": ["123", "456", "789", "101"],
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-12-31T23:59:59Z",
"metrics": ["followers"]
}
Use Cases
This query is ideal for:
- Cross-Platform Dashboards: Display unified metrics across all your social accounts
- Account Comparison: Compare performance between different accounts
- Client Reporting: Generate reports for agency clients with multiple accounts
- Platform Analysis: Identify which platforms perform best for your content
- Portfolio Overview: Get a bird's-eye view of all managed accounts