Welcome to ContentStats.io API
Track social media video performance across TikTok, YouTube, Instagram, and Twitter with our simple REST API.Base URL
Authentication
All API requests require authentication using an API key in theX-API-Key header:
Get Your API Key
Learn how to create and manage API keys
Endpoints Overview
| Endpoint | Method | Description |
|---|---|---|
/videos/track | POST | Start tracking a video |
/videos | GET | List all tracked videos |
/videos/{id} | GET | Get video details with snapshots |
/videos/{id}/stop | POST | Stop tracking early |
/usage | GET | Get usage and billing stats |
Quick Example
Track a TikTok video:Rate Limiting
| Plan | Rate Limit |
|---|---|
| Free | 60 requests/minute |
| Pro | 300 requests/minute |
| Enterprise | Custom |
Rate Limits Details
Learn about rate limiting and best practices
Error Handling
All errors return appropriate HTTP status codes with JSON responses:| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Unauthorized (invalid API key) |
| 402 | Payment Required (insufficient balance) |
| 403 | Forbidden (access denied) |
| 404 | Not Found |
| 429 | Too Many Requests (rate limited) |
| 500 | Internal Server Error |
Error Reference
Complete error codes and handling guide
Supported Platforms
| Platform | Metrics |
|---|---|
| TikTok | Views, Likes, Comments, Shares, Saves |
| YouTube | Views, Likes, Comments |
| Likes, Comments, Saves | |
| Twitter/X | Views, Likes, Retweets, Replies |
Data Types
Video Object
Snapshot Object
Pagination
List endpoints support pagination:limit: Number of results (1-100, default: 50)platform: Filter by platformstatus: Filter by status
Webhooks (Coming Soon)
Subscribe to events:snapshot.createdtracking.completedbalance.low
Best Practices
Secure Your API Key
Secure Your API Key
- Store in environment variables
- Never commit to version control
- Rotate keys every 90 days
- Use server-side only
Poll Efficiently
Poll Efficiently
- Snapshots update hourly
- Don’t poll faster than every hour
- Use webhooks when available
Monitor Usage
Monitor Usage
- Check balance before tracking
- Set up auto top-up
- Monitor usage endpoint regularly
Handle Errors
Handle Errors
- Implement retry logic with exponential backoff
- Handle rate limits gracefully
- Log errors for debugging
API Endpoints
Track Video
POST /videos/track
List Videos
GET /videos
Get Video
GET /videos/
Stop Video
POST /videos//stop
Get Usage
GET /usage
