Skip to main content

Collection Analytics

This guide explains how to retrieve analytics data for collections 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 Collection Analytics

Retrieve general analytics data for collections.

Endpoint: GET /analytics/collections

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)
  • user_id (optional): Get analytics for a specific user
  • tag_id (optional): Get analytics for a specific tag

Example Request:

GET https://api.teyuto.tv/v2/analytics/collections?start_date=2023-10-12 12:45:00&end_date=2023-12-12 12:45:00&user_id=5678456&tag_id=45
Accept: application/json
Authorization: YOUR_API_TOKEN

Example Response:

{
"status": "success",
"views": [
{
"total": "20000",
"realtime": "1000"
}
],
"sessions": [
{
"total": "15000",
"average": "450"
}
],
"interactions": [
{
"total": "3000",
"comments": "2000",
"live_chat": "1000"
}
]
}

2. Get Analytics for a Specific Collection

Retrieve analytics data for a particular collection.

Endpoint: GET /analytics/collections/{collection_id}

Parameters:

  • collection_id (required): The ID of the collection

Example Request:

GET https://api.teyuto.tv/v2/analytics/collections/12345
Accept: application/json
Authorization: YOUR_API_TOKEN

Example Response:

{
"status": "success",
"views": "10000",
"sessions": "8000",
"interactions": "1500"
}

Interpreting the Results

  • views: Total views and real-time views (for generic analytics)
  • sessions: Total sessions and average session duration (for generic analytics)
  • interactions: Total interactions, including comments and live chat messages

For specific collection analytics:

  • views: Total views for the collection
  • sessions: Total sessions for the collection
  • interactions: Total interactions for the collection

These analytics help you understand the performance and engagement of your collections, allowing you to make informed decisions about content curation and promotion.