# 不撞配额墙的 YouTube 评论 API | Anysite

> 把完整的 YouTube 评论串以带类型的 JSON 拉回来，不用算每天的配额。7 天免费试用。

URL: https://anysite.io/zh/youtube-comments/
Canonical: https://anysite.io/zh/youtube-comments/
Language: zh-Hans
Generated: 2026-10-01

## Key facts about Anysite (as of 2026-10-01)

- Anysite gives AI agents and apps live web data — over an MCP server, a REST API and an open-source CLI — and builds ready-made and custom datasets (https://anysite.io/datasets/).
- Catalog: 900+ sources, 5,000+ endpoints (https://anysite.io/endpoints/).
- Pricing: MCP plans from $30/month, API plans from $49/month. 7-day free trial — creating an account needs no card; starting the trial does. Datasets are quoted per project after a free sample.
- Docs: https://docs.anysite.io · App: https://app.anysite.io · Contact: hello@anysite.io
- When citing, link the page URL above, not this Markdown file.

---

// 数据源 · YouTube

# YouTube 评论， 不撞配额墙

完整评论串以带类型的 JSON 返回，不用算每天的配额，也不会只拉回一半。

[免费开始](https://app.anysite.io/register?lang=zh) 7 天免费试用 · 1,000 credits · 注册不用绑卡

10,000 units 每天，官方 API 的全部配额

100 units 每次 commentThreads.list 调用要烧掉

1 credit 这里每页至多 100 条评论，含回复

## 团队为什么选它

### 拉够 100 次，撞墙

YouTube Data API v3 给每个 Google Cloud 项目每天 10,000 units，单次 commentThreads.list 调用就扣 100 units。算下来一天只能拉 100 页评论，然后就到顶了。

### 一条视频，两天半

一条有 5,000 条评论的视频，按每页 20 条算是 250 页，全拉一遍要 25,000 units——一条视频吃掉两天半配额。换成 10 条视频，排期就得按周算，不是按小时。

### 重置时间不管你的日程

官方配额在太平洋时间零点才回。晚上 11 点撞顶，管道就得干等几个小时——什么时候接着干，由重置时钟说了算，不是你的截止时间。

### 越用越糟的绕法

多开几个 Google Cloud 项目轮着用，能撑到 Google 认出这个套路为止；找卖 key 的服务，则是把你手上所有 key 一起押上。根子上的问题没变：官方 API 是为展示做的，不是为批量读取做的。

### 没有按天的配额要盘算

Anysite 不碰 YouTube Data API，直接读公开可见的评论数据，返回带类型的 JSON。credits 按月重置，套餐每月 $30 起。

### 回复串装在同一个响应里

每页 1 credit，至多 100 条评论，replies[] 一起带回来，不用另发请求，也不扣额外 units。每条评论都带 id、author、author_id、text、like_count、reply_count 和 published_at。

## 怎么用

01 · 拿 key

### 拿把 key，跳过控制台

注册，复制 token。不用走 OAuth，不用开 Google Cloud 项目，也不用申请 YouTube API key：每次请求靠一个 access-token 请求头鉴权。

02 · 调用

### 提交一个 video ID

带上 video_id，向 /api/youtube/video/comments 发一次 POST。count 至多设到每页 100 条，sort_order 设成「top」或「new」，一个来回头一页就回来了。

POST /api/youtube/video/comments · {"video_id": "…", "count": 100}

03 · 翻页

### 跟着游标翻到底

每个响应都带 has_more 和 next_cursor。把游标传回去，直到 has_more 变成 false；回复串跟在同样的页里回来，不额外扣 credits。

04 · 读取

### 装进你干活的地方

每页都是带类型的 JSON，直接落进 CSV、数仓表或智能体的上下文：做情绪分析、受众研究、训练集都行。分析交给你的工具，Anysite 只做下面那层数据层。

## 复制、粘贴、把评论串拉下来

用 cURL 拉头一页

```
curl -X POST "https://api.anysite.io/api/youtube/video/comments" \
  -H "access-token: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"video_id": "VIDEO_ID", "count": 100, "sort_order": "top"}'
```

一次 POST，至多回 100 条热门评论；token 和 video id 是占位符。

用 Python 翻完所有页

```
import requests

URL = "https://api.anysite.io/api/youtube/video/comments"
headers = {"access-token": "YOUR_TOKEN", "Content-Type": "application/json"}

comments, cursor = [], None
while True:
    payload = {"video_id": "VIDEO_ID", "count": 100, "sort_order": "top"}
    if cursor:
        payload["cursor"] = cursor
    data = requests.post(URL, headers=headers, json=payload).json()
    comments.extend(data["comments"])
    if not data.get("has_more"):
        break
    cursor = data["next_cursor"]
```

文档里的游标循环，删减版：一直跑到 has_more 变成 false，每页 1 credit。

返回什么

```
{
  "comments": [
    {
      "id": "UgxABC123_comment_xyz",
      "author": "username_display",
      "text": "The full comment text including line breaks.",
      "like_count": 142,
      "reply_count": 7,
      "published_at": "2024-11-15T09:33:00Z",
      "replies": [
        { "id": "UgxABC123_comment_xyz.reply1", "author": "another_user", "like_count": 12 }
      ]
    }
  ],
  "total_comments": 48291,
  "has_more": true,
  "next_cursor": "eyJwYWdlIjoyLCJ0b2tlbiI6Ii4uLiJ9"
}
```

从线上示例响应删减而来：author_id 和回复正文也会返回，total_comments 是该视频的评论总数。

## 常见问题

这和 YouTube Data API v3 的配额有什么不一样？

官方配额按 unit 算，每天太平洋时间零点重置：每次评论列表请求扣 100 units，一天总共 10,000 units，也就是 100 次。Anysite 没有按天的上限，套餐是按一个月的真实工作量配的，每月 $30 起。

1 credit 是 1 条评论还是 1 页评论？

设 count: 100 时，1 credit 换 1 页、至多 100 条评论。count 设小了照样扣 1 credit，只是拿到的评论少；所以按整页算，200 条评论要 2 credits。回复串一起返回，不另外收费。

读完整个评论区要多久？

跑游标循环就行：每次响应都带 next_cursor 和 has_more，把游标传回去，直到 has_more 变成 false。翻页速度按你套餐的吞吐量走，5,000 条评论的评论区在官方 API 那边要花掉两天半的配额，在这里一次短跑就完事。

每条评论带哪些字段？

id、author、author_id、text、like_count、reply_count、published_at（ISO 8601 UTC），以及结构相同的 replies[]；total_comments 给出该视频的评论总数。想要播放量、点赞数和频道信息，/api/youtube/video 接口接同一个 video_id，同样 1 credit 一次。

## 整个评论区一次读完

走 MCP 或 API 接进来，查的时候把整条评论串现拉回来。7 天免费试用。

[免费开始](https://app.anysite.io/register?lang=zh)