Get Analytics
REST API
Get Analytics
Retrieve recent YouTube analytics and performance data
GET
Get Analytics
Endpoint
Description
Retrieves recent analytics data from YouTube, including views, engagement metrics, audience insights, and performance trends. This data is collected and analyzed by the Analytics & Optimization Agent.Request
No parameters required.Headers
No special headers required.Response
The response structure is determined by the Analytics & Optimization Agent’sgetRecentAnalytics() method. Typical fields include:
Error message if the request fails.
Example Request
Example Response
Success
Error
Response Codes
| Status Code | Description |
|---|---|
| 200 | Analytics retrieved successfully |
| 500 | Server error retrieving analytics |
Use Cases
Performance Dashboard
Build a real-time analytics dashboard:Automated Reporting
Generate weekly performance reports:Content Strategy Optimization
Use analytics to inform content decisions:Analytics data is fetched from the YouTube Analytics API. The agent caches data to avoid hitting API rate limits. Data may be up to 15 minutes old.
Data Freshness
The Analytics & Optimization Agent updates data on the following schedule:- Real-time metrics: Updated every 15 minutes
- Detailed analytics: Updated every 6 hours
- Demographic data: Updated daily
- AI insights: Regenerated every 12 hours
Privacy and Compliance
All analytics data is:- Aggregated and anonymized per YouTube’s terms
- Stored securely in the local database
- Never shared with third parties
- Compliant with YouTube’s API Terms of Service