Video Analytics Guide for Teyuto API
This guide explains how to retrieve analytics data for videos using the Teyuto API.
Authentication
All requests to the Teyuto API require authentication. Include your API token in the Authorization header:
Authorization: YOUR_API_TOKEN
Endpoints
1. Get Generic Video Analytics
Retrieve general analytics data for videos.
Endpoint: GET /analytics/videos
Parameters:
start_date
(required): Start date for the analytics period (format: YYYY-MM-DD HH:MM:SS)end_date
(required): End date for the analytics period (format: YYYY-MM-DD HH:MM:SS)tag_id
(optional): Get analytics for a specific tag
Example Request:
GET https://api.teyuto.tv/v2/analytics/videos?start_date=2023-10-12 12:45:00&end_date=2023-10-11 12:45:00&tag_id=4565
Accept: application/json
Authorization: YOUR_API_TOKEN
Example Response:
{
"status": "success",
"views": [
{
"total": "10000",
"realtime": "500"
}
],
"sessions": [
{
"total": "8000",
"average": "300"
}
],
"interactions": [
{
"total": "1500",
"comments": "1000",
"live_chat": "500"
}
]
}
2. Get Analytics for a Specific Video
Retrieve analytics data for a particular video.
Endpoint: GET /analytics/videos/{video_id}
Parameters:
video_id
(required): The ID of the video
Example Request:
GET https://api.teyuto.tv/v2/analytics/videos/12345
Accept: application/json
Authorization: YOUR_API_TOKEN
Example Response:
{
"status": "success",
"views": [
{
"total": "5000",
"realtime": "200"
}
],
"sessions": [
{
"total": "4000",
"average": "150"
}
],
"interactions": [
{
"total": "750",
"comments": "500",
"live_chat": "250"
}
]
}
Interpreting the Results
views
: Total views and real-time viewssessions
: Total sessions and average session durationinteractions
: Total interactions, including comments and live chat messages
These analytics provide insights into video performance, audience engagement, and content popularity.