#
Analytics API Reference
Analytics data is read via the dashboard-worker which queries Supabase views directly.
#
Get Video Statistics
GET /dashboard/videos/:id/stats
Returns the statistics history for a single video.
Response
{
"success": true,
"data": {
"video_id": "...",
"stats": [
{
"created_at": "2026-03-01T00:00:00Z",
"views": 15000,
"likes": 320,
"comments": 45,
"reposts": 12
}
],
"daily_increments": [
{
"date": "2026-03-01",
"views_delta": 500,
"likes_delta": 10
}
]
}
}
#
Get Organization Stats
GET /dashboard/stats
Returns aggregated stats for all tracked videos in the organization.
Query params: from, to, campaign, platform
#
Get Videos With Increments for Date
GET /analytics/videos/for_date
Returns videos with their daily metric increments for a specific date, sorted by the requested metric. Used to populate the "top videos" detail view when clicking a date on a chart.
Distinct from videos_published/for_date — that endpoint returns total stats for videos published on a date; this returns increment stats for all tracked videos on that date.
Query params
Response
{
"success": true,
"data": [
{
"video_id": "uuid",
"external_video_id": "abc123",
"thumbnail_url": "https://...",
"video_url": "https://...",
"blogger_channel_username": "example",
"platform": "youtube",
"campaign_tag": "spring2026",
"views_increment": 12500,
"likes_increment": 340,
"comments_increment": 45,
"reposts_increment": 12,
"saves_increment": 89,
"published_at": "2026-02-01T00:00:00Z",
"created_at": "2026-01-15T00:00:00Z"
}
]
}
Data source: Supabase RPC get_top_videos_increments_on_date