Skip to main content

YouTube Analytics

warning

Analytics endpoints are not available on the Basic plan. Upgrade to Intermediate, Growth or Business plan to access these endpoints.

YouTube analytics endpoints provide insights for your connected YouTube accounts.

1. GET /api/youtube/overview

Returns account-level metrics with current vs. previous period comparison, including video performance rankings.

Sample Request

curl --location --request GET \
"https://analyze.oneupapp.io/api/youtube/overview?apiKey=YOUR_API_KEY&social_network_id=123&preset=last_30_days"

Response Structure

{
"success": true,
"data": {
"metrics": [
{
"key": "posts",
"name": "Posts",
"value_current_period": 6,
"value_last_period": 35,
"percentage_change": "-83%",
"description": "Number of posts in this period"
},
{
"key": "views",
"name": "Views",
"value_current_period": 6265,
"value_last_period": 4596,
"percentage_change": "+36%",
"description": "Number of times your video has been viewed"
},
{
"key": "estimatedMinutesWatched",
"name": "Estimated Minutes Watched",
"value_current_period": 4288,
"value_last_period": 2605,
"percentage_change": "+65%",
"description": "Total estimated minutes viewers spent watching your content"
},
{
"key": "subscribersGained",
"name": "Subscribers Gained",
"value_current_period": 46,
"value_last_period": 16,
"percentage_change": "+188%",
"description": "Number of new subscribers gained in this period"
}
],
"total_subscribers": 631,
"video_performance": {
"most_engaging": [
{
"id": "video_id",
"title": "Video Title",
"thumbnail_url": "https://i.ytimg.com/vi/...",
"permalink": "https://www.youtube.com/watch?v=...",
"engagement": 29,
"engagement_rate": "5.15%",
"engagement_rate_raw": 5.15,
"views": 563,
"watch_time_minutes": 704,
"likes": 12,
"comments": 4
}
],
"least_engaging": [],
"most_viewed": [],
"least_viewed": [],
"most_watched": [],
"least_watched": []
}
}
}

Data Structure

FieldDescription
metricsArray of metric objects with current/last period comparison
total_subscribersCurrent subscriber count
video_performanceRanked videos by engagement, views, and watch time

Available Metrics

KeyNameDescription
postsPostsNumber of posts in this period
viewsViewsNumber of times your video has been viewed
averageViewDurationAverage View DurationAverage amount of time a viewer watched your video (in seconds)
estimatedMinutesWatchedEstimated Minutes WatchedTotal estimated minutes viewers spent watching your content
subscribersGainedSubscribers GainedNumber of new subscribers gained
subscribersLostSubscribers LostNumber of subscribers lost
likesLikesNumber of likes your videos received
commentsCommentsNumber of comments left on your videos
sharesSharesNumber of times your videos were shared
dislikesDislikesNumber of dislikes your videos received

2. GET /api/youtube/post

Returns analytics for individual posts with current vs. previous period comparison.

Sample Request

curl --location --request GET \
"https://analyze.oneupapp.io/api/youtube/posts?apiKey=YOUR_API_KEY&social_network_id=123&preset=last_30_days"

Response Structure

{
"success": true,
"data": {
"stats": [
{
"key": "posts",
"name": "Posts",
"description": "Number of posts in this period",
"value_current_period": 6,
"value_last_period": 35,
"percentage_change": "-83%"
},
{
"key": "views",
"name": "Views",
"description": "Number of times your video has been viewed",
"value_current_period": 6336,
"value_last_period": 4229,
"percentage_change": "+50%"
},
{
"key": "estimatedMinutesWatched",
"name": "Estimated Minutes Watched",
"description": "Total estimated minutes viewers spent watching your content",
"value_current_period": 4322,
"value_last_period": 2500,
"percentage_change": "+73%"
},
{
"key": "likes",
"name": "Likes",
"description": "Number of likes your videos received",
"value_current_period": 47,
"value_last_period": 10,
"percentage_change": "+370%"
}
],
"posts": [
{
"id": "video_id",
"page_id": "channel_id",
"format": "video",
"title": "Video Title",
"description": "Video description...",
"thumbnail_url": "https://i.ytimg.com/vi/.../maxresdefault.jpg",
"permalink": "https://www.youtube.com/watch?v=...",
"views": 70,
"average_view_duration": 27,
"estimated_minutes_watched": 31,
"subscribers_gained": 0,
"subscribers_lost": 0,
"likes": 2,
"comments": 0,
"shares": 0,
"dislikes": 0,
"published_at": "2026-03-03 01:06:26"
}
]
}
}

Data Structure

FieldDescription
statsArray of stat objects with current/last period comparison
postsArray of post objects with detailed metrics

Available Stats

KeyNameDescription
postsPostsNumber of posts in this period
viewsViewsNumber of times your video has been viewed
averageViewDurationAverage View DurationAverage amount of time a viewer watched your video (in seconds)
estimatedMinutesWatchedEstimated Minutes WatchedTotal estimated minutes viewers spent watching your content
subscribersGainedSubscribers GainedNumber of new subscribers gained
subscribersLostSubscribers LostNumber of subscribers lost
likesLikesNumber of likes your videos received
commentsCommentsNumber of comments left on your videos
sharesSharesNumber of times your videos were shared
dislikesDislikesNumber of dislikes your videos received

3. GET /api/youtube/demographics

Returns audience demographic data.

Sample Request

curl --location --request GET \
"https://analyze.oneupapp.io/api/youtube/demographics?apiKey=YOUR_API_KEY&social_network_id=123&preset=last_30_days"

Sample Response

{
"success": true,
"data": [
{
"key": "age_group_demographics",
"name": "Viewers by Age",
"data": [
{
"name": "18-24",
"value": 12500,
"percentage": 27.8,
"share": 27.8
},
{
"name": "25-34",
"value": 18000,
"percentage": 40.0,
"share": 40.0
},
{
"name": "35-44",
"value": 9500,
"percentage": 21.1,
"share": 21.1
},
{
"name": "45-54",
"value": 3500,
"percentage": 7.8,
"share": 7.8
},
{
"name": "55+",
"value": 1500,
"percentage": 3.3,
"share": 3.3
}
]
},
{
"key": "gender_demographics",
"name": "Viewers by Gender",
"data": [
{
"name": "Male",
"value": 28000,
"percentage": 62.2,
"share": 62.2
},
{
"name": "Female",
"value": 17000,
"percentage": 37.8,
"share": 37.8
}
]
}
]
}

Demographics Data

FieldDescription
nameDemographic segment name
valueCount or absolute number
percentagePercentage value
shareShare percentage (same as percentage)

Result: You have successfully retrieved YouTube analytics data!