Operations involving views
- list - List video views
- getDetails - Get details of video view
- listTopContent - List by top content
Retrieves a list of video views that fall within the specified filters and have been completed within a defined timespan. It lets you to analyse viewer interactions with your video content effectively.
-
Send a
GETrequest to this endpoint with the desired query parameters. -
Specify the timespan for which you want to retrieve the video views using the
timespan[]parameter. -
Filter the views based on dimensions such as browser, device, video title, viewer ID, etc., using the
filterby[]parameter. Get the dimensions by calling list the dimensions endpoint. -
Paginate the results using the
limitandoffsetparameters. -
You can also filter by
viewerId,errorCode,orderBya specific field, andsortOrderin ascending or descending order. -
You receive a response containing the list of video views matching the specified criteria.
Each view in the response includes a unique viewId. You can use this viewId with the Get Video View Details endpoint to retrieve more detailed information about that specific view.
If you manage a video streaming service and want to analyze content performance across devices and browsers. By calling the List Video Views endpoint with filters such as browser_name and device_type, you can identify which platforms are most popular with your audience. This information helps optimize content for widely used platforms and troubleshoot playback issues on less common devices.
Related guide: Audience metrics, Views dashboard
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.views.list({
timespan: "24:hours",
filterby: "browser_name:Chrome",
viewerId: "your-viewer-id",
errorCode: "1002",
});
console.log(JSON.stringify(result, null, 2));
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { viewsList } from "@fastpix/fastpix-node/funcs/viewsList.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await viewsList(fastpix, {
timespan: "24:hours",
filterby: "browser_name:Chrome",
viewerId: "your-viewer-id",
errorCode: "1002",
});
if (res.ok) {
const { value: result } = res;
console.log(JSON.stringify(result, null, 2));
} else {
console.log("viewsList failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ListVideoViewsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ListVideoViewsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |
Retrieves detailed information about a specific video view using its unique viewId. This provides insights into individual viewer interactions with your video content, helping you enhance user experience and improve engagement with your videos.
To use this endpoint, send GET request with the viewId. The response includes detailed metrics and attributes related to the specified video view.
If a developer receives a report of a poor viewing experience for a specific user. By using this endpoint with the users viewId, the developer can retrieve metrics like buffering duration, playback errors, and session length. This data allows the developer to pinpoint issues (such as poor connectivity or a browser-specific problem) and take steps to improve the user experience.
Related guide: What Video Data do we capture?
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.views.getDetails({
viewId: "your-view-id",
});
console.log(JSON.stringify(result, null, 2));
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { viewsGetDetails } from "@fastpix/fastpix-node/funcs/viewsGetDetails.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await viewsGetDetails(fastpix, {
viewId: "your-view-id",
});
if (res.ok) {
const { value: result } = res;
console.log(JSON.stringify(result, null, 2));
} else {
console.log("viewsGetDetails failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetVideoViewDetailsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetVideoViewDetailsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |
Retrieves a list of the top video views that fall within the specified filters and have been completed within a defined timespan. It lets you to identify the most popular content based on viewer interactions.
-
Send a
GETrequest to this endpoint with the desired query parameters. -
Specify the timespan for which you want to retrieve the top content using the
timespan[]parameter. -
Filter the views based on dimensions such as browser, device, video title, etc., using the
filterby[]parameter. -
You can use
Limitto control number of top views returned. -
You receive a response containing the list of top video views matching the specified criteria.
Related guide: Get top-performing content
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.views.listTopContent({
timespan: "24:hours",
filterby: "browser_name:Chrome",
});
console.log(JSON.stringify(result, null, 2));
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { viewsListTopContent } from "@fastpix/fastpix-node/funcs/viewsListTopContent.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await viewsListTopContent(fastpix, {
timespan: "24:hours",
filterby: "browser_name:Chrome",
});
if (res.ok) {
const { value: result } = res;
console.log(JSON.stringify(result, null, 2));
} else {
console.log("viewsListTopContent failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ListByTopContentRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ListByTopContentResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |