YouTube Comments API
Get the top or newest comments of a video as JSON, with likes, reply counts, and pinned and creator-hearted flags.
- 100 free credits
- No card needed
- No Google Cloud project or OAuth
curl "https://pipefetch.com/v1/youtube/comments?video=jNQXAC9IVRw&limit=20" \
-H "x-api-key: YOUR_API_KEY"const res = await fetch('https://pipefetch.com/v1/youtube/comments?video=jNQXAC9IVRw&limit=20', {
headers: { 'x-api-key': process.env.PIPEFETCH_API_KEY },
});
const { data, credits } = await res.json();import os, requests
res = requests.get(
"https://pipefetch.com/v1/youtube/comments",
params={"video": "jNQXAC9IVRw", "limit": 20},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
)
data = res.json()["data"]What you get
- Up to 100 top-level comments per request, top or newest first
- Text, like count and reply count for each
- Pinned and hearted-by-creator flags
- The author's public name, channel and whether it is the video's owner
- The video's total comment count
{
"data": {
"videoId": "jNQXAC9IVRw",
"totalComments": 10000000,
"comments": [
{
"id": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
"text": "We're so honored that the first ever YouTube video was filmed here!",
"likeCount": 4800000,
"replyCount": 986,
"publishedText": "6 years ago",
"isPinned": true,
"isHeartedByCreator": true,
"author": {
"name": "@SanDiegoZoo",
"channelId": "UCC5NfQ6Mf0dq_eEwv4P_hWA",
"channelUrl": "https://www.youtube.com/channel/UCC5NfQ6Mf0dq_eEwv4P_hWA",
"avatarUrl": "https://yt3.ggpht.com/i8RqA9tYqbbnOi4mlnYEY7IR3kXAoDqQbM_5Sfzw7OjTubiGsOaTdlrIZmj-I0q0Vup68eqs=s88-c-k-c0x00ffffff-no-rj",
"isVerified": true,
"isChannelOwner": false
}
}
]
},
"credits": {
"used": 1,
"remaining": 99
}
}One GET request
Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.
GET/v1/youtube/comments
Costs 1 credit per 20 items requested. Only requests that return data are charged.
Parameters
| Name | Type | Description |
|---|---|---|
videorequired |
string | Video URL or 11-character video id. Watch, youtu.be, Shorts, embed and live links all work. |
limitoptional |
integer | How many comments to return. Every started 20 comments cost 1 credit. Default: 20. From 1 to 100. |
sortoptional |
string | Top comments first, or newest first. One of: top, newest. Default: top. |
Good to know
- Top-level comments only; replyCount tells you how many replies each one has.
- A video with comments turned off answers 404 comments_disabled and costs nothing.
What people build with it
Sentiment analysis
Measure how an audience reacts to a video, a product or a launch.
Audience research
Find the questions and objections people raise under videos in your market.
Community monitoring
Read the newest comments on your own or a competitor's videos as they come in.
Buy credits once. Use them whenever.
This endpoint costs 1 credit per 20 items requested, and a request that returns no data costs nothing. Move the slider to see what your volume costs.
One credit is one request that returns data. Requests that return nothing are free.
- $2.42 per 1,000 requests
- About $12.08 a month at this pace
- Lasts about 2.4 months at this pace
- Credits never expire
Questions and answers
Are replies included?
Not yet. You get top-level comments, and replyCount tells you how many replies each one has.
What does a request cost?
Every started 20 comments cost 1 credit, so 20 comments are 1 credit and 100 comments are 5. Credit packs start at $9 for 3,000 credits and never expire. A request that returns no data is not charged.
What if comments are turned off?
The request answers 404 comments_disabled and costs nothing.
Do comments contain personal data?
They contain the public names of the people who wrote them. If you store or process them, data-protection law such as the GDPR applies to you as it would to any other source.
More YouTube APIs
-
1 credit
YouTube Transcript API
The transcript of any public video with captions, as plain text, timestamped segments, SRT or WebVTT.
GET /v1/youtube/transcript -
1 credit
YouTube Video API
Exact views, likes and comment count, description, tags, chapters and channel for one video.
GET /v1/youtube/video -
1 credit
YouTube Channel API
Subscribers, video count, description, keywords and avatar for a channel, from a handle, id or URL.
GET /v1/youtube/channel -
1 credit
YouTube Channel Videos API
The latest uploads of a channel, newest first, with views, duration and publish time.
GET /v1/youtube/channel/videos -
1 credit
YouTube Shorts API
The Shorts of a channel, newest first, with view counts and thumbnails.
GET /v1/youtube/channel/shorts -
1 credit
YouTube Search API
YouTube search results for a query, with the same sorting and filters the site offers.
GET /v1/youtube/search
Make your first request in a minute
Sign in, copy your key and call an endpoint. Your account starts with 100 free credits.