Frontend expects these endpoints to return JSON matching the TypeScript interfaces in lib/api/creator.ts. Dummy data is currently returned; uncomment real API calls when backend is ready.
Returns AnalyticsInsights:
{
content_performance_trends: {
trend: 'up' | 'down' | 'stable',
change_percentage: number, // e.g. 12.5 (percentage)
period: string // e.g. "last month", "last week"
},
audience_growth_prediction: {
predicted_followers: number, // e.g. 125000
growth_rate: number, // e.g. 8.3 (percentage)
timeframe: string // e.g. "next 30 days"
},
best_posting_times: Array<{
platform: string, // 'instagram', 'tiktok', 'youtube'
day: string, // day name, e.g. 'Tuesday'
hour: number, // 0-23
engagement_score: number // 0-10 scale
}>,
engagement_patterns: Array<{
platform: string,
pattern: string, // short title, e.g. "Peak engagement on weekends"
description: string // explanation, e.g. "Your audience is most active..."
}>
}Usage: Shows content performance trends, growth predictions, best posting times, and engagement patterns.
Returns PlatformAnalytics. Platform param: ig | ttk | yt (or instagram | tiktok | youtube).
{
platform: string, // 'instagram', 'tiktok', or 'youtube'
followers: number, // For IG/TikTok (0 for YouTube)
subscribers: number, // For YouTube (0 for IG/TikTok)
average_engagement: number, // Average likes/comments/etc
average_views: number, // Average views per post/video
engagement_rate: number, // Percentage (e.g. 7.6)
growth_rate: number, // Percentage growth (e.g. 5.2)
snapshot_date: string // ISO date string
}Usage: Platform-specific stats cards showing followers/subscribers, engagement rate, average views, and growth rate.
Note: Frontend conditionally calls this based on user's linked platforms (hasInstagram, hasTiktok, hasYoutube).
Returns FollowerGrowthData:
{
data_points: Array<{
month: string, // e.g. "Jan", "Feb", "Mar"
instagram: number, // Follower count for Instagram
tiktok: number, // Follower count for TikTok
youtube: number // Subscriber count for YouTube
}>
}Usage: Line chart showing follower/subscriber growth over time (typically last 6 months). Each data point represents one month with counts for all three platforms.