Comments

Top or newest comments of a video with likes, reply counts, pinned and hearted flags.

GET/v1/youtube/comments

Costs 1 credit per 20 items requested. Only requests that return data are charged.

Parameters

NameTypeDescription
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.

Example request

curl "https://pipefetch.com/v1/youtube/comments?video=jNQXAC9IVRw&limit=20" \
  -H "x-api-key: YOUR_API_KEY"

Example response

A real answer to the request above. Long texts and lists are shortened here.

200 OK ยท application/json
{
  "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
  }
}

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.

Errors

Every error has the same shape, and none of them is charged. The full list is in the error reference.

Looking for an overview and use cases? See the YouTube Comments API page.