# Platform Support

Influtics API supports video tracking across **10 platforms** with comprehensive analytics for each.

## Supported Platforms

| Platform | Identifier | Example URLs | Content Types | Available Metrics |
|----------|------------|--------------|--------------|-------------------|
| TikTok | `tiktok` | `https://www.tiktok.com/@user/video/<id>`<br>`https://vm.tiktok.com/<short_code>`<br>`https://m.tiktok.com/@user/video/<id>`<br>`https://tiktok.com/@user/video/<id>` | Video, Slideshow | Views, Likes, Comments, Reposts, Saves |
| Instagram | `instagram` | `https://www.instagram.com/reel/<id>/`<br>`https://instagram.com/reel/<id>/`<br>`https://www.instagram.com/p/<id>/`<br>`https://instagram.com/p/<id>/`<br>`https://ig.me/<shortlink>` | Reel, Video Post, Carousel | Views, Likes, Comments, Reposts |
| YouTube | `youtube` | `https://www.youtube.com/watch?v=<id>`<br>`https://youtu.be/<id>`<br>`https://youtube.com/shorts/<id>`<br>`https://www.youtube.com/shorts/<id>`<br>`https://m.youtube.com/watch?v=<id>` | Short, Regular Video, Premiere | Views, Likes, Comments |
| Telegram | `telegram` | `https://t.me/<channel>/<message_id>`<br>`https://t.me/c/<channel_id>/<message_id>` | Post | Views, Comments, Reposts |
| VK | `vk` | `https://vk.com/video<owner>_<id>`<br>`https://vk.com/wall<owner>_<id>` | Video Clip, Wall Video | Views, Likes, Comments, Reposts |
| OK | `ok` | `https://ok.ru/video/<id>` | Video | Views, Likes, Reposts |
| Dzen | `dzen` | `https://dzen.ru/video/watch/<id>` | Video, Article | Views, Likes, Comments |
| Threads | `threads` | `https://www.threads.net/@user/post/<id>`<br>`https://www.threads.com/@user/post/<id>` | Text Post, Video Post, Carousel | Views, Likes, Comments, Reposts, Saves |
| Pinterest | `pinterest` | `https://www.pinterest.com/pin/<id>/` | Pin, Idea Pin (Video Slideshow) | Views, Likes, Comments, Reposts, Saves |
| Facebook | `facebook` | `https://www.facebook.com/<user>/videos/<id>/`<br>`https://www.facebook.com/<user>/posts/<post_id>/`<br>`https://www.facebook.com/watch/?v=<id>`<br>`https://www.facebook.com/reel/<id>/`<br>`https://fb.watch/<short_code>` | Reel, Video Post, Live Recording | Views, Likes, Comments, Reposts, Saves |

---

## 🔄 URL Processing

### **Automatic URL Resolution**
The API automatically handles:
- **Shortened URLs**: vm.tiktok.com, youtu.be, ig.me, fb.watch
- **Mobile URLs**: m.tiktok.com, m.youtube.com
- **Redirects**: Automatic following of redirects
- **Parameter Cleanup**: Removes tracking parameters

### **URL Validation**
```javascript
// Example: URL validation and platform detection
const response = await fetch('/v1/videos/track', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer api_key' },
  body: JSON.stringify({ url: videoUrl })
});

// Response includes detected platform
{
  "success": true,
  "data": {
    "platform": "tiktok",  // Auto-detected
    "url": "https://www.tiktok.com/@user/video/123",
    "stats": { ... }
  }
}
```

## ⚠️ Platform Limitations

### **TikTok**
- **Private accounts**: Cannot track private videos
- **Age-restricted content**: Limited access to some content
- **Regional blocks**: Some content may be geo-restricted
- **Example error**:
  ```json
  {
    "error": "TikTok video is age-restricted",
    "code": "AGE_RESTRICTED_CONTENT",
    "solution": "Video cannot be tracked due to age restrictions"
  }
  ```

### **Instagram**
- **Private accounts**: Cannot access private content
- **Story expiration**: Stories disappear after 24 hours
- **Limited metrics**: Some metrics require business accounts
- **Example error**:
  ```json
  {
    "error": "Instagram account is private",
    "code": "PRIVATE_ACCOUNT",
    "solution": "Cannot access content from private accounts"
  }
  ```

### **YouTube**
- **Private videos**: Cannot track unlisted/private content
- **Age restrictions**: Limited access to age-restricted videos
- **Channel settings**: Some metrics depend on channel privacy
- **Example error**:
  ```json
  {
    "error": "YouTube video is unlisted",
    "code": "UNLISTED_VIDEO",
    "solution": "Unlisted videos cannot be tracked"
  }
  ```

### **Facebook**
- **Private accounts**: Cannot track videos from private profiles
- **Age-restricted content**: Limited access to some content
- **Regional blocks**: Some content may be geo-restricted
- **Stories**: Cannot track Facebook Stories (ephemeral, not persistent video posts)
- **Live recordings**: Live streams are tracked from the moment they're published as a recording — not while live
- **Page vs. profile**: Posts published on a personal timeline are subject to stricter privacy defaults than Page posts; tracking requires the post to be public
- **Example error**:
  ```json
  {
    "error": "Facebook video is from a private account",
    "code": "PRIVATE_ACCOUNT",
    "solution": "Cannot access content from accounts with non-public privacy settings"
  }
  ```

## 🔧 Best Practices

### **URL Format Optimization**
```bash
# ✅ Preferred: Use canonical URLs
https://www.tiktok.com/@username/video/1234567890

# ✅ Also works: Shortened URLs (auto-resolved)
https://vm.tiktok.com/shortlink

# ⚠️ Avoid: URLs with excessive parameters
https://www.tiktok.com/@user/video/123?utm_source=...&tracking=...
```

### **Error Handling**
```javascript
try {
  const result = await trackVideo(videoUrl);
  console.log('Platform:', result.data.platform);
} catch (error) {
  if (error.code === 'VIDEO_NOT_FOUND') {
    console.log('Video is private or deleted');
  } else if (error.code === 'INVALID_URL') {
    console.log('URL format not supported');
  }
}
```

### **Platform Detection**
```python
def detect_platform(url):
    if 'tiktok.com' in url:
        return 'tiktok'
    elif 'instagram.com' in url:
        return 'instagram'
    elif 'youtube.com' in url or 'youtu.be' in url:
        return 'youtube'
    else:
        return 'Unknown'
```

## 🆘 Troubleshooting

### **Common Issues**

#### **"Video Not Found"**
- Video may be private or deleted
- URL format might be incorrect
- Platform may have regional restrictions

#### **"Invalid URL Format"**
- Check supported URL patterns above
- Remove unnecessary parameters
- Ensure URL is publicly accessible

#### **"Partial Data Returned"**
- Some metrics may not be available immediately
- Try again after a few minutes
- Check if the video is newly published

---

**Need help with a specific platform?** See [Support →](/support.md) for email, Telegram, and demo booking.
