How to get my top-performing content
Business goal: Identify popular videos to prioritize marketing efforts.
Here’s the API workflow below:
Step 1: List all the video views
Fetch all views for a campaign using this endpoint :
curl --request GET \
--url 'https://v1.fastpix.io/data/viewlist? timespan[]=30:days&orderBy=view_end&sortOrder=desc' \
--header 'accept: application/json'
--user '{Access_Token}:{Secret_Key}
Returns 314 views sorted by view_end
time.
{
"success": true,
"data": [
{
"viewId": "cc6f0f74-5b7e-4f8b-b70a-9edd57aedd5c",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T12:43:00.757",
"viewEndTime": "2025-03-26T12:43:19.861",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 20005,
"QoeScore": 0.9758551881413913
},
{
"viewId": "be8d99b0-4dad-4b5c-9444-552963f280c3",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T11:54:52.64",
"viewEndTime": "2025-03-26T11:55:03.068",
"videoTitle": "The Mandalorian / Season 1 / EP -1",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 1697,
"QoeScore": 0.5
},
{
"viewId": "e7804c53-0bc5-4311-8ea4-413ba629e0f5",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T11:51:24.505",
"viewEndTime": "2025-03-26T11:52:30.844",
"videoTitle": "test",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 71098,
"QoeScore": 0.8667725785091629
},
{
"viewId": "ea25327e-9f69-4b11-a135-17f5272fa018",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T09:30:33.904",
"viewEndTime": "2025-03-26T09:30:37.498",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 4381,
"QoeScore": 0.9159556462112665
},
{
"viewId": "4fca7cbb-9c97-4bde-8d49-60d03efa9d36",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T09:30:07.052",
"viewEndTime": "2025-03-26T09:30:21.167",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 14929,
"QoeScore": 0.971590449204322
},
{
"viewId": "c6dac770-9174-4064-884c-64402f749b2c",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T07:04:36.008",
"viewEndTime": "2025-03-26T07:05:15.598",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 40033,
"QoeScore": 0.9704809194376256
},
{
"viewId": "940e2294-e778-49b1-a41e-1f73d3798968",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T06:58:12.294",
"viewEndTime": "2025-03-26T06:59:23.526",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 50263,
"QoeScore": 0.9694716079564397
},
{
"viewId": "76f0fd16-775a-476e-9f06-4fb950b07082",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T06:27:17.536",
"viewEndTime": "2025-03-26T06:27:21.231",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 4644,
"QoeScore": 0.967611380679312
},
{
"viewId": "205c71e2-4f36-4874-a962-2e5ec6c73dbb",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T05:30:24.693",
"viewEndTime": "2025-03-26T05:30:32.854",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 9688,
"QoeScore": 0.956286795626577
},
{
"viewId": "5dd43a55-6eee-4300-8a72-b8e351fdfed0",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2025-03-26T05:26:21.239",
"viewEndTime": "2025-03-26T05:26:27.306",
"videoTitle": "Knives Out",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 1732,
"QoeScore": 0.9711676177688263
}
],
"pagination": {
"totalRecords": 314,
"currentOffset": 1,
"offsetCount": 32
},
"timespan": [
1740402124,
1742994124
]
}
Step 2: List by top viewed content
Aggregate views by video title using this endpoint :
curl --request GET \
--url 'https://v1.fastpix.io/data/viewlist/top-content?timespan[]=30:days&limit=10&offset=1&' \
--header 'accept: application/json'
The response below clearly shows the video title “Kinves Out” is the most viewed content compared to others with 276 views and 24 unique views.
{
"success": true,
"data": [
{
"videoTitle": "Knives Out",
"views": 276,
"uniqueViews": 24
},
{
"videoTitle": "The Mandalorian / Season 1 / EP -1",
"views": 10,
"uniqueViews": 8
},
{
"videoTitle": "Crimson City Chronicles / Season 2 / EP-1",
"views": 6,
"uniqueViews": 3
},
{
"videoTitle": "Silent Waters",
"views": 5,
"uniqueViews": 4
},
{
"videoTitle": "Crimson City Chronicles / Season 1 / EP-1",
"views": 5,
"uniqueViews": 2
},
{
"videoTitle": "Test series FastPix video / Season 1 / EP-1",
"views": 4,
"uniqueViews": 4
},
{
"videoTitle": "Test series api video / Season 2 / EP-1",
"views": 3,
"uniqueViews": 3
},
{
"videoTitle": "The Rise of Tech Giants - FastPix / Season 1 / EP 1",
"views": 2,
"uniqueViews": 1
},
{
"videoTitle": "test",
"views": 1,
"uniqueViews": 1
},
{
"videoTitle": "The Rise of Tech Giants -FastPix / Season 2 / EP -2",
"views": 1,
"uniqueViews": 1
}
],
"timespan": [
1740402286,
1742994286
]
}
Step 3: List breakdown values
Segment top content by device using this endpoint :
curl --request GET \
--url 'https://v1.fastpix.io/data/metrics/views/breakdown?timespan[]=30:days&filterby[]=video_title:Knives Out&groupBy=device_type ' \
--header 'accept: application/json'
The response gives you an observation that 97.8% of playbacks come from mobile devices.
Outcome: Optimize mobile playback and create short-form versions of top videos.
{
"success": true,
"metadata": {
"aggregation": "view_start"
},
"data": [
{
"views": 260,
"value": 260,
"totalWatchTime": 52012995,
"totalPlayingTime": 62043103,
"field": " Phone "
},
{
"views": 15,
"value": 15,
"totalWatchTime": 1301418,
"totalPlayingTime": 1318049,
"field": "Desktop"
},
{
"views": 1,
"value": 1,
"totalWatchTime": 31795,
"totalPlayingTime": 107,
"field": "TV"
}
],
"pagination": {
"totalRecords": 3,
"currentOffset": 1,
"offsetCount": 1
},
"timespan": [
1740402442,
1742994442
]
}