Enterprise OnlyREST API

API Reference

Programmatic access to YouTube comment data for Enterprise plans.

Authentication

All API requests must include your API key in the Authorization header. Generate your key from the API Keys section of your dashboard. Keys are shown only once — if you lose it, regenerate a new one from the dashboard.

Header format
Authorization: Bearer <your-api-key>
curl
curl -H "Authorization: Bearer yt_live_••••••••••••" \
  "https://www.youtubecommentdownloader.com/api/v1/quota"

Keep your API key secret. Do not expose it in client-side code or public repositories.

Endpoints

GET/api/v1/comments

Fetch comments from a YouTube video. Returns up to 10,000 comments per request, sorted by your chosen order. Each comment (and each reply, if enabled) counts as 1 toward your monthly quota.

Query parameters
ParameterTypeRequiredDefaultDescription
urlstringyesYouTube video URL (any standard format, including youtu.be short links and /shorts/).
maxCommentsintegerno100Maximum number of comments to return. Capped at 10,000 per request.
includeRepliesbooleannofalseWhen true, reply threads are fetched and included in replyList. Each reply counts toward your quota individually.
sortBystringno"top"Sort order for comments. One of: "top" (most relevant), "newest", or "oldest".
Example request
curl
curl -G "https://www.youtubecommentdownloader.com/api/v1/comments" \
  -H "Authorization: Bearer yt_live_••••••••••••" \
  --data-urlencode "url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  --data-urlencode "maxComments=50" \
  --data-urlencode "includeReplies=false" \
  --data-urlencode "sortBy=top"
javascript
const response = await fetch(
  "https://www.youtubecommentdownloader.com/api/v1/comments?" +
    new URLSearchParams({
      url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      maxComments: "50",
      includeReplies: "false",
      sortBy: "top",
    }),
  {
    headers: {
      Authorization: "Bearer yt_live_••••••••••••",
    },
  }
);

const data = await response.json();
console.log(data.comments);
Example response
json
{
  "video": {
    "id": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
    "channelName": "Rick Astley"
  },
  "comments": [
    {
      "id": "UgxZ1a2b3c4d5e6f7g8",
      "author": "SomeUser",
      "text": "This video never gets old.",
      "likes": 4821,
      "date": "1/15/2024",
      "dateRaw": "2024-01-15T12:34:56.000Z",
      "replies": 12,
      "replyList": []
    }
  ],
  "totalFetched": 50,
  "quota": {
    "used": 150,
    "remaining": 999850,
    "limit": 1000000
  }
}
GET/api/v1/channel

List videos from a YouTube channel. Use the returned videoId values with /api/v1/comments to pull comments from each video. Listing a channel's videos does not consume quota — only comment fetches do.

Query parameters
ParameterTypeRequiredDefaultDescription
urlstringyesYouTube channel URL. Supports /channel/ID, /@handle, /c/custom, and /user/legacy formats.
maxVideosintegerno50Maximum number of videos to return. Capped at 500 per request.
Example request
curl
curl -G "https://www.youtubecommentdownloader.com/api/v1/channel" \
  -H "Authorization: Bearer yt_live_••••••••••••" \
  --data-urlencode "url=https://www.youtube.com/@MrBeast" \
  --data-urlencode "maxVideos=25"
javascript
const response = await fetch(
  "https://www.youtubecommentdownloader.com/api/v1/channel?" +
    new URLSearchParams({
      url: "https://www.youtube.com/@MrBeast",
      maxVideos: "25",
    }),
  {
    headers: {
      Authorization: "Bearer yt_live_••••••••••••",
    },
  }
);

const data = await response.json();
console.log(data.videos);
Example response
json
{
  "channel": {
    "id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
    "title": "MrBeast",
    "uploadsPlaylistId": "UUX6OQ3DkcsbYNE6H8uQQuVA"
  },
  "videos": [
    {
      "videoId": "abc123defgh",
      "title": "$1 vs $1,000,000 Hotel Room!",
      "publishedAt": "2024-03-10T18:00:00.000Z"
    }
  ],
  "totalVideos": 25,
  "quota": {
    "used": 150,
    "remaining": 999850,
    "limit": 1000000
  }
}
GET/api/v1/quota

Check your current quota usage. Returns your plan, the number of comments used this month, how many remain, your total limit, and the timestamp when quota resets.

No parameters

This endpoint takes no query parameters.

Example request
curl
curl -H "Authorization: Bearer yt_live_••••••••••••" \
  "https://www.youtubecommentdownloader.com/api/v1/quota"
javascript
const response = await fetch(
  "https://www.youtubecommentdownloader.com/api/v1/quota",
  {
    headers: {
      Authorization: "Bearer yt_live_••••••••••••",
    },
  }
);

const data = await response.json();
console.log(`Used ${data.used} of ${data.limit} comments this month.`);
Example response
json
{
  "plan": "enterprise",
  "used": 42817,
  "remaining": 957183,
  "limit": 1000000,
  "resetsAt": "2026-06-01T00:00:00.000Z"
}

Error codes

All error responses follow the same shape: { "error": "<code>", "message": "<description>" }. Use the error field for programmatic handling and message for human-readable context.

Error codeHTTP statusDescription
missing_api_key401No Authorization header was provided with the request.
invalid_api_key401The API key is malformed, expired, or does not belong to an active Enterprise account.
plan_required403The authenticated account is not on an Enterprise plan. API access requires Enterprise.
quota_exceeded429Your monthly comment quota is exhausted. Quota resets on the 1st of each month.
invalid_params400A required parameter is missing or a parameter value is invalid. Check the message field for details.
not_found404The requested video or channel could not be found. Verify the URL and try again.

Quota & limits

Monthly limit

Enterprise accounts receive 1,000,000 comments per month.

Reset schedule

Quota resets on the 1st of each calendar month at midnight UTC.

What counts

Each top-level comment counts as 1. When includeReplies=true, each reply also counts as 1.

Per-request cap

maxComments is capped at 10,000 per request. Make multiple requests to collect more.

Monitor usage

Call GET /api/v1/quota at any time to check your used, remaining, and resetsAt values.

Code examples

A complete workflow: fetch the video list from a channel, then pull comments from each video. Copy-paste ready.

python
import requests

API_KEY = "yt_live_••••••••••••"
BASE_URL = "https://www.youtubecommentdownloader.com/api/v1"
HEADERS  = {"Authorization": f"Bearer {API_KEY}"}

# Step 1 — Get videos from a channel
channel_res = requests.get(
    f"{BASE_URL}/channel",
    headers=HEADERS,
    params={
        "url": "https://www.youtube.com/@MrBeast",
        "maxVideos": 10,
    },
)
channel_data = channel_res.json()
videos = channel_data["videos"]

# Step 2 — Fetch comments for each video
all_comments = []
for video in videos:
    video_url = f"https://www.youtube.com/watch?v={video['videoId']}"
    comments_res = requests.get(
        f"{BASE_URL}/comments",
        headers=HEADERS,
        params={
            "url": video_url,
            "maxComments": 500,
            "sortBy": "top",
        },
    )
    comments_data = comments_res.json()
    all_comments.extend(comments_data.get("comments", []))
    print(f"{video['title']}: {comments_data['totalFetched']} comments fetched")

print(f"\nTotal comments collected: {len(all_comments)}")
javascript
const API_KEY = "yt_live_••••••••••••";
const BASE_URL = "https://www.youtubecommentdownloader.com/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };

async function fetchChannelComments(channelUrl, videosToFetch = 10, commentsPerVideo = 500) {
  // Step 1 — Get videos from the channel
  const channelRes = await fetch(
    `${BASE_URL}/channel?${new URLSearchParams({ url: channelUrl, maxVideos: String(videosToFetch) })}`,
    { headers }
  );
  const channelData = await channelRes.json();
  const videos = channelData.videos ?? [];

  // Step 2 — Fetch comments for each video
  const allComments = [];
  for (const video of videos) {
    const videoUrl = `https://www.youtube.com/watch?v=${video.videoId}`;
    const commentsRes = await fetch(
      `${BASE_URL}/comments?${new URLSearchParams({
        url: videoUrl,
        maxComments: String(commentsPerVideo),
        sortBy: "top",
      })}`,
      { headers }
    );
    const commentsData = await commentsRes.json();
    allComments.push(...(commentsData.comments ?? []));
    console.log(`${video.title}: ${commentsData.totalFetched} comments`);
  }

  return allComments;
}

fetchChannelComments("https://www.youtube.com/@MrBeast")
  .then((comments) => console.log(`Total collected: ${comments.length}`))
Enterprise

Ready to get started?

Contact us to set up your Enterprise account and get your API key. We'll get you up and running quickly.

Contact us →