Build custom workflows
Access detailed Video Data API reference here .
You can use these APIs to pull data into your internal or custom dashboards, data lakes, or automate reports upto a 90-day window. When using our pre-built dashboards data is limited to only 30-days.
Further, if you’re pulling the data and storing into your own database, then it goes even beyond. It entirely depends on how you want to build and customize your product for your users.
We’re dogfooding on our APIs
Here’s a list of APIs that we used to build our own Video Data dashboards. This would likely give you an overall idea about how the APIs work and their use cases.
Category | API Name | Description |
---|---|---|
Views | List video views | To list all the video views. |
Get details of video view | Retrieve information about a specific video view. | |
Errors | List errors | List the total number of playback errors that occurred. |
Metrics | List overall values | To get the value of the metric requested. |
Get timeseries data | Get the timeseries values for the metric requested. | |
List breakdown values | Get the segmented data of metric per dimension. | |
List comparison values | Compare all the aggregated metrics per dimension value. | |
List video views | To list all the video views. | |
Overview | List overall values | To get the value of the metric requested. |
Get timeseries data | Get the timeseries values for the metric requested. | |
List by top Content | To get the list of top-performing videos. |
These are some (not all) of the major API endpoints that pulls the data on the specific dashboard it is listed for. For instance, if you’re building a Views dashboard you are likely to use a mix of few other APIs to fetch data as per your requirements.
PLEASE NOTE
To use any API endpoint – first you would need to generate an access token for authentication.
Follow the guide here.
API workflow examples
Video Data helps you to answer any business related question by making data-driven decisions. Our APIs are often interlinked and required to be used in certain patterns that gives the output to your queries.
Core workflow for Video Data APIs
These APIs work together to turn raw video views into actionable insights. Here’s how they connect:
Step 1: Fetch granular data
- List video views : Retrieve a list of individual video views (raw data).
Use case: Get all views in a timeframe to analyze session-level details. - Get video view details : Drill into a specific view’s metadata (e.g., quality scores, errors).
Use case: Debug why a specific viewer experienced buffering.
Step 2: Aggregate for trends
- List by top content : Identify top-performing videos.
Use case: Find which content drives the most engagement. - List overall values : Fetch aggregated metrics (e.g., total views, avg. watch time).
Use case: Measure your platform-wide performance.
Step 3: Segment & compare data
- List dimensions : Get all available segmentation options (e.g., country, device).
- List filter values for a dimension : Filter data or a metric by specific criteria (e.g., "device=mobile").
- List breakdown values : Get all data for a metric grouped by segments. (e.g., Watch time by country).
Step 4: Analyze trends over time
- Get timeseries data : Track metrics over time (e.g., daily views).
Use case: Identify peak engagement hours.
Step 5: Diagnose playback issues
- List errors : List common errors (e.g., buffering, playback failures).
- List comparison values : Compare error rates across segments (e.g., "Error A vs. Error B").
Example 1: Why are viewers dropping off?
Business question: Identify causes of viewer churn.
Here’s the API workflow below:
Step 1: Identify low-engagement segments
Use the list breakdown values endpoint with the playing_time
metric to find regions/devices with poor engagement:
curl --request GET \
--url 'https://v1.fastpix.io/data/metrics/playing_time/breakdown?timespan[]=7:days&limit=10&offset=1&groupBy=country&orderBy=views&sortOrder=asc' \
--header 'accept: application/json'
--user '{Access_Token}:{Secret_Key}
The response data shows India (IN) as a low-engagement region because of low total content playing time.
{
"success": true,
"metadata": {
"aggregation": "view_end"
},
"data": [
{
"views": 500,
"value": 57165,
"totalWatchTime": 83208,
"totalPlayingTime": 57165,
"field": "IN"
},
{
"views": 4980,
"value": 2624467,
"totalWatchTime": 913048,
"totalPlayingTime": 2624467,
"field": "US"
}
],
"pagination": {
"totalRecords": 2,
"currentOffset": 1,
"offsetCount": 1
},
"timespan": [
1712915263,
1713520063
]
}
Step 2: Fetch views from the low-engagement region
Use list video views endpoint with a country=IN
filter to retrieve all views from the region “India”:
curl --request GET \
--url 'https://v1.fastpix.io/data/viewlist? timespan[]=7:days& filterBy[]=country:IN &limit=10&offset=1&orderBy=view_end&sortOrder=asc' \
--header 'accept: application/json'
--user '{Access_Token}:{Secret_Key}
This API request returns views with viewWatchTime
included in each entry (even if not filterable).
{
"success": true,
"data": [
{
"viewId": "92752c49-1bce-4cf8-bea4-5c2c2ac7575d",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2024-04-15T04:43:44",
"viewEndTime": "2024-04-15T04:44:05",
"videoTitle": "Champion Engagement Model: Best practices for identifying and engaging your champion",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 10016,
"QoeScore": 0.9559243591134252
},
{
"viewId": "aa3f20e4-6065-4c7c-aed5-c7f8d127bcba",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2024-04-15T11:31:48",
"viewEndTime": "2024-04-15T11:32:30",
"videoTitle": "How to reduce time-to-value for your customers",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 31926,
"QoeScore": 0.9585203020685126
},
{
"viewId": "d7e6929a-9b7f-4f88-a8eb-033fb9e6dc6d",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2024-04-15T20:34:42",
"viewEndTime": "2024-04-15T20:35:00",
"videoTitle": "Implementing projects the ISRO way",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 17562,
"QoeScore": 0.9586481258440088
},
{
"viewId": "eca6400a-73e9-4250-8d0a-cb1cda15fed4",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2024-04-15T20:38:48",
"viewEndTime": "2024-04-15T20:39:23",
"videoTitle": "Designing your onboarding and adoption journey",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 34823,
"QoeScore": 0.9563013649035154
},
{
"viewId": "687b3a54-6646-4343-bfbe-459742042f54",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2024-04-16T09:20:34",
"viewEndTime": "2024-04-16T09:21:24",
"videoTitle": "How to Approach an Irate Customer With Mimecast’s Alice Jeffery",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 13493,
"QoeScore": 0.47256304495379314
},
{
"viewId": "c1464fdb-f3f8-4ccd-8914-94e1851e8459",
"operatingSystem": "MacOS",
"application": "Chrome",
"viewStartTime": "2024-04-16T09:22:42",
"viewEndTime": "2024-04-16T09:22:45",
"videoTitle": "How to Approach an Irate Customer With Mimecast’s Alice Jeffery",
"errorCode": null,
"errorMessage": null,
"errorId": null,
"country": "IN",
"viewWatchTime": 1,
"QoeScore": 0.5
}
],
"pagination": {
"totalRecords": 500,
"currentOffset": 1,
"offsetCount": 25
},
"timespan": [
1712915263,
1713520063
]
}
Step 3: Client-side filtering for short sessions
Manually filter the response to isolate sessions with low viewWatchTime
(e.g., <30 seconds).
Example client-side filtering:
low_engagement_views = [
view for view in response["data"]
if view["viewWatchTime"] < 30000
]
Step 4: Diagnose issues in short view sessions
You can use the get video view details endpoint to inspect individual sessions:
curl --request GET \
--url https://v1.fastpix.io/data/viewlist/92752c49-1bce-4cf8-bea4-5c2c2ac7575d \
--header 'accept: application/json'
--user '{Access_Token}:{Secret_Key}
{
"success": true,
"data": {
"asnId": 18209,
"asnName": "AS18209 Atria Convergence Technologies Ltd.,",
"averageBitrate": 2807994,
"avgDownscaling": 0.5465642809867859,
"avgRequestLatency": 6,
"avgRequestThroughput": 1280037000,
"avgUpscaling": 0,
"beaconDomain": "metrix.guru",
"browserEngine": null,
"browserName": "Chrome",
"browserVersion": "Chrome 133",
"bufferCount": 0,
"bufferFill": 0,
"bufferFrequency": 0,
"bufferRatio": 0,
"cdn": "Cloudflare",
"city": "Hyderābād",
"connectionType": null,
"continent": "AS",
"country": "India",
"countryCode": "IN",
"deviceManufacturer": "Apple",
"deviceModel": "Macintosh",
"deviceName": "Apple",
"deviceType": "Desktop",
"drmType": "Widevine",
"droppedFrameCount": 0,
"errorCode": "networkError",
"errorContext": "url: https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_536/147.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1286x536&duration=4.000",
"errorId": 1,
"errorMessage": "fragLoadError",
"exitBeforeVideoStart": false,
"experimentName": "FP Actionable data",
"fpApiVersion": null,
"fpEmbed": false,
"fpEmbedVersion": "1.0.0",
"fpLiveStreamId": null,
"fpPlaybackId": null,
"fpSdk": "Web Video Element Monitor",
"fpSdkVersion": "1.0.0",
"fpViewerId": "6cc8c07d-1f3e-438e-962e-b1842a941cd5",
"insertTimestamp": "2025-03-12T06:26:06.125Z",
"ipAddress": "183.82.105.187",
"jumpLatency": 6706,
"latitude": "17.3840",
"liveStreamLatency": null,
"longitude": "78.4564",
"maxDownscaling": 0.6625000238418579,
"maxRequestLatency": 0,
"maxUpscaling": 0,
"mediaId": null,
"osName": "MacOS",
"osVersion": "MacOS 10.15.7",
"pageContext": "standalone",
"pageLoadTime": 2136,
"playbackScore": 0,
"playerAutoplayOn": true,
"playerHeight": 270,
"playerInitializationTime": 2,
"playerInstanceId": "21a8c228-386d-458b-8c62-78addc47178a",
"playerLanguage": null,
"playerName": "FastPix Player",
"playerPoster": "https://fp-ott-cdn.ibee.ai/pbn/images/b8a66ca1-134b-4447-bd41-683a241549bc.jpeg",
"playerPreloadOn": true,
"playerRemotePlayed": false,
"playerResolution": "1512x270",
"playerSoftwareName": "HTML5 Video Element",
"playerSoftwareVersion": "1.5.20",
"playerSourceDomain": null,
"playerSourceHeight": 800,
"playerSourceWidth": 1920,
"playerVersion": "1.2.0",
"playerViewCount": 1,
"playerWidth": 1512,
"propertyId": null,
"qualityOfExperienceScore": 0,
"region": "Telangana",
"renderQualityScore": 1,
"sessionId": "3eccec94-ffaf-4226-8cc7-7aba1284e405",
"sign": "1",
"stabilityScore": 1,
"startupScore": 0.9247485839787308,
"subPropertyId": "standalone-11",
"totalStartupTime": 2789,
"updatedTimestamp": "2025-03-12T06:26:56.189Z",
"usedFullScreen": false,
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
"videoContentType": "movie",
"videoDuration": 734000,
"videoEncodingVariant": "h264",
"videoId": "6777bf804ec54babd4f4b842",
"videoLanguage": "english",
"videoProducer": "Andrew MG",
"videoResolution": "800X1920",
"videoSeries": "standalone",
"videoSourceDomain": "fastpix.io",
"videoSourceDuration": 734167,
"videoSourceHostname": "stream.fastpix.io",
"videoSourceStreamType": "on-demand",
"videoSourceType": "application/vnd.apple.mpegurl",
"videoSourceUrl": "https://stream.fastpix.io/e114e127-1c08-4788-9cbc-c7a68ed1f2c2.m3u8",
"videoStartupFailed": false,
"videoStartupTime": 651,
"videoTitle": "Knives Out",
"videoVariantId": "variant-standalone",
"videoVariantName": "streaming",
"viewEnd": "2025-03-12T06:26:54.153Z",
"viewHasAd": false,
"viewHasError": true,
"viewId": "b910582b-d0ef-49c6-9219-2d7f5c622ec2",
"viewMaxPlayheadPosition": 585000,
"viewPageUrl": "https://fastpix.dev/standalone/Knives-Out-6777bf804ec54babd4f4b842",
"viewPlayingTime": -4140,
"viewSeekedCount": 4,
"viewSeekedDuration": 26827,
"viewSessionId": "session-standalone",
"viewStart": "2025-03-12T06:26:06.125Z",
"viewTotalContentPlaybackTime": 585000,
"viewerId": null,
"watchTime": 23338,
"workspaceId": "d4312921-976b-4837-8e3f-400fb1734a15",
"events": [
{
"player_playhead_time": 0,
"event_name": "playerReady",
"viewer_time": 1741760766119,
"event_time": "1741760766126"
},
{
"player_playhead_time": 0,
"event_name": "viewBegin",
"viewer_time": 1741760766119,
"event_time": "1741760766126"
},
{
"player_playhead_time": 0,
"event_name": "play",
"viewer_time": 1741760766127,
"event_time": "1741760776128"
},
{
"player_playhead_time": 0,
"event_name": "waiting",
"viewer_time": 1741760766128,
"event_time": "1741760776128"
},
{
"player_playhead_time": 0,
"event_name": "loadstart",
"viewer_time": 1741760766132,
"event_time": "1741760776128"
},
{
"player_playhead_time": 0,
"event_name": "playing",
"viewer_time": 1741760766784,
"event_time": "1741760776128"
},
{
"player_playhead_time": 0,
"event_name": "variantChanged",
"event_details": {
"player_source_fps": 24,
"player_source_bitrate": 2076332,
"player_source_codec": "avc1.64001f",
"player_source_width": 1286,
"player_source_height": 536
},
"viewer_time": 1741760766787,
"event_time": "1741760776128"
},
{
"player_playhead_time": 12035,
"event_name": "variantChanged",
"event_details": {
"player_source_fps": 24,
"player_source_bitrate": 3044818,
"player_source_codec": "avc1.640028",
"player_source_width": 1920,
"player_source_height": 800
},
"viewer_time": 1741760778868,
"event_time": "1741760816192"
},
{
"player_playhead_time": 408000,
"event_name": "seeking",
"viewer_time": 1741760785074,
"event_time": "1741760816192"
},
{
"player_playhead_time": 408000,
"event_name": "waiting",
"viewer_time": 1741760785076,
"event_time": "1741760816192"
},
{
"player_playhead_time": 408000,
"event_name": "seeked",
"viewer_time": 1741760785122,
"event_time": "1741760816192"
},
{
"player_playhead_time": 408000,
"event_name": "playing",
"viewer_time": 1741760785123,
"event_time": "1741760816192"
},
{
"player_playhead_time": 408009,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/105.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760785141,
"event_time": "1741760816191"
},
{
"player_playhead_time": 408992,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/105.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760786171,
"event_time": "1741760816192"
},
{
"player_playhead_time": 585000,
"event_name": "seeking",
"viewer_time": 1741760787293,
"event_time": "1741760816192"
},
{
"player_playhead_time": 585000,
"event_name": "waiting",
"viewer_time": 1741760787294,
"event_time": "1741760816192"
},
{
"player_playhead_time": 585000,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/147.m4s?workspaceId=d78f5c9e-edb1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760787300,
"event_time": "1741760816191"
},
{
"player_playhead_time": 585000,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/147.m4s?workspaceId=d78f5f9e-edb1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760787303,
"event_time": "1741760816191"
},
{
"player_playhead_time": 585000,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/147.m4s?workspaceId=d78f5c8e-ede1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760787305,
"event_time": "1741760816192"
},
{
"player_playhead_time": 585000,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/147.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760787307,
"event_time": "1741760816192"
},
{
"player_playhead_time": 585000,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_800/147.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1920x800&duration=4.000"
},
"viewer_time": 1741760787308,
"event_time": "1741760816191"
},
{
"player_playhead_time": 585000,
"event_name": "requestFailed",
"event_details": {
"hostname": "cdn.fastpix.io",
"error": "fragLoadError",
"type": "manifest",
"url": "https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_536/147.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1286x536&duration=4.000"
},
"viewer_time": 1741760787369,
"event_time": "1741760816192"
},
{
"player_playhead_time": 585000,
"event_name": "error",
"event_details": {
"player_error_message": "fragLoadError",
"player_error_context": "url: https://cdn.fastpix.io/media/37fdfbd5-325f-426f-b1a4-90ad49626e2b/video_536/147.m4s?workspaceId=d78f5c8e-edb1-4a75-8a43-cb0863a66eaa&resolution=1286x536&duration=4.000\n",
"player_error_code": "networkError"
},
"viewer_time": 1741760787369,
"event_time": "1741760816191"
},
{
"player_playhead_time": 412000,
"event_name": "seeking",
"viewer_time": 1741760814036,
"event_time": "1741760816192"
},
{
"player_playhead_time": 412001,
"event_name": "seeked",
"viewer_time": 1741760814067,
"event_time": "1741760816192"
},
{
"player_playhead_time": 412002,
"event_name": "playing",
"viewer_time": 1741760814068,
"event_time": "1741760816192"
},
{
"player_playhead_time": 412000,
"event_name": "seeking",
"viewer_time": 1741760814147,
"event_time": "1741760816192"
},
{
"player_playhead_time": 412000,
"event_name": "waiting",
"viewer_time": 1741760814148,
"event_time": "1741760816192"
},
{
"player_playhead_time": 412000,
"event_name": "seeked",
"viewer_time": 1741760814152,
"event_time": "1741760816192"
},
{
"player_playhead_time": 412000,
"event_name": "playing",
"viewer_time": 1741760814153,
"event_time": "1741760816191"
},
{
"player_playhead_time": 413988,
"event_name": "viewCompleted",
"viewer_time": 1741760816189,
"event_time": 1741760816192
}
]
}
}
Step 5: Segment the error for deeper analysis
Based on the diagnosis of individual sessions, network errors are rampant. So the best idea would be to filter these views. To apply appropriate filter one can use listing the dimensions and it will list all the available dimensions .
curl --request GET \
--url https://v1.fastpix.io/data/dimensions \
--header 'accept: application/json'
{
"success": true,
"data": [
"browser_name,",
"browser_version",
"os_name",
"os_version",
"device_name",
"device_model",
"device_type",
"device_manufacturer",
"player_remote_played",
"player_name",
"player_version",
"player_software_name",
"player_software_version",
"player_resolution",
"fp_sdk",
"fp_sdk_version",
"player_autoplay_on",
"player_preload_on",
"video_title",
"video_id",
"video_series",
"fp_playback_id",
"fp_live_stream_id",
"media_id",
"video_source_stream_type",
"video_source_type",
"video_encoding_variant",
"experiment_name",
"sub_property_id",
"drm_type",
"asn_name",
"cdn",
"video_source_hostname",
"connection_type",
"view_session_id",
"continent",
"country",
"region",
"viewer_id",
"error_code",
"exit_before_video_start",
"view_has_ad",
"video_startup_failed",
"page_context",
"playback_failed",
"custom_1",
"custom_2",
"custom_3",
"custom_4",
"custom_5",
"custom_6",
"custom_7",
"custom_8",
"custom_9",
"custom_10"
]
}
From the response, you have all the dimensions to segment the data further. But, since you might want to further drill into the errors, you would need the error_code
dimension for the next steps.
PLEASE NOTE
If you are already aware of the dimensions, then you can ignore this step or restrain from repeating this step again.
Step 6: Comparing error percentages by ASN
Since we already know that the issue is network errors we will check which ASN is facing more issue by breaking the error percentages across the ASN values using the list breakdown values API.
Here you can use the playback_failure_percentage
metric Id and get the breakdown values for all the views with error_code
as network_error
. Further to know the error percentage across different ASN, use groupBy=asn
.
curl --request GET \
--url 'https://v1.fastpix.io/data/metrics/playback_failure_percentage/breakdown?filterby[]=error_code:network_error&limit=10&offset=1&groupBy=asn&orderBy=views&sortOrder=asc' \
--header 'accept: application/json'
{
"success": true,
"metadata": {
"aggregation": "view_end"
},
"data": [
{
"views": 6,
"value": 0.6,
"totalWatchTime": 255397,
"totalPlayingTime": 1190975,
"field": "AS18209 Atria Convergence Technologies Ltd.,"
},
{
"views": 4,
"value": 0.4,
"totalWatchTime": 296827,
"totalPlayingTime": 1290034,
"field": "US23207 LB Network Technologies,"
}
],
"pagination": {
"totalRecords": 2,
"currentOffset": 1,
"offsetCount": 1
},
"timespan": [
1740393396,
1742985396
]
}
This response shows two ASN names with the error percentages as 60% (0.6) and 40% (0.4) along with the total number of views effected by the error.
Outcome: If fragLoadError
rises from missing files, encoding issues, or server misconfigurations, fixing those problems should take priority over CDN optimization. However, if network-related issues like latency, congestion, or routing inefficiencies are contributing factors, then optimizing your CDN setup for ASN AS18209 Atria Convergence Technologies Ltd., can help mitigate these problems and improve playback reliability.
Example 2: What’s 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
]
}
Updated 3 days ago