API Docs / Videos

Videos

Endpoints for searching and viewing YouTube video data, including transcripts and comments.

Endpoints

Method Path Description
GET /api/v1/videos/search Search videos by keyword
GET /api/v1/videos/:id Get video details
GET /api/v1/videos/:id/transcript Get video transcript
GET /api/v1/videos/:id/comments List video comments

Search Videos

GET /api/v1/videos/search

Search for videos by title, with filters for view count, outlier status, and video kind.

Parameters

Parameter Type Required Description
q string Yes Search query (matches video title)
kind string No Filter by video kind
outliers string No Set to true for positive outliers only
min_views integer No Minimum view count
sort_by string No Sort field: published (default), views, outlier_ratio, likes
page integer No Page number (default: 1)
per_page integer No Results per page (default: 25)

Example Request

curl -X GET "https://tuberalytics.com/api/v1/videos/search?q=n8n+automation+tutorial&outliers=true" \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

{
  "data": [
    {
      "id": 789,
      "youtube_video_id": "abc123def456",
      "channel_id": 170,
      "title": "CLAUDE CODE FULL COURSE 4 HOURS: Build & Sell (2026)",
      "thumbnail_url": "https://i.ytimg.com/vi/abc123def456/maxresdefault.jpg",
      "published_at": "2026-03-15T10:00:00Z",
      "duration_seconds": 14400,
      "view_count": 809358,
      "like_count": 25000,
      "comment_count": 1500,
      "kind": "video",
      "is_positive_outlier": true,
      "average_views_ratio": 19.0,
      "views_per_day": 11500
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 25,
    "total_pages": 5,
    "total_count": 112
  }
}

Get Video

GET /api/v1/videos/:id

Get full details for a single video, including outlier metrics and tags.

Example Request

curl -X GET "https://tuberalytics.com/api/v1/videos/789" \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

{
  "data": {
    "id": 789,
    "youtube_video_id": "abc123def456",
    "channel_id": 170,
    "title": "CLAUDE CODE FULL COURSE 4 HOURS: Build & Sell (2026)",
    "thumbnail_url": "https://i.ytimg.com/vi/abc123def456/maxresdefault.jpg",
    "published_at": "2026-03-15T10:00:00Z",
    "duration_seconds": 14400,
    "view_count": 809358,
    "like_count": 25000,
    "comment_count": 1500,
    "kind": "video",
    "is_positive_outlier": true,
    "is_negative_outlier": false,
    "average_views_ratio": 19.0,
    "views_per_day": 11500,
    "vsr": 2.41,
    "z_score": 2.5,
    "description": "Complete Claude Code tutorial from beginner to expert. Build and sell AI-powered tools...",
    "tags": ["claude code", "ai coding", "vibe coding", "tutorial"],
    "channel": {
      "id": 170,
      "title": "Nick Saraev",
      "handle": "@nicksaraev"
    },
    "created_at": "2026-03-15T12:00:00Z",
    "updated_at": "2026-03-30T08:00:00Z"
  }
}

Get Video Transcript

GET /api/v1/videos/:id/transcript

Get the full transcript text for a video.

Returns 404 if no transcript is available for this video.

Example Request

curl -X GET "https://tuberalytics.com/api/v1/videos/789/transcript" \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

{
  "data": {
    "text": "Hey everyone, welcome back. Today we're building a complete AI automation from scratch...",
    "language_code": "en",
    "word_count": 38000,
    "fetched_at": "2026-03-20T14:00:00Z"
  }
}

List Video Comments

GET /api/v1/videos/:id/comments

List top-level comments for a video, sorted by like count.

Parameters

Parameter Type Required Description
page integer No Page number (default: 1)
per_page integer No Results per page (default: 25)

Example Request

curl -X GET "https://tuberalytics.com/api/v1/videos/789/comments" \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

{
  "data": [
    {
      "id": 5001,
      "author": "AutomationPro42",
      "text": "This Claude Code course is incredible. Best tutorial on YouTube by far!",
      "like_count": 345,
      "reply_count": 12,
      "is_pinned": false,
      "published_at": "2026-03-15T11:30:00Z"
    },
    {
      "id": 5002,
      "author": "AIbuilderMike",
      "text": "Would love to see a Cursor vs Claude Code comparison next.",
      "like_count": 189,
      "reply_count": 5,
      "is_pinned": true,
      "published_at": "2026-03-15T12:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 25,
    "total_pages": 8,
    "total_count": 192
  }
}