Postpone Logo
Analytics

Aggregate Social Account Post Metrics

Retrieve aggregated post metrics for multiple social accounts, broken down by account.

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
    }
  }
}

Parameters

socialAccountIds
[ID] required
An array of social account IDs to retrieve metrics for. Unlike other analytics queries, this query supports multiple platforms in a single request. 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.
metrics
[String] required
An array of metric names to retrieve. Use platform-agnostic metric names (e.g., "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
Unlike 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