Identify top-performing content

Use FastPix Video Data APIs to find your most-watched videos and break engagement down by device type.

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 the list video views endpoint:

Request
$curl --request GET \
> --url 'https://api.fastpix.io/v1/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.

Response
1{
2 "success": true,
3 "data": [
4 {
5 "viewId": "cc6f0f74-5b7e-4f8b-b70a-9edd57aedd5c",
6 "operatingSystem": "MacOS",
7 "application": "Chrome",
8 "viewStartTime": "2025-03-26T12:43:00.757",
9 "viewEndTime": "2025-03-26T12:43:19.861",
10 "videoTitle": "Knives Out",
11 "errorCode": null,
12 "errorMessage": null,
13 "errorId": null,
14 "country": "IN",
15 "viewWatchTime": 20005,
16 "QoeScore": 0.9758551881413913
17 },
18 {
19 "viewId": "be8d99b0-4dad-4b5c-9444-552963f280c3",
20 "operatingSystem": "MacOS",
21 "application": "Chrome",
22 "viewStartTime": "2025-03-26T11:54:52.64",
23 "viewEndTime": "2025-03-26T11:55:03.068",
24 "videoTitle": "The Mandalorian / Season 1 / EP -1",
25 "errorCode": null,
26 "errorMessage": null,
27 "errorId": null,
28 "country": "IN",
29 "viewWatchTime": 1697,
30 "QoeScore": 0.5
31 },
32 {
33 "viewId": "c6dac770-9174-4064-884c-64402f749b2c",
34 "operatingSystem": "MacOS",
35 "application": "Chrome",
36 "viewStartTime": "2025-03-26T07:04:36.008",
37 "viewEndTime": "2025-03-26T07:05:15.598",
38 "videoTitle": "Knives Out",
39 "errorCode": null,
40 "errorMessage": null,
41 "errorId": null,
42 "country": "IN",
43 "viewWatchTime": 40033,
44 "QoeScore": 0.9704809194376256
45 }
46 ],
47 "pagination": {
48 "totalRecords": 314,
49 "currentOffset": 1,
50 "offsetCount": 32
51 },
52 "timespan": [
53 1740402124,
54 1742994124
55 ]
56}

Step 2: List by top viewed content

Aggregate views by video title using the list by top content endpoint:

Request
$curl --request GET \
> --url 'https://api.fastpix.io/v1/data/viewlist/top-content?timespan[]=30:days&limit=10&offset=1' \
> --header 'accept: application/json'

The response below clearly shows the video title “Knives Out” is the most viewed content compared to others with 276 views and 24 unique views.


Response
1{
2 "success": true,
3 "data": [
4 { "videoTitle": "Knives Out", "views": 276, "uniqueViews": 24 },
5 { "videoTitle": "The Mandalorian / Season 1 / EP -1", "views": 10, "uniqueViews": 8 },
6 { "videoTitle": "Crimson City Chronicles / Season 2 / EP-1", "views": 6, "uniqueViews": 3 },
7 { "videoTitle": "Silent Waters", "views": 5, "uniqueViews": 4 },
8 { "videoTitle": "Crimson City Chronicles / Season 1 / EP-1", "views": 5, "uniqueViews": 2 },
9 { "videoTitle": "Test series FastPix video / Season 1 / EP-1", "views": 4, "uniqueViews": 4 },
10 { "videoTitle": "Test series api video / Season 2 / EP-1", "views": 3, "uniqueViews": 3 },
11 { "videoTitle": "The Rise of Tech Giants - FastPix / Season 1 / EP 1", "views": 2, "uniqueViews": 1 },
12 { "videoTitle": "test", "views": 1, "uniqueViews": 1 },
13 { "videoTitle": "The Rise of Tech Giants -FastPix / Season 2 / EP -2", "views": 1, "uniqueViews": 1 }
14 ],
15 "timespan": [
16 1740402286,
17 1742994286
18 ]
19}

Step 3: List breakdown values

Segment top content by device using the list breakdown values endpoint:

$curl --request GET \
> --url 'https://api.fastpix.io/v1/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.

Response
1{
2 "success": true,
3 "metadata": {
4 "aggregation": "view_start"
5 },
6 "data": [
7 {
8 "views": 260,
9 "value": 260,
10 "totalWatchTime": 52012995,
11 "totalPlayingTime": 62043103,
12 "field": "Phone"
13 },
14 {
15 "views": 15,
16 "value": 15,
17 "totalWatchTime": 1301418,
18 "totalPlayingTime": 1318049,
19 "field": "Desktop"
20 },
21 {
22 "views": 1,
23 "value": 1,
24 "totalWatchTime": 31795,
25 "totalPlayingTime": 107,
26 "field": "TV"
27 }
28 ],
29 "pagination": {
30 "totalRecords": 3,
31 "currentOffset": 1,
32 "offsetCount": 1
33 },
34 "timespan": [
35 1740402442,
36 1742994442
37 ]
38}

See also