# TikHub YouTube API in Python: official quota, TikHub and EveryInfra compared on search, comments and transcripts

> YouTube data in Python, three ways: the official API caps search at 100 calls a day, TikHub starts at $0.001 a call, our live calls start at $0.000556.

- Canonical page: https://everyinfra.com/en/blog/tikhub-youtube-api-python
- Published: 2026-11-13T23:47:00+08:00 · Fact-checked: 2026-11-13T22:40:00+08:00

Since June 1, 2026, the official YouTube Data API v3 counts search in its own bucket. The default is 100 searches a day with 50 results at most per call. The caption download method needs edit permission on the video. So you cannot pull transcripts of public lectures that you do not own. We read both rules on the [Quota Calculator](https://developers.google.com/youtube/v3/determine_quota_cost) and [captions.download](https://developers.google.com/youtube/v3/docs/captions/download) pages on November 13, 2026.

TikHub lists 48 YouTube endpoints. Search, comments and video details cost $0.001 per call, and its caption endpoint `get_video_captions` costs $0.008 per call. Only 1 of the 48 gets the daily volume discount. Only 6 accept the free sign-up credit. We read the [public price endpoint](https://api.tikhub.io/api/v1/tikhub/user/get_all_endpoints_info) without a key at 21:32 Singapore time that day.

On EveryInfra we ran the same "search, video, comments, transcript" chain three times, at 21:35, 21:42 and 21:48 Singapore time on November 13, 2026. Search cost $0.000778 per call and returned 20 rows. Video details and comments cost $0.000556 per call. Two comments calls returned 40 rows each this time, so 1,000 comments cost $0.0139 at the charged amount.

Each of the three videos returned a transcript between 22:31 and 22:32, at $0.000556 per call. The CS50P full course is 15 hours and 57 minutes long. It came back in one call with 24,851 segments and 183,775 English words.

> **Key points**
>
> - Official YouTube Data API v3: search has its own bucket of 100 calls a day, at most 50 results each, so 5,000 search results a day at most. Comments and video details share 10,000 units a day. You cannot download captions of videos that other people own.
> - TikHub's public price list has 1,482 rows and 48 of them are YouTube. 38 cost $0.001 per call. The caption endpoint `get_video_captions` costs $0.008. Only 1 endpoint gets the daily discount, and only 6 accept the $0.05 sign-up credit.
> - EveryInfra, three live rounds: each search returned 20 rows for $0.000778. Two comments calls returned 40 rows each, and one returned 9 rows (that video has only 9 comments), at $0.000556 per call.
> - Transcripts: TikHub `get_video_captions` lists $0.008 per call. Our three transcript calls were each charged $0.000556. The longest course came back with 183,775 English words in one call.
> - For one 12-lecture course, video details, comments and transcripts for every lecture cost about $0.121 at TikHub list prices and about $0.0208 at EveryInfra catalog prices. The official API uses only quota, but it cannot do the transcript step.

![Illustration: three conveyor lanes start below one dark video screen. The left lane drops blank cards into a glass jar with a fuel gauge on the lid, next to an hourglass, and the jar is only partly full. The middle lane needs a coin for every small bundle of cards, and a long stack of grey coins stands beside it. The right lane takes one teal coin and lets through a thick stack of cards and a long paper scroll. Meaning: the official API has a daily cap, the paid APIs charge per call, and rows per call plus transcripts decide the final bill.](https://everyinfra.com/articles/tikhub-youtube-api-python/img-explain.webp)

How the three paths bill you: a daily cap on the official API, a per-call price on the other two, where rows per call set the cost per 1,000.

For a short verdict, see [/alternatives/tikhub](/en/alternatives/tikhub). TikHub's full billing formula is in [TikHub pricing explained](/en/blog/tikhub-pricing-explained). The two-level paging of YouTube comment replies is in [Why YouTube comment scrapers miss replies](/en/blog/youtube-comment-replies-pagination).

## One table: the official Data API, the tikhub youtube api, and EveryInfra

The official column comes from the text of the developers.google.com pages. The TikHub column comes from public material that anyone can read without a key. That is the [price endpoint](https://api.tikhub.io/api/v1/tikhub/user/get_all_endpoints_info), the [openapi.json](https://api.tikhub.io/openapi.json) file, the [pricing page](https://tikhub.io/pricing), the [FAQ](https://tikhub.io/faq) and the [YouTube API page](https://tikhub.io/youtube-api). We read all of them between 21:32 and 21:34 Singapore time on November 13, 2026.

We did not open a TikHub account and did not call its paid endpoints. So every TikHub number below is a list price, not a measured bill. The EveryInfra column uses the [capability catalog](https://api.everyinfra.com/api/v1/social/catalog) read at 21:31 and three rounds of live calls.

| Bill item | YouTube Data API v3 (official) | TikHub YouTube endpoints | EveryInfra `youtube/*` |
| --- | --- | --- | --- |
| How it bills | Free, with daily quota units | A price per request | A price per request |
| Search | Own bucket, 100 calls a day, 50 rows max | `search_video` $0.001, page size not published | `youtube/search` $0.000778, 20 rows per call in our test |
| Video details | `videos.list` 1 unit, up to 50 IDs | `get_video_info` $0.001 | `youtube/video` $0.000556 |
| Comments | `commentThreads.list` 1 unit, up to 100 per page | `get_video_comments` $0.001, page size not published | `youtube/comments` $0.000556, 40 rows per call in two of our calls |
| Transcripts | `captions.download` 200 units, needs edit permission | `get_video_captions` $0.008, charged even with no captions | `youtube/transcript` $0.000556, no charge on failure |
| Free allowance | 10,000 units plus 100 searches a day | $0.05 on sign-up, usable on 6 of 48 YouTube endpoints | $1 for starring two GitHub repos, valid 24 hours |
| Volume discount | None (you can request more quota) | Daily tiers down to 50%, only 1 YouTube endpoint qualifies | No daily discount |
| Minimum top-up | No top-up | $5, and PayPal charges $5.55 for $5 | Tiers start at $10 |
| AI tool access | Write your own function | One MCP server per platform, 37 YouTube tools on its [MCP page](https://tikhub.io/mcp) | One remote MCP address, capability chosen by parameter |

The search quota and the caption permission have the most effect on how you write the script. The search change comes from Google. The [revision history](https://developers.google.com/youtube/v3/revision_history) entry of June 1, 2026 says the Data API is "transitioning to a granular quota system." It starts with `videos.insert` and `search.list`. The [search.list page](https://developers.google.com/youtube/v3/docs/search/list) now says "100 calls per day," with 1 unit per call in the Search Queries bucket. Under the old rule, one search cost 100 units, so 10,000 units also gave 100 searches.

The daily cap is the same. The difference is that search no longer eats the 10,000 units that comments and video details use. TikHub's [YouTube API page](https://tikhub.io/youtube-api) still said "a single search burns 100 of them" when we read it on November 13. That line follows the old rule.

For transcripts, the official method only downloads captions of videos that you can edit. For audience research on other people's videos, such as public lectures, the official path stops at this step.

## The official YouTube Data API v3 in 2026: search has its own bucket

The first paragraph of Google's [Quota Calculator](https://developers.google.com/youtube/v3/determine_quota_cost) gives the rules. A project gets 100 `search.list` calls, 100 `videos.insert` calls and 10,000 units a day for all other methods. Quotas reset at midnight Pacific Time. Every request costs at least one unit, and that includes invalid requests. With these rules and the price of each method, you can compute a daily ceiling for a Python script.

Search allows 100 calls with 50 rows at most per page ([search.list](https://developers.google.com/youtube/v3/docs/search/list)), so 5,000 rows a day. Comment threads allow 100 rows per page at 1 unit per page ([commentThreads.list](https://developers.google.com/youtube/v3/docs/commentThreads/list)). If all 10,000 units go to comments, the ceiling is 1,000,000 top-level comments a day. Video details accept up to 50 IDs per call at 1 unit ([videos.list](https://developers.google.com/youtube/v3/docs/videos/list)), so the ceiling is 500,000 videos.

![Screenshot of Google documentation text with three excerpts. The first is from the Quota Calculator, read at 21:33 Singapore time on 2026-11-13. A teal box marks the sentence that gives a default of 100 search.list calls, 100 videos.insert calls and 10,000 units a day for all other endpoints. A small table below lists commentThreads.list 1, videos.list 1, captions.list 50 and captions.download 200. The second excerpt is from search.list, and a teal box marks 100 calls per day at 1 unit in the Search Queries bucket. The third is from captions.download, and a teal box marks the sentence that the method requires permission to edit the video.](https://everyinfra.com/articles/tikhub-youtube-api-python/img-shot-google-quota.webp)

Excerpts from the official documentation. Teal boxes mark the sentences that this article cites. Read at 21:33 Singapore time on November 13, 2026. [Screenshot of developers.google.com documentation](https://developers.google.com/youtube/v3/determine_quota_cost)

All three ceilings assume full pages. The search.list page itself warns that the API can return fewer items than `maxResults` because of internal sorting or filtering. It tells you to rely on `nextPageToken` for more pages. So 5,000 is a ceiling, and the real number is lower.

A search result gives you a video ID and a short snippet. For views and likes, you call `videos.list` again. A real script spends two buckets at the same time: search calls and units.

![Horizontal bar chart on a log scale, each grid line is 10 times the last. It shows the most rows per day under the default free quota of the YouTube Data API. Top-level comments 1,000,000, video details 500,000, search results 5,000, with the search bar in teal. The subtitle says each bar assumes the whole day goes to that method with full pages, and that captions of other people's videos are 0.](https://everyinfra.com/articles/tikhub-youtube-api-python/fig-01-official-daily-cap-bar.en.light.svg)

Transcripts have no bar in the chart because the value is zero. [captions.list](https://developers.google.com/youtube/v3/docs/captions/list) costs 50 units and returns only a list of caption tracks, not the text. [captions.download](https://developers.google.com/youtube/v3/docs/captions/download) costs 200 units. The page says that "this method requires the user to have permission to edit the video." You must call it with OAuth as the video owner.

For course feedback or competitor research, the official API gives titles, descriptions, statistics and comments. It does not give the words that the speaker says in the video. YouTube Help says that automatic captions come from speech recognition, and quality changes with accents and audio ([Use automatic captioning](https://support.google.com/youtube/answer/6373554)). That is true on every path, so spot-check any transcript that you get.

| Official method | Units per call | Page limit | Daily ceiling on the default quota | Other people's videos? |
| --- | --- | --- | --- | --- |
| `search.list` | Own bucket, 1 call | 50 rows (default 5) | 100 x 50 = 5,000 rows | Yes |
| `videos.list` | 1 | 50 IDs | 10,000 x 50 = 500,000 | Yes |
| `commentThreads.list` | 1 | 100 rows (default 20) | 10,000 x 100 = 1,000,000 | Yes |
| `comments.list` (replies) | 1 | 100 rows | Shares the 10,000 units | Yes |
| `captions.list` | 50 | Track list | 200 calls | Lists tracks only |
| `captions.download` | 200 | One track | 50 calls | No, needs edit permission |

When the quota is not enough, Google's path is the [quota extension form](https://support.google.com/youtube/contact/yt_api_form) plus a [compliance audit](https://developers.google.com/youtube/v3/guides/quota_and_compliance_audits). The audit checks how your app shows and stores data against the [Developer Policies](https://developers.google.com/youtube/terms/developer-policies). Two clauses matter most for data analysis. One clause limits how long you can keep non-authorized data, such as statistics, to 30 days. After that, you must delete or refresh it.

The other clause has the title "Scraping." It says API clients must not scrape YouTube and must not obtain scraped YouTube data. That clause applies to the API client that you registered with Google. If your project uses both the official API and a third-party data API, read the text against your use case. Ask your legal team if you need to. We do not give a legal answer here.

## The tikhub youtube api price list, endpoint by endpoint

TikHub's price endpoint path is `/api/v1/tikhub/user/get_all_endpoints_info`. We sent one GET with no key at 21:32:42 Singapore time on November 13, 2026. It returned HTTP 200 and an array of 1,482 rows. The server time in the response was 05:32:42 Los Angeles time.

Our [TikHub pricing explained](/en/blog/tikhub-pricing-explained) article read 1,470 rows on November 1, 2026. Our [TikHub Twitter API alternative](/en/blog/tikhub-twitter-api-alternative) article read 1,481 rows on November 11, 2026. The list keeps growing, so the numbers below are for the November 13 copy only.

![Screenshot of a real response from the TikHub public price endpoint. The top line shows GET https://api.tikhub.io/api/v1/tikhub/user/get_all_endpoints_info, with no API key, read at 21:32:41 Singapore time on 2026-11-13, HTTP 200. The response header shows code 200, a message that says the request will incur a charge, time 2026-11-13 05:32:42 in the Los Angeles time zone, and 48 YouTube rows out of 1,482. Four rows are shown below: search_video at 0.001, get_video_comments at 0.001, get_video_captions at 0.008, and get_video_info_v2. Teal boxes mark allow_free_credit 0 and allow_discount 0 in the first three rows, and the 0.008 price of the caption row.](https://everyinfra.com/articles/tikhub-youtube-api-python/img-shot-tikhub-yt-prices.webp)

The TikHub public price endpoint, with 4 YouTube rows shown. Teal boxes mark the fields this article cites. Read at 21:32 Singapore time on November 13, 2026. [Screenshot of the TikHub public price endpoint response](https://api.tikhub.io/api/v1/tikhub/user/get_all_endpoints_info)

The 48 YouTube rows sit under two groups, `/api/v1/youtube/web/` and `/api/v1/youtube/web_v2/`. We counted four fields. For price, `endpoint_cost` is $0.001 on 38 endpoints and $0.002 on 5. One endpoint each costs $0.003, $0.004, $0.008, $0.03 and $0. For speed, `rate_limit` is 10 per second on 46 endpoints.

`get_video_comments_v2` allows 4 per second, and the caption result endpoint shows 2. Only 6 endpoints accept free credit (`allow_free_credit`). They are helpers such as channel ID lookup, channel URL lookup, search suggestions and video details v2. Only 1 endpoint gets the tier discount (`allow_discount`), and that is `web_v2/get_video_info_v2`.

So the [pricing page](https://tikhub.io/pricing) tiers do not apply to YouTube search, comments or captions. Those tiers give 10% off from 1,000 calls a day and 50% off above 30,000. The $0.05 sign-up credit does not apply to those three groups either. To test TikHub YouTube comments from Python, you must first top up at least $5.

With PayPal, $5 costs $5.55. The [FAQ](https://tikhub.io/faq) says so in plain words: "Topping up $5 through PayPal is charged as $5.55". Alipay adds 2.6% plus $0.30, and USDT adds 5% plus $0.30.

| Use | TikHub endpoint (price list name) | Price | Free credit | Tier discount | In public docs |
| --- | --- | --- | --- | --- | --- |
| Video search | `web/search_video` | $0.001 | No | No | Yes |
| General search V2 (cleaned) | `web_v2/get_general_search_v2` | $0.002 | No | No | Yes |
| Video details | `web_v2/get_video_info` | $0.001 | No | No | Yes |
| Video details V2 | `web_v2/get_video_info_v2` | $0.001 | No | Yes | Yes |
| Top-level comments | `web_v2/get_video_comments` | $0.001 | No | No | Yes |
| Replies | `web_v2/get_video_comment_replies` | $0.001 | No | No | Yes |
| Captions | `web_v2/get_video_captions` | $0.008 | No | No | Yes |
| Captions V2 | `web_v2/get_video_captions_v2` | $0.001 | No | No | No |
| Channel videos | `web_v2/get_channel_videos` | $0.001 | No | No | Yes |
| Channel Shorts | `web_v2/get_channel_shorts` | $0.001 | No | No | Yes |
| Channel email | `web/get_channel_email` | $0.03 | No | No | No |

We built the last column by matching the price list against [openapi.json](https://api.tikhub.io/openapi.json), version V5.3.2, one path at a time. The openapi file has 34 YouTube paths, and the price list has 48. So 14 endpoints have a price but no public documentation. They include `get_video_captions_v2` at $0.001, `get_channel_email` at $0.03, and the older v1 comment endpoints. A Python developer can only call what the docs describe. So the cheaper Captions V2 row is not usable for most readers from public material alone.

The caption endpoint docs contain one more line to read with care. When a video has no captions, `get_video_captions` returns HTTP 200 with the message "No transcript is available for this video". The docs then say that the call is billed as usual, at $0.008. Long videos turn into an async job, and you poll the free `get_video_captions_result` with the `job_id`. The [FAQ](https://tikhub.io/faq) says "A request is billed when it returns status 200; failed requests are not charged." Read together, a video with no captions counts as a success. If some lectures in a course have no captions, you pay $0.008 for each of them anyway.

## tikhub youtube api python: what the code looks like on each path

The three scripts share one structure: read a key, send a request, page through results, and save JSON. They differ in three places: how you authenticate, how you page, and whether the transcript step works at all. The official path uses Google's [google-api-python-client](https://github.com/googleapis/google-api-python-client). Version 2.202.0 came out on November 10, 2026 ([PyPI](https://pypi.org/project/google-api-python-client/)).

TikHub has its own Python SDK ([tikhub 2.2.0 on PyPI](https://pypi.org/project/tikhub/), October 3, 2026), and you can also send a GET with [requests](https://pypi.org/project/requests/). EveryInfra has one POST address, and our script uses only requests. All three scripts read the key from an environment variable through Python's [os.environ](https://docs.python.org/3/library/os.html). None of them write the key to a file.

The official path below gets all top-level comments of one video. Follow Google's [Python quickstart](https://developers.google.com/youtube/v3/quickstart/python) to set up. You create the API key in the Google Cloud console ([API keys](https://cloud.google.com/docs/authentication/api-keys)). Paging uses `nextPageToken` ([pagination guide](https://developers.google.com/youtube/v3/guides/implementation/pagination)). This block is a configuration example. We did not run it in this test, and the unit count follows the docs.

```text
# Configuration example: official YouTube Data API v3 (pip install google-api-python-client)
import os
from googleapiclient.discovery import build

yt = build("youtube", "v3", developerKey=os.environ["YOUTUBE_API_KEY"])

def all_top_level_comments(video_id):
    rows, token, units = [], None, 0
    while True:
        resp = yt.commentThreads().list(
            part="snippet", videoId=video_id, maxResults=100,
            order="relevance", textFormat="plainText", pageToken=token,
        ).execute()
        units += 1                      # 1 unit per page
        for item in resp["items"]:
            s = item["snippet"]["topLevelComment"]["snippet"]
            rows.append({"text": s["textOriginal"], "likes": s["likeCount"],
                         "published_at": s["publishedAt"]})
        token = resp.get("nextPageToken")
        if not token:
            return rows, units
```

The TikHub path follows the `get_video_comments` parameters in its [openapi.json](https://api.tikhub.io/openapi.json). The paging parameter is `continuation_token`. The default `need_format=true` returns cleaned fields, and `published_time` is a relative time such as "1 day ago". This block is also a configuration example that we did not run, because we do not open accounts with the other company. The $0.001 per call is the list price.

```text
# Configuration example: TikHub web_v2 comments endpoint (built from openapi.json, not run)
import os, requests

H = {"Authorization": f"Bearer {os.environ['TIKHUB_API_KEY']}"}
URL = "https://api.tikhub.io/api/v1/youtube/web_v2/get_video_comments"

def comments(video_id, pages=5):
    rows, token = [], None
    for _ in range(pages):              # $0.001 per page; rows per page not published
        params = {"video_id": video_id, "sort_by": "top", "language_code": "en-US"}
        if token:
            params["continuation_token"] = token
        data = requests.get(URL, headers=H, params=params, timeout=60).json()["data"]
        rows += data.get("comments", [])
        token = data.get("continuation_token")
        if not token:
            break
    return rows
```

The EveryInfra path runs the full "search, video, comments, transcript" chain. We used this script for the three live rounds, and it saved every raw response. It needs requests ([2.34.2 on PyPI](https://pypi.org/project/requests/)) and the standard [zoneinfo](https://docs.python.org/3/library/zoneinfo.html) module. Each step is one POST with `"platform":"youtube"` plus the capability name, and the parameters go in `params`. A slow request answers with `status: running` and a `poll_url`, and the script polls it. On HTTP 429, the script waits for the `Retry-After` value.

```text
"""YouTube search -> video -> comments -> transcript with the EveryInfra API.

Usage:
    export EVERYINFRA_API_KEY=...        # never hard-code the key
    python3 yt_chain.py "cs50 python lecture" out_dir

Each step is one POST /api/v1/social call. The script saves every raw
response to out_dir and prints rows returned and USD charged per step.
"""
import json
import os
import sys
import time
from datetime import datetime
from zoneinfo import ZoneInfo

import requests

API = "https://api.everyinfra.com/api/v1/social"
KEY = os.environ["EVERYINFRA_API_KEY"]
SGT = ZoneInfo("Asia/Singapore")
session = requests.Session()
session.headers.update({"Authorization": f"Bearer {KEY}", "User-Agent": "yt-chain-example/1.0"})

def call(action, params, out_dir, tag):
    body = {"platform": "youtube", "action": action, "params": params}
    for attempt in range(4):
        started = datetime.now(SGT).strftime("%Y-%m-%d %H:%M:%S")
        r = session.post(API, json=body, timeout=120)
        if r.status_code == 429:  # rate limit: wait and try again
            time.sleep(int(r.headers.get("Retry-After", 60)))
            continue
        break
    data = r.json()
    # slow jobs answer with status=running and a poll_url
    while isinstance(data, dict) and data.get("status") == "running" and data.get("poll_url"):
        time.sleep(5)
        poll = data["poll_url"]
        if poll.startswith("/"):
            poll = "https://api.everyinfra.com" + poll
        data = session.get(poll, timeout=60).json()
    with open(os.path.join(out_dir, f"{tag}_{action}.json"), "w", encoding="utf-8") as f:
        json.dump({"sgt": started, "http": r.status_code, "request": body, "response": data}, f, ensure_ascii=False, indent=1)
    results = data.get("results") if isinstance(data, dict) else None
    rows = len(results) if isinstance(results, list) else (1 if isinstance(results, dict) else 0)
    charged = (data.get("billing") or {}).get("charged_usd", 0) if isinstance(data, dict) else 0
    err = (data.get("error") or {}).get("code") if isinstance(data, dict) and isinstance(data.get("error"), dict) else None
    print(f"{started} SGT  youtube/{action:<10} http={r.status_code} rows={rows:<4} charged_usd={charged} error={err}")
    return data, rows, charged

def main():
    keyword, out_dir = sys.argv[1], sys.argv[2]
    tag = sys.argv[3] if len(sys.argv) > 3 else "r"
    os.makedirs(out_dir, exist_ok=True)
    total, rows_total = 0.0, 0

    found, n, c = call("search", {"keyword": keyword, "limit": 20}, out_dir, tag)
    total, rows_total = total + c, rows_total + n
    videos = [v for v in found.get("results", []) if v.get("comment_count")]
    if not videos:
        sys.exit("no video with comments in the search results")
    url = videos[0]["url"]
    time.sleep(7)

    for action, params in (
        ("video", {"url": url}),
        ("comments", {"url": url, "sort": "popular", "limit": 40}),
        ("transcript", {"url": url, "language": "en"}),
    ):
        _, n, c = call(action, params, out_dir, tag)
        total, rows_total = total + c, rows_total + n
        time.sleep(7)

    print(f"video={url} rows={rows_total} total_usd={round(total, 6)}")

if __name__ == "__main__":
    main()
```

All three authenticate with one header. Paging is where they differ most. The official API gives `nextPageToken`, and TikHub gives `continuation_token`. On both, you write the loop and count the pages that you paid for. On EveryInfra, `youtube/search` and `youtube/comments` take a `limit` and return the rows in one call.

The [catalog](https://api.everyinfra.com/api/v1/social/catalog) lists the allowed range of each parameter. There is no paging parameter, and billing is per call, not per page. For more comments than one call returns, pull once with `sort` set to `popular` and once with `newest`, or use `since` to cut by date. Then remove duplicates by comment `id`.

## Field map: one comment, three shapes

The three paths name and format "one comment" in different ways. We matched them field by field. The official sources are the [comments resource](https://developers.google.com/youtube/v3/docs/comments) and the [commentThreads resource](https://developers.google.com/youtube/v3/docs/commentThreads). The other two sources are the `get_video_comments` sample in TikHub's openapi.json and the `response_fields` of `youtube/comments` in our catalog. The TikHub column comes from its documentation sample, not from our calls.

| Meaning | Official Data API | TikHub `get_video_comments` (docs sample) | EveryInfra `youtube/comments` |
| --- | --- | --- | --- |
| Comment ID | `id` | `comment_id` | `id` |
| Text | `textOriginal`, `textDisplay` | `content` | `text` |
| Author | `authorDisplayName` | `author.display_name` | `author_name` |
| Posted time | `publishedAt` (ISO 8601) | `published_time` (relative, such as "1 day ago") | `posted_at` |
| Likes | `likeCount` (integer) | `like_count` (string, such as "2") | Use `sort: popular` for top comments; total video likes are in `youtube/video` |
| Replies | `totalReplyCount`, `parentId` | `reply_count` (string), `reply_level` | `is_reply`, `reply_to_id` |
| Image in the comment | `imageUrl` (added September 2026) | Not listed in docs | Not in catalog |

For time, the official API gives an ISO timestamp to the second, and the TikHub docs sample shows relative times such as "1 day ago". For a time series such as "which week after launch had the most comments", the official timestamp is the better source. For likes, the official value is an integer, and the TikHub sample is a string that you must convert.

For replies, the official path needs a separate `comments.list` call by `parentId`, and [this article](/en/blog/youtube-comment-replies-pagination) tests the two-level paging. All 89 comments that our three rounds returned were top-level (`is_reply` was false on every row).

For serious course research, a safe combination follows from this table. Use the official API for comment text, time and likes. Use a path that can read other people's videos for transcripts. Then join the two on the video ID. The official comment `id` and the `id` that we return are both YouTube's own comment IDs, so they match directly. Check a few rows before you assume that TikHub's `comment_id` uses the same IDs.

## Live test: one chain at 21:35, 21:42 and 21:48

Each round used a different public course keyword. The script picked the first search result with comments. Then it pulled the details, the comments and the transcript of that video. Money comes from `billing.charged_usd` in each response, and rows come from the length of `results`. We kept every raw response.

| Round (Singapore time) | Keyword | Video picked | Search | Video details | Comments | Transcript |
| --- | --- | --- | --- | --- | --- | --- |
| 21:35 | cs50 python lecture | CS50P full course, reposted by freeCodeCamp, 15 h 57 min, 9,529,399 views, 5,433 comments | 20 rows, $0.000778 | 1, $0.000556 | 40 rows, $0.000556 | Returned at 22:32, 24,851 segments, $0.000556 |
| 21:42 | mit 6.100L python lecture | MIT OCW 6.100L lecture 2, 1 h 18 min, 411,084 views, 259 comments | 20 rows, $0.000778 | 1, $0.000556 | 40 rows, $0.000556 | Returned at 22:31, 1,721 segments, $0.000556 |
| 21:48 | khan academy statistics | Khan Academy statistics overview, 1 min 36 s, 33,096 views, 9 comments | 20 rows, $0.000778 | 1, $0.000556 | 9 rows, $0.000556 | Returned at 22:31, 47 segments, $0.000556 |

Each search returned 20 rows. In round one, the cs50 channel had 13 of the 20 results, and 11 of those were lectures of [CS50P](https://cs50.harvard.edu/python/). Two full-course reposts by freeCodeCamp ranked first and third. Result 8 was lecture 1 of [MIT OCW 6.100L](https://ocw.mit.edu/courses/6-100l-introduction-to-cs-and-programming-using-python-fall-2022/). Round two told a different story.

The mitocw channel had only 6 of the 20 results. The other 14 came from one repost channel, each with fewer than 100 views, and most were uploaded on October 28, 2026. So the median view count of those 20 rows was 17. In round three, all 20 results came from the khanacademy channel, uploaded from 2009 to 2020, with a median of about 1.04 million views.

For course research, filter reposts out by `author_username` or `author_id`. If you do not, one course splits its comments across two places, and low-view copies dilute the sample. We list the `author_id` of the official course channel first, keep only videos from those channels, and save the rest in a separate file. For subscriber counts, `youtube/profile` is the capability to use. The catalog lists it, but we did not test it in this run.

Now the comments column. For the Khan Academy video in round three, `youtube/video` reported a `comment_count` of 9. This time `youtube/comments` returned exactly 9 rows. The first two calls returned 40 rows each, all top-level comments.

For a fuller set on a video with many comments, pull once with `popular` and once with `newest`. You can also split by date with `since`. Then remove duplicates by comment `id`.

The 60 search rows are also worth a first sort, because the three rounds look very different. In the cs50 round, the median length is 99 minutes, and 15 of 20 videos run over an hour. The longest runs 24.5 hours. All 20 have comments, 16,375 in total.

In the MIT round, the median is 63.5 minutes and 11 videos run over an hour, but only 6 have comments. The top 3 videos have 90.8% of the views in that round, and most of the rest are the reposts.

In the Khan Academy round, the median is 9.1 minutes, and no video runs over an hour. 18 videos have comments. Views are spread out, and the top 3 have only 40.6%.

| Round | Median length | Over 1 hour | Videos with comments | Total comments | Views in top 3 | Comments per 10,000 views (median) |
| --- | --- | --- | --- | --- | --- | --- |
| cs50 python lecture | 99.0 min | 15 / 20 | 20 | 16,375 | 56.2% | 5.0 |
| mit 6.100L python lecture | 63.5 min | 11 / 20 | 6 | 1,719 | 90.8% | 5.9 |
| khan academy statistics | 9.1 min | 0 / 20 | 18 | 5,750 | 40.6% | 2.1 |

This spread tells you where the money goes further. Transcripts bill per call. On a long course like cs50, one call at $0.000556 gets hours of lecture. On a short Khan video, the same price gets a few hundred words.

Before a batch job, sort the search rows by `duration` and `comment_count`. Skip `youtube/comments` on videos with 0 comments, and skip repost channels as a group. In the MIT round, comments on only the 6 videos that have them would cut 20 comments calls to 6.

The transcript calls returned 503 a few times at first, at no charge, and then succeeded after a retry with `retry_after`. One more call was on purpose: a search with no key returned 401 at $0. All live calls in this article cost $0.007338 in total. That is the sum of the 12 successful calls: 3 x $0.000778 + 9 x $0.000556.

![Screenshot of real EveryInfra responses, three excerpts. The first is youtube/comments at 21:49 Singapore time on 2026-11-13 for the Khan Academy statistics overview video. The first result shows only the id, a hidden author name and the time, count is 9, and a teal box marks charged_usd 0.000556 in billing. The second is a successful youtube/transcript response, at 22:31 Singapore time for the Khan Academy video, showing language and available_languages, and a teal box marks charged_usd 0.000556. The third is a youtube/transcript 503, where error code is unavailable, with a retry_after value, and a teal box marks charged false in billing.](https://everyinfra.com/articles/tikhub-youtube-api-python/img-shot-ei-response.webp)

Raw EveryInfra responses: successful calls are billed by charged_usd, and the call that returned 503 has charged set to false. [Screenshot of real EveryInfra API responses](https://api.everyinfra.com/api/v1/social/catalog)

## Cost per 1,000 rows: which step differs most

With per-call billing, the price is half of the bill. The other half is how many rows each call returns. On our side, we use "charged amount divided by rows returned, times 1,000." Three searches returned 60 rows for $0.002334, which is $0.0389 per 1,000. For comments, we use the two calls with full pages: 80 rows for $0.001112, or $0.0139 per 1,000. With all three calls, it is 89 rows and $0.0187 per 1,000, because the Khan video has only 9 comments. Video details and transcripts return one item per call, so the cost per 1,000 videos is the price times 1,000.

TikHub's [openapi.json](https://api.tikhub.io/openapi.json) and price list do not say how many rows a search page or a comments page returns. So for those two items we compare only the price per request. TikHub's cost per 1,000 rows is $1 divided by the rows per page, and you must take the row count from your own calls.

![Grouped horizontal bar chart of the price per request, with two bars for each of four steps. Search: TikHub $0.001, EveryInfra $0.000778. Video details: TikHub $0.001, EveryInfra $0.000556. Comments, one page: TikHub $0.001, EveryInfra $0.000556. Transcript: TikHub $0.008, EveryInfra $0.000556. EveryInfra bars are teal. The subtitle notes that TikHub also prices a $0.001 caption V2 endpoint that is not in its public docs.](https://everyinfra.com/articles/tikhub-youtube-api-python/fig-02-price-per-call-bar.en.light.svg)

| Item | TikHub per call (list price) | EveryInfra per call (charged) | Price ratio per call | Per 1,000, EveryInfra (charged ÷ rows returned) | Per 1,000, TikHub |
| --- | --- | --- | --- | --- | --- |
| Search results | $0.001 | $0.000778, 20 rows per call this time | 1.3 | $0.0389 (3 calls, 60 rows, $0.002334) | $1 ÷ rows per page (not published) |
| Comments | $0.001 per page | $0.000556, 40 rows in each of two calls | 1.8 | $0.0139 (2 calls, 80 rows, $0.001112) | $1 ÷ rows per page (not published) |
| Video details | $0.001 | $0.000556 | 1.8 | $0.556 | $1.00 |
| Transcripts | $0.008 (V2 $0.001) | $0.000556, 3 calls charged from 22:31 to 22:32 | 14.4 (V2 1.8) | $0.556 | $8.00 (V2 $1.00) |

![Grouped horizontal bar chart of the cost per 1,000 rows. Search results: EveryInfra $0.0389. Comments: EveryInfra $0.0139. TikHub does not publish its page size for these two, so they have no TikHub bar. Video details: TikHub $1, EveryInfra $0.556. Video transcripts: TikHub $8, EveryInfra $0.556. The subtitle says our numbers are charged_usd from live calls on November 13 divided by rows returned, and TikHub numbers are list price times 1,000.](https://everyinfra.com/articles/tikhub-youtube-api-python/fig-03-per1k-bar.en.light.svg)

For search and comments, the cost per 1,000 rows depends on TikHub's page size. By the formula above, a TikHub search page with 26 rows or more costs less per 1,000 than our $0.0389. A comments page with 72 rows ties with ours, and 73 rows or more costs less.

Video details and transcripts have no such variable, because each call returns one item, so the price ratio is the cost ratio. The transcript row has the widest gap: $0.008 against $0.000556, which is 14.4 times. Our side of the transcript row is the charged amount of three successful calls. The TikHub side is a list price.

Both sides bill per call, and the length of the transcript does not change the price. So a longer video costs less per word. Our longest one was the CS50P full course, with 183,775 words for $0.000556.

## Failures, empty results and retries: how each path bills them

With per-call billing, the rule for failures sets the cost of retries. All three paths publish their rules. The official [Quota Calculator](https://developers.google.com/youtube/v3/determine_quota_cost) says that every request, including an invalid one, costs at least one unit. When the quota runs out, the API returns 403 with `quotaExceeded` ([error list](https://developers.google.com/youtube/v3/docs/errors)), and you wait for midnight Pacific Time. TikHub's [FAQ](https://tikhub.io/faq) says that a 200 is billed and a failure is not.

The same page says that repeat requests with identical parameters are each billed. Its own docs say the caption endpoint returns 200 and bills the call when a video has no captions. On our side, failures and empty results are refunded. The response shows `billing.charged` as false and `charged_usd` as 0, as in the 503 in the screenshot above.

| Case | Official Data API | TikHub (per its FAQ and docs) | EveryInfra (billing rules and our responses) |
| --- | --- | --- | --- |
| Invalid request | At least 1 unit | Not charged | Not charged |
| Quota used up, or data not available now | 403 `quotaExceeded`, wait for reset | Not stated | 503 with `retry_after`, not charged |
| Video with no captions | Not applicable | HTTP 200, $0.008 charged | Not charged |
| Same request sent twice | Each costs units | Each is billed | Replay within 5 minutes returns 202, not charged |

Write the retry logic to match the rule. On the official path, a retry after a quota error does not help. The script must count the units it used today and stop early. On the TikHub path, you can retry a network error, but avoid two identical calls, because both are billed. On the EveryInfra path, a 503 body has `retryable` and `retry_after`. Wait that many seconds before you send again, and the failed tries cost nothing.

Our script above only handles 429. To make it stronger, add 503: read `error.retry_after`, sleep, and try two or three times at most. One more detail: if you replay the same request body within 5 minutes, EveryInfra returns 202 with a "replayed" note. It does not charge again, and it does not give new data. For new data, wait past that window or change a parameter.

## Transcripts: the step where the paths differ most

For course feedback, lecture search and content audits, you need the transcript. A comment says "I got lost at 25:30." To act on it, you open the transcript and read what the speaker said at 25:30. The official API cannot read transcripts of other people's videos, as shown above. The Python community often uses the open-source [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api), which reads captions from the web page.

Version 1.2.5 came out on November 5, 2026 ([PyPI](https://pypi.org/project/youtube-transcript-api/)). Its README has a section that says YouTube has started to block most IP addresses of cloud providers. Code deployed to a cloud server will likely hit `RequestBlocked` or `IpBlocked`. [yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/tag/2026.10.26) can also download caption files, and release 2026.10.26 from October 26 is the latest stable one. Both tools are free and open source, but you manage their stability and IP addresses yourself.

TikHub's caption endpoint costs $0.008 per call and bills videos with no captions. Long videos turn into async jobs that you poll. Its price list also has `get_video_captions_v2` at $0.001 per call, but openapi.json has no parameter docs for it. EveryInfra's `youtube/transcript` costs $0.000556 per call. It returns `text` (full text), `segments` (parts with start and end times), `language` and `available_languages`, and a failure costs nothing.

The three successful calls returned very different amounts of data. The CS50P full course runs 15 hours and 57 minutes. One call returned 24,851 segments and 183,775 English words, and `available_languages` listed only auto-generated English. MIT 6.100L lecture 2 runs 1 hour and 18 minutes. It returned 1,721 segments and 12,593 words. Its languages were uploaded English captions, uploaded Spanish captions and auto-generated English.

The MIT text starts with sound tags such as "[SQUEAKING]" and "[RUSTLING]", which are typical of uploaded captions. The Khan Academy overview runs 1 minute and 36 seconds. It returned 47 segments and 318 words, also in auto-generated English only. Each segment has three fields: `start`, `duration` and `text`.

The segments of auto-generated captions overlap in time. For example, the first CS50P segment starts at 0.16 seconds and lasts 4.6 seconds, but the second one starts at 2.44 seconds. So when you match comments to segments, use `start` only. Do not treat `start + duration` as the end of a segment.

How much the segments overlap depends on the caption source. We compared every pair of neighbor segments in the three transcripts. CS50P and Khan Academy have only auto-generated captions. In CS50P, 24,807 of 24,850 pairs overlap (99.8%), and all 46 pairs in the Khan video overlap. The MIT text carries sound tags of uploaded captions, and only 204 of its 1,720 pairs overlap (11.9%).

So in auto-generated captions a "segment" works like a sliding window, and in uploaded captions it is close to one sentence. A count of segments as "sentences the lecturer said" only makes sense for uploaded captions. For auto captions, count words or cut by time.

The length of a transcript also sets the cost of the next steps. We computed the speaking rate as words divided by the end time of the last segment. The CS50P course runs 957.7 minutes at 191.9 words a minute. MIT lecture 2 runs 78.9 minutes at 159.7 words a minute. The Khan video runs 1.6 minutes at 198.5 words a minute. The full CS50P `text` has 947,499 characters, so cut it by lecture or chapter before you give it to an AI tool for a summary.

Both paths bill per call, not per length, so the cost per 1,000 English words differs a lot:

| Video | English words | EveryInfra per 1,000 words ($0.000556 ÷ words x 1,000) | TikHub `get_video_captions` per 1,000 words ($0.008 ÷ words x 1,000) |
| --- | --- | --- | --- |
| CS50P full course | 183,775 | $0.0000030 | $0.0000435 |
| MIT 6.100L lecture 2 | 12,593 | $0.0000442 | $0.000635 |
| Khan Academy statistics overview | 318 | $0.00175 | $0.0252 |

Comments and transcripts also differ a lot in size. The 40 comments that the CS50P video returned have 4,047 words in total, with a median of 34 words per comment. The transcript of the same video has 183,775 words, which is 45 times as much. The 40 comments on MIT lecture 2 have 1,743 words, with a median of 20. Its transcript has 12,593 words, about 7 times as much. The 9 Khan comments have 117 words, with a median of 9, and the transcript has 318 words, less than 3 times as much.

For long courses, most of the analysis cost is on the transcript side. Use the timestamps in comments to find the parts that people mention again and again. Then give only those parts of the transcript to the model. That costs much less than the full text of the course, and a person can check it more easily. For short videos, both texts are short, so you can read them together.

| Video | Length | Segments | English words | Caption tracks | Charged |
| --- | --- | --- | --- | --- | --- |
| CS50P full course (freeCodeCamp) | 15:57:48 | 24,851 | 183,775 | Auto English | $0.000556 |
| MIT 6.100L lecture 2 | 1:18:58 | 1,721 | 12,593 | Uploaded English, uploaded Spanish, auto English | $0.000556 |
| Khan Academy statistics overview | 1:36 | 47 | 318 | Auto English | $0.000556 |

| How you get transcripts | Cost per call | Other people's videos | Video with no captions | What you handle yourself |
| --- | --- | --- | --- | --- |
| Official `captions.download` | 200 quota units | No, needs edit permission | Not applicable | OAuth and owner consent |
| youtube-transcript-api or yt-dlp | $0 | Yes | Raises an exception | IP blocks, proxies, version updates |
| TikHub `get_video_captions` | $0.008 | Yes | HTTP 200, billed as usual | Async polling for long videos |
| EveryInfra `youtube/transcript` | $0.000556 | Yes | No charge on failure | Retry with `retry_after` on a 503 |

## Cross-domain example: audience feedback on public lectures from comments and transcripts

Education researchers already use YouTube comments as learner feedback. Chalkias and colleagues published a study in Electronics in 2023. They pulled 167,987 comments from educational channels with the YouTube Data API and Google Sheets. They ran sentiment analysis with two lexicon methods, VADER and TextBlob, and topic clustering with LDA. Neutral comments were the largest group, then positive, and negative was the smallest.

Comments often mentioned video features such as animation, music and the message of the video ([Learning Analytics on YouTube Educational Videos](https://doi.org/10.3390/electronics12183949)). The study pulled comments only.

A transcript adds one more step. The comments that contain a timestamp can be matched to the words the speaker said at that point. Our three rounds of comments show this well. Of the 40 comments on the CS50P full course, 10 had timestamps. But 8 of the 10 were chapter lists or study logs that viewers wrote, such as "Day 2 - Completed till 1:20:00." Few of them pointed to a specific question.

Of the 40 comments on MIT 6.100L lecture 2, 4 had timestamps. Three of those pointed to the part between 16:55 and 25:43 about string slicing. One viewer added the expression `s[0:5][::-1]` at 25:30.

The transcript gives these comments their context. Near 25:30, a student in the room asks a question. To include the letter A, should the second value be -1? The lecturer says that -1 points to the other end, and that she would have to try it out.

She does not give the syntax at that point. The comments at 25:30 and 25:43 give that answer. One shows `s[0:5][::-1]`, and the other suggests an empty colon or -12.

The comment at 16:55 matches the part near 16:40 about negative indexes and the out-of-range error. The comment "Skip --> 4:53" matches too, because near 4:50 the lecturer moves on to a new object type, the string.

| Comment time | What the comment says (summary) | What the transcript says near that time |
| --- | --- | --- |
| 4:53 | Skip to the part about strings | Near 4:50, the lecturer starts the new object type, the string |
| 16:55 | Explains the direction of `s[0]` and `s[-1]` | Near 16:40, negative indexes and the out-of-range error |
| 25:30 | Gives `s[0:5][::-1]` | Near 25:25, a student asks how to include A, and the lecturer would have to try it |
| 25:43 | Empty colon or -12 | The same question |

![Bar chart of English words per minute in the transcript of MIT 6.100L lecture 2, minutes 0 to 77. Bars range from 89 to 205 words a minute, with a mean of 159. Four teal vertical lines mark the times named in comments: 4:53, 16:55, 25:30 and 25:43. The last three fall in minutes 16 to 26, where the lecture covers string indexing and slicing.](https://everyinfra.com/articles/tikhub-youtube-api-python/fig-05-mit-comments-on-transcript.en.light.svg)

The chart cuts the MIT transcript into minutes, from 89 to 205 words each, and marks the four comment timestamps on it. The lecturer has no clear pause in the 78.9 minutes, and the comment times are not at unusually fast or slow parts. The chart does show location. 3 of the 4 comments fall in minutes 16 to 26, the part about string indexes and slicing.

Four timestamped comments are a small sample, so this chart shows a method, not a result. On a course with hundreds of timestamped comments, a count per minute shows which parts come up again and again. In the CS50P set, 8 of the 10 timestamped comments were chapter lists or study logs. So filter out comments that list many timestamps before you count.

The steps below describe the method only and use no personal data. First, list all lectures of a course with `youtube/user_posts` on the channel URL, with `sort` set to `newest`, `oldest` or `popular`. The catalog lists this capability, but we did not test it in this run. Or search the course name with `youtube/search`, which we did test, and drop repost channels.

Second, call `youtube/video` once per lecture and save views, likes and the comment count as the base numbers. Third, call `youtube/comments` per lecture. For videos with many comments, pull `popular` and `newest` separately, and remove duplicates by comment `id`.

Fourth, call `youtube/transcript` per lecture and keep the start and end times of `segments`. Fifth, extract timestamps from comments with a regular expression and place them on transcript segments. Run sentiment and topic analysis on the comments without timestamps. Sixth, have a person spot-check the result. Automatic captions have errors, and comments can be sarcastic. In the report, hide author names and use only the channel and lecture number.

Archive each raw response with its `billing.charged_usd`. Compute the cost as charged amount divided by rows returned. Then others can check it from the same files.

| One 12-lecture public course | Requests | TikHub (list price) | EveryInfra (catalog price) | Official API |
| --- | --- | --- | --- | --- |
| Search the course name once | 1 | $0.001 | $0.000778 | 1 search call |
| Video details, 12 calls | 12 | $0.012 | $0.006672 | 12 units (or 1 unit in one batch) |
| Comments, 1 call per lecture | 12 | $0.012 | $0.006672 | 12 units or more |
| Transcripts, 1 call per lecture | 12 | $0.096 (V2 $0.012) | $0.006672 | Not available |
| Total | 37 | $0.121 (V2 $0.037) | $0.020794 | 24 units plus 1 search, no transcripts |

![Horizontal bar chart of what it costs to pull video details, comments and transcripts for one 12-lecture course. TikHub with get_video_captions totals $0.121, TikHub with get_video_captions_v2 totals $0.037, and EveryInfra totals $0.0208, with the EveryInfra bar in teal. The subtitle says this is 37 requests in total, and the official API uses 1 search call plus 24 quota units at $0 but cannot get transcripts of other people's videos.](https://everyinfra.com/articles/tikhub-youtube-api-python/fig-04-course-cost-bar.en.light.svg)

This bill has two conditions. First, it pulls comments once per lecture. A course with many comments needs more calls, and the cost rises on all three paths. Second, TikHub Captions V2 is not in the public docs, so its $0.037 total is only a price list number.

For a whole course library, multiply by the number of courses. For 100 courses of 12 lectures each, TikHub list prices total about $12.10 ($3.70 with Captions V2), and ours total about $2.08. The transcript step alone is $9.60 on TikHub and $0.67 on our side, which is most of the gap.

At that size, the official API still costs only quota. Video details and comments for 100 courses take 2,400 units, which fits in one day. But it gets none of the 1,200 transcripts.

## A month of tracking: new comments on 30 lectures every day

Take a teaching team that tracks 30 lecture videos. Each day it pulls comments and statistics once. It pulls each transcript once at the start. A month has 30 days.

| Monthly job | Calls | Official Data API | TikHub (list price) | EveryInfra (catalog price) |
| --- | --- | --- | --- | --- |
| Comments, once a day per lecture | 900 | 900 units, 30 a day | $0.90 | $0.5004 |
| Statistics for 30 lectures, once a day | 900 (official: 30 IDs in one call) | 30 units, 1 a day | $0.90 | $0.5004 |
| Transcripts, once per lecture at the start | 30 | Not available | $0.24 (V2 $0.03) | $0.01668 |
| Total | 1,830 | 930 units, $0, no transcripts | $2.04 | $1.01748 |

The official path uses 31 units a day, far below 10,000. It gives comment text, exact times and likes, and only the transcripts are missing. So for "watch new comments on known videos every day," we recommend the official API. EveryInfra and TikHub fit the parts that the official API does not give. Those are transcripts of other people's videos and large one-time searches without an audit.

They also fit teams that do not want to run a Google Cloud project and OAuth. Search above 100 calls a day changes the picture. For example, 50 keywords times two pages a day, to find new course uploads, needs more official quota. Then the two per-call paths can be compared on price. At 100 searches a day, a month is 3,000 calls. That is $3.00 on TikHub `search_video` and $2.334 on our `youtube/search`.

## When the official API or TikHub fits better

The official YouTube Data API is a better fit than either paid API in three cases. First, you only need comments and statistics, within 10,000 units a day. A ceiling of 1,000,000 top-level comments a day covers most course research, and it is free. Second, you analyze videos on your own channel. As the channel owner, you can get captions and YouTube Analytics, which gives the most complete data.

Third, your app serves users for a long time and needs formal approval from Google. Go through the audit under the [Developer Policies](https://developers.google.com/youtube/terms/developer-policies) and the [Required Minimum Functionality](https://developers.google.com/youtube/terms/required-minimum-functionality). Also, on June 3, 2026, Google added [videos.batchGetStats](https://developers.google.com/youtube/v3/docs/videos/batchGetStats). It has its own bucket of 10,000 units a day, so bulk statistics cost less quota.

TikHub fits better than us in these cases. It has 48 YouTube endpoints, and we have 8 YouTube capabilities: `youtube/search`, `youtube/profile`, `youtube/user_posts`, `youtube/video`, `youtube/comments`, `youtube/followers`, `youtube/transcript` and `youtube/shorts`. TikHub has several things that our catalog does not. It has a separate replies endpoint, channel community posts and their comments, related videos and trending videos. It also has search suggestions, stream and download URLs, and channel email.

For those, public material points to an API like TikHub's. Its General Search V2 (`get_general_search_v2`, $0.002 per call) filters by `upload_date`, `duration` and `features` such as subtitles, 4K and live. Our `youtube/search` has one optional parameter, `sort`. Last, TikHub does not publish its page size for search and comments. If a search page returns 26 rows or more, or a comments page 73 rows or more, TikHub costs less per 1,000 rows. Check the rows that your own calls return.

## Pick a path by the data you need

This table sums up the sections above by "what you want to get." Each row gives only reasons that we checked. Prices are list or catalog prices on November 13, 2026.

| Data you need | First choice | Reason | Second choice |
| --- | --- | --- | --- |
| Comments on known videos, every day | Official Data API | 1 unit per page, exact times and likes, free | EveryInfra `youtube/comments` |
| Statistics for known videos | Official `videos.list` or `videos.batchGetStats` | 50 IDs per call, 1 unit | EveryInfra `youtube/video` |
| More than 100 keyword searches a day | EveryInfra `youtube/search` | Outside the official search bucket, $0.000778 per call, 20 rows in our test | TikHub `search_video` at $0.001 |
| Search with upload date, length or 4K filters | TikHub `get_general_search_v2` | We have only `sort` as an optional parameter | Official `search.list` filters |
| Transcripts of other people's videos | EveryInfra `youtube/transcript` | $0.000556, no charge on failure | TikHub `get_video_captions` at $0.008 |
| Community posts, related videos, stream URLs | TikHub | Our catalog does not have them | None |
| Shorts list of a channel | EveryInfra `youtube/shorts` or TikHub `get_channel_shorts` | Both bill per call; both are listed, but we did not test either in this run | Official `playlistItems.list` |

Count the cost of upkeep when you choose. The official path needs a Google Cloud project, quota planning and audits.

TikHub and EveryInfra need a balance. For a teaching team of three to five people, the second is simpler. For a team that ships a product to the public for years, the first is safer.

## Limits: where these results do not hold

This test has five limits, and the results may not hold outside them. First, the sample is small. All three live rounds ran within one hour on the evening of November 13, 2026. Each course had one video and one comments call. Those calls returned 40, 40 and 9 rows, and the comments cost of $0.0139 per 1,000 uses the 80 rows of the first two. The engagement rates and the comment-to-transcript match come from these three videos only, so treat them as examples of the method.

Second, every TikHub number is a list price. We did not call its endpoints. TikHub does not publish its page size for search and comments. So for those two, we compared only the price per call and gave no TikHub cost per 1,000 rows. Third, prices change. TikHub's list gained 12 rows in two weeks, and our catalog prices can change too.

We read both again before we publish. Fourth, the official quota page says the default quota is subject to change. Audited projects get other quotas. The 5,000 and 1,000,000 figures are ceilings under the default quota only. Fifth, the comment-to-transcript section uses only 4 timestamped comments from one MIT lecture, and most of the 10 in CS50P were chapter lists. A claim about where comments cluster needs hundreds of timestamped comments, so this article only shows the method.

Research ethics set limits too. Education research on comments should hide author names and report only totals. Minors can appear in the comments of educational videos. The [Developer Policies](https://developers.google.com/youtube/terms/developer-policies) set a clear 30-day rule for stored data.

Keep and delete public data from a third-party data API with the same care. We do not give legal advice on any specific project. If your work needs an ethics review, follow the rules of your institution.

## Recent changes: 7 updates that matter for YouTube data in Python

| Date | Change | What it means for your script |
| --- | --- | --- |
| 2026-11-13 | [TikHub list](https://api.tikhub.io/api/v1/tikhub/user/get_all_endpoints_info) at 1,482 rows | Read prices again before use |
| 2026-11-10 | [google-api-python-client 2.202.0](https://github.com/googleapis/google-api-python-client/releases) | Read the notes when you upgrade |
| 2026-11-05 | [youtube-transcript-api 1.2.5](https://github.com/jdepoix/youtube-transcript-api/releases) | Cloud IP blocks still apply |
| 2026-10-26 | [yt-dlp 2026.10.26](https://github.com/yt-dlp/yt-dlp/releases/tag/2026.10.26) | Open-source caption download tool; keep it updated |
| 2026-09-30 | [`snippet.imageUrl`](https://developers.google.com/youtube/v3/docs/comments/list) on comments | Some comments have only an image |
| 2026-06-03 | [videos.batchGetStats](https://developers.google.com/youtube/v3/docs/videos/batchGetStats) added | Bulk statistics have their own quota bucket |
| 2026-06-01 | [search.list counted separately](https://developers.google.com/youtube/v3/revision_history) | Search no longer uses the 10,000 units |

TikHub's price list went from 1,470 rows on November 1 to 1,481 on November 11 and 1,482 on November 13. It keeps adding endpoints, so we read the YouTube prices in this article again before we publish.

On November 10, 2026, google-api-python-client released 2.202.0 ([releases](https://github.com/googleapis/google-api-python-client/releases)). If you use the official path, read the release notes for changes to the YouTube discovery document when you upgrade.

On November 5, 2026, youtube-transcript-api released 1.2.5 ([releases](https://github.com/jdepoix/youtube-transcript-api/releases)). On October 26, 2026, yt-dlp released [2026.10.26](https://github.com/yt-dlp/yt-dlp/releases/tag/2026.10.26). Both read captions from the web page, so a YouTube page change usually means you wait for their next release.

On September 30, 2026, the [comments resource](https://developers.google.com/youtube/v3/docs/comments/list) added `snippet.imageUrl`, so a comment can carry an image or an animated GIF. The docs say all users get it in November. For comment text analysis, plan for comments that have only an image and no text.

The search bucket of June 1 ([revision history](https://developers.google.com/youtube/v3/revision_history)) and [videos.batchGetStats](https://developers.google.com/youtube/v3/docs/videos/batchGetStats) of June 3 are already in the daily ceilings above. Check any quota constants in your scripts against these two changes.

## Get started: run the script above in five minutes

First, create an API key in the [EveryInfra console](/en/docs#quickstart). Star two GitHub repositories to get $1 of trial credit, valid for 24 hours. That is enough for hundreds of runs of this script. Second, run `pip install requests` and put the key in the `EVERYINFRA_API_KEY` environment variable. Third, read the capabilities and fields on the [YouTube data API page](/en/youtube-api).

The [search](/en/youtube-api/search), [comments](/en/youtube-api/comments), [transcript](/en/youtube-api/transcript) and [video details](/en/youtube-api/video) pages list the allowed values of each parameter and have a playground. Fourth, run `python3 yt_chain.py "your course name" out` and look at the rows and `charged_usd` that each step prints. Fifth, to call it from an AI tool such as Claude or Cursor, use the [remote MCP](/en/mcp-server) with the same key. The same API also covers [TikTok](/en/tiktok-api) and other platforms, and prices are on the [pricing page](/en/pricing) and the [market page](/en/market).

## FAQ

### Where do I get a tikhub youtube api key, and can I try it for free?

This question comes from the Google search suggestion "tikhub youtube api key," read on November 13, 2026. TikHub's [pricing page](https://tikhub.io/pricing) says that new accounts get $0.05 of free credit. But only 6 of the 48 YouTube endpoints in its price list accept that credit, and search, comments and captions are not among them. To try those, top up at least $5 first. You create an EveryInfra key in the console, and the $1 from GitHub stars works on `youtube/*` directly.

### What do I do when I see youtube data api quota exceeded?

This question comes from the suggestion "youtube data api quota exceeded." First, find the bucket that is full. Since June 1, 2026, search has its own count of 100 calls a day, and when it fills, only `search.list` stops. Comments and video details share 10,000 units. Quotas reset at midnight Pacific Time ([Quota Calculator](https://developers.google.com/youtube/v3/determine_quota_cost)). If you need more for a long time, use the [quota extension form](https://support.google.com/youtube/contact/yt_api_form). An invalid request also costs at least one unit, so validate parameters before you send.

### How many comments can the youtube data api free quota give per day?

This question comes from the suggestion "youtube data api free quota." `commentThreads.list` returns up to 100 rows per page at 1 unit per page. If all 10,000 units go to comments, the ceiling is 1,000,000 top-level comments. Replies need `comments.list` calls at 1 unit per page as well. Small videos do not fill a page of 100, so the real number is much lower.

### Can youtube transcript api python tools get transcripts of other people's videos?

This question comes from the suggestion "youtube transcript api python." The official `captions.download` needs edit permission on the video, so it cannot. The open-source youtube-transcript-api reads captions from the web page for free, but calls from cloud servers often get blocked. TikHub `get_video_captions` costs $0.008 per call and bills videos with no captions. EveryInfra `youtube/transcript` costs $0.000556 per call, and failures cost nothing.

### Can I use endpoints that are missing from the tikhub youtube api documentation?

This question comes from the suggestion "tikhub youtube api documentation." The November 13 price list has 48 YouTube endpoints, and openapi.json documents only 34. Fourteen, including `get_video_captions_v2` at $0.001 and `get_channel_email` at $0.03, have a price but no public parameter docs. Ask TikHub whether you can use them and how.

## References

1. [Quota Calculator](https://developers.google.com/youtube/v3/determine_quota_cost), Google for Developers, read 2026-11-13.
1. [Search: list](https://developers.google.com/youtube/v3/docs/search/list), Google for Developers, read 2026-11-13.
1. [CommentThreads: list](https://developers.google.com/youtube/v3/docs/commentThreads/list), Google for Developers, read 2026-11-13.
1. [Comments: list](https://developers.google.com/youtube/v3/docs/comments/list), Google for Developers, read 2026-11-13.
1. [Captions: list](https://developers.google.com/youtube/v3/docs/captions/list), Google for Developers, read 2026-11-13.
1. [Captions: download](https://developers.google.com/youtube/v3/docs/captions/download), Google for Developers, read 2026-11-13.
1. [Videos: list](https://developers.google.com/youtube/v3/docs/videos/list), Google for Developers, read 2026-11-13.
1. [YouTube Data API Revision History](https://developers.google.com/youtube/v3/revision_history), Google for Developers, latest entry 2026-11-03.
1. [Implementation: Pagination](https://developers.google.com/youtube/v3/guides/implementation/pagination), Google for Developers, read 2026-11-13.
1. [Python Quickstart](https://developers.google.com/youtube/v3/quickstart/python), Google for Developers, read 2026-11-13.
1. [Quota and Compliance Audits](https://developers.google.com/youtube/v3/guides/quota_and_compliance_audits), Google for Developers, read 2026-11-13.
1. [YouTube API Services quota extension form](https://support.google.com/youtube/contact/yt_api_form), YouTube Help, read 2026-11-13.
1. [YouTube API Services Developer Policies](https://developers.google.com/youtube/terms/developer-policies), Google for Developers, read 2026-11-13.
1. [Required Minimum Functionality](https://developers.google.com/youtube/terms/required-minimum-functionality), Google for Developers, read 2026-11-13.
1. [Videos: batchGetStats](https://developers.google.com/youtube/v3/docs/videos/batchGetStats), Google for Developers, added 2026-06-03.
1. [Manage API keys](https://cloud.google.com/docs/authentication/api-keys), Google Cloud, read 2026-11-13.
1. [Use automatic captioning](https://support.google.com/youtube/answer/6373554), YouTube Help, read 2026-11-13.
1. [google-api-python-client](https://github.com/googleapis/google-api-python-client), Google APIs on GitHub, read 2026-11-13.
1. [google-api-python-client on PyPI](https://pypi.org/project/google-api-python-client/), PyPI, 2.202.0, 2026-11-10.
1. [google-api-python-client releases](https://github.com/googleapis/google-api-python-client/releases), GitHub, 2026-11-10.
1. [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api), GitHub, read 2026-11-13.
1. [youtube-transcript-api on PyPI](https://pypi.org/project/youtube-transcript-api/), PyPI, 1.2.5, 2026-11-05.
1. [youtube-transcript-api releases](https://github.com/jdepoix/youtube-transcript-api/releases), GitHub, 2026-11-05.
1. [yt-dlp 2026.10.26](https://github.com/yt-dlp/yt-dlp/releases/tag/2026.10.26), GitHub, 2026-10-26.
1. [requests on PyPI](https://pypi.org/project/requests/), PyPI, 2.34.2, 2026-05-14.
1. [os, miscellaneous operating system interfaces](https://docs.python.org/3/library/os.html), Python docs, read 2026-11-13.
1. [zoneinfo, IANA time zone support](https://docs.python.org/3/library/zoneinfo.html), Python docs, read 2026-11-13.
1. [TikHub public price endpoint](https://api.tikhub.io/api/v1/tikhub/user/get_all_endpoints_info), TikHub, read 21:32 Singapore time on 2026-11-13, 1,482 rows.
1. [TikHub openapi.json](https://api.tikhub.io/openapi.json), TikHub, V5.3.2, read 2026-11-13.
1. [TikHub Pricing](https://tikhub.io/pricing), TikHub, read 2026-11-13.
1. [TikHub FAQ](https://tikhub.io/faq), TikHub, read 2026-11-13.
1. [TikHub YouTube API](https://tikhub.io/youtube-api), TikHub, read 2026-11-13.
1. [TikHub MCP](https://tikhub.io/mcp), TikHub, read 2026-11-13.
1. [tikhub on PyPI](https://pypi.org/project/tikhub/), PyPI, 2.2.0, 2026-10-03.
1. [EveryInfra capability catalog](https://api.everyinfra.com/api/v1/social/catalog), EveryInfra, read 21:31 Singapore time on 2026-11-13.
1. [Learning Analytics on YouTube Educational Videos](https://doi.org/10.3390/electronics12183949), Chalkias et al., Electronics, 2023-09-19.
1. [CS50's Introduction to Programming with Python](https://cs50.harvard.edu/python/), Harvard University, read 2026-11-13.
1. [MIT 6.100L Introduction to CS and Programming Using Python](https://ocw.mit.edu/courses/6-100l-introduction-to-cs-and-programming-using-python-fall-2022/), MIT OpenCourseWare, read 2026-11-13.
1. [Comments resource](https://developers.google.com/youtube/v3/docs/comments), Google for Developers, read 2026-11-13.
1. [CommentThreads resource](https://developers.google.com/youtube/v3/docs/commentThreads), Google for Developers, read 2026-11-13.
1. [YouTube Data API Errors](https://developers.google.com/youtube/v3/docs/errors), Google for Developers, read 2026-11-13.
