trackagoat logotrackagoat/Docs

Getting started

  • Welcome
  • Quickstart
  • Core concepts

Guides

  • Creators
  • Videos
  • Campaigns
  • Creator Goals
  • Tracking Inbox
  • Content calendar
  • How scraping works
  • Analytics & metrics
  • Similar creator pools
  • Over-posting & suppression
  • Program Health
  • Sentiment Radar
  • API keys
  • Limits & plan tiers
  • Notifications
  • Payouts

API reference

  • Overview
  • Authentication
  • Errors
  • Projects
  • Creators
  • Videos
  • Campaigns
  • Analytics
  • Aggregate Analytics
  • Payouts
  • Schema

For agents

  • Agent guide
  • Data model
  • MCP & tooling

Platform

  • Brand
  • Changelog
  • Support
DocsAPI reference

Aggregate Analytics

Project-level aggregate endpoints for leaderboards, heatmaps, histograms, scatter charts, and membership overlap.

PreviousAnalyticsNextPayouts

On this page

  • Overview
  • Video endpoints
  • GET /aggregate/video-leaderboard
  • GET /aggregate/posting-heatmap
  • GET /aggregate/view-distribution
  • GET /aggregate/outliers
  • Creator endpoints
  • GET /aggregate/creator-leaderboard
  • GET /aggregate/posting-consistency
  • GET /aggregate/creator-scatter
  • GET /aggregate/goal-compliance
  • Campaign endpoints
  • GET /aggregate/campaign-leaderboard
  • GET /aggregate/member-overlap

Overview

The aggregate analytics endpoints return pre-computed project-level summaries that power the Analytics section (Video, Creator, and Campaign sub-tabs). They differ from the unified /api/v1/analytics endpoint in that they aggregate across all entities in a project rather than for a single entity.

All endpoints:

  • Accept both Bearer API key and session cookie authentication
  • Return the standard { data, error, meta } envelope
  • Require the caller to have access to the specified project_id
  • Are not cached (no Vercel Runtime Cache wrapper) — responses are fresh on every request

Base path: /api/v1/analytics/aggregate


Video endpoints

GET /aggregate/video-leaderboard

Returns a ranked list of tracked videos in the project for the given date range.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequiredProject to query
fromYYYY-MM-DD—Period start (inclusive)
toYYYY-MM-DD—Period end (inclusive)
orderenumview_countSort column: view_count, like_count, comment_count, share_count, save_count, posted_at
limitint

Response data array — each item:

json
{
  "video_id": "uuid",
  "title": "string | null",
  "thumbnail_url": "string | null",
  "url": "string | null",
  "view_count": 12345,
  "like_count": 678,
  "comment_count": 45,
  "share_count": 12,
  "save_count": 89,
  "posted_at": "2026-04-01T12:00:00Z"





total_count is the total matching rows (before limit/offset).


GET /aggregate/posting-heatmap

Returns a DOW × hour grid of post counts and average view counts, bucketed in the org's timezone.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequired
fromYYYY-MM-DDrequired
toYYYY-MM-DDrequired
tzIANA stringorg timezoneOverride timezone

Response data array — each item:

json
{ "dow": 1, "hour": 14, "post_count": 5, "avg_views": 12430.50 }

dow: 0=Sunday … 6=Saturday. Only cells with at least one post are returned; missing cells = 0.


GET /aggregate/view-distribution

Returns a histogram of video view counts with percentile markers.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequired
fromYYYY-MM-DDrequired
toYYYY-MM-DDrequired
bin_countint20Number of histogram bins (5–50)

Response data object:

json
{
  "total": 87,
  "min": 100,
  "max": 5200000,
  "p50": 12000,
  "p75": 48000,
  "p90": 210000,
  "p99": 1800000,
  "bins": [
    { "bin_index": 0, "bin_lower": 100, "bin_upper"



GET /aggregate/outliers

Returns videos that outperform their creator's median view count by at least min_x_multiple, sorted by x_multiple descending.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequired
fromYYYY-MM-DD—Optional period filter
toYYYY-MM-DD—Optional period filter
min_x_multiplenumber1.5Minimum outperformance ratio
limitint

Response data array — each item includes video_id, creator_id, view_count, median_views, x_multiple, posted_at, plus enriched title, thumbnail_url, url, tiktok_handle, display_name, avatar_url.


Creator endpoints

GET /aggregate/creator-leaderboard

Returns creators in the project ranked by views in the period, with follower delta and engagement metrics.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequired
fromYYYY-MM-DD—
toYYYY-MM-DD—
limitint100Max rows (1–200)
offsetint0

Response data array — each item:

json
{
  "creator_id": "uuid",
  "tiktok_handle": "string",
  "display_name": "string | null",
  "avatar_url": "string | null",
  "current_followers": 45000,
  "follower_delta": 1200,
  "total_views": 980000,
  "posts_in_period": 14,
  "posts_per_week": 1.0,
  "engagement_rate": 


follower_delta = follower count at end of period minus start of period (from creator_stats_history). Zero when no snapshots in range.

engagement_rate = (likes + comments + shares) ÷ views × 100 for videos posted in the period.


GET /aggregate/posting-consistency

Returns per-creator, per-day post counts for building a punch-card matrix.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequired
fromYYYY-MM-DDrequired
toYYYY-MM-DDrequired
tzIANA stringorg timezone

Response data array — sparse (only days with posts):

json
{ "creator_id": "uuid", "day": "2026-04-05", "post_count": 2 }

GET /aggregate/creator-scatter

Returns per-creator (follower change, engagement rate) pairs for scatter chart rendering.

Query parameters: project_id, optional from/to.

Response data array:

json
{
  "creator_id": "uuid",
  "tiktok_handle": "string",
  "follower_delta": 1200,
  "engagement_rate": 3.45,
  "posts_count": 14
}

Only creators with at least one tracked post in the period are included.


GET /aggregate/goal-compliance

Returns a project-wide roll-up of creator goal statuses. Capped at 50 creators with active goals.

Query parameters: project_id.

Response data object:

json
{
  "on_track": 3,
  "at_risk": 1,
  "missed": 1,
  "total_goals": 5,
  "creators_with_goals": 5
}

on_track includes completed statuses. at_risk includes behind_pace. The cap of 50 matches the existing dashboard behavior.


Campaign endpoints

GET /aggregate/campaign-leaderboard

Returns campaigns in the project sorted by views, with prior-period delta comparison.

Query parameters: project_id, from, to (all required).

Response data array:

json
{
  "campaign_id": "uuid",
  "name": "string",
  "total_views": 1200000,
  "total_likes": 45000,
  "video_count": 32,
  "creator_count": 5,
  "preview_thumbnail_url": "string | null",
  "prior_views": 980000,
  "views_delta": 220000,
  "views_delta_pct": 

Prior period is automatically computed as the same duration immediately preceding from.


GET /aggregate/member-overlap

Returns entities (creators or videos) that appear as direct members in campaigns, with the list of campaigns each belongs to. Capped at 50 rows.

Query parameters

ParameterTypeDefaultDescription
project_idUUIDrequired
dimensioncreator | videocreatorEntity type to list

Response data array:

json
{
  "entity_id": "uuid",
  "entity_label": "tiktok_handle or title",
  "entity_avatar": "string | null",
  "campaign_ids": ["uuid", "uuid"],
  "campaign_names": ["Campaign A", "Campaign B"],
  "campaign_count": 2
}

Only direct membership (via campaign_items) is considered, not recursive resolution through nested campaigns.

100
Max rows (1–200)
offsetint0Pagination offset
,
"creator_id": "uuid",
"tiktok_handle": "string",
"display_name": "string | null",
"avatar_url": "string | null",
"total_count": 87
}
:
260250
,
"video_count"
:
61
},
...
]
}
50
Max rows (1–100)
3.45
,
"growth_rate": 2.74,
"total_count": 7
}
22
}