Platforms/YouTube/Video

YouTube Video API

GET ยท 1 credit

Send a video's id or link, and get its description, views, likes, comment count, chapters, captions, keywords and related videos.

GET /v1/youtube/videos

What people use it for

  • Performance tracking: read a video's views, likes and comment count every day after it goes up.
  • Content analysis: use its chapters, keywords and category to see how creators structure videos.
  • Recommendations research: see which videos YouTube suggests next to it in related.
  • Link enrichment: turn a pasted YouTube link into its title, thumbnail and channel.

How it works with other endpoints

Video ids come from Channel videos, Search and the hashtag endpoints. The same id goes to Video comments and Video transcript; the transcript takes a language from captions.

Limits

  • One video a call.
  • A private or age-restricted video answers 403 LOGIN_REQUIRED; a removed one answers 404 NOT_FOUND.

Example request

const url = `${process.env.API_URL}/v1/youtube/videos?video_id=rfscVS0vtbw`;

const response = await fetch(url, {
  headers: { "x-api-key": process.env.API_KEY },
});

const { data } = await response.json();
console.log(data);

Parameters

ParameterRequiredDescription
video_idNoA video's id: the 11 characters after watch?v= or /shorts/ in its link. Give video_id or url.
urlNoA video's link: watch?v=<id>, youtu.be/<id>, or a /shorts/, /live/, /embed/ or /v/ link, on youtube.com, www., m. or music. Give video_id or url.

Example response

{
  "data": {
    "id": "rfscVS0vtbw",
    "url": "https://www.youtube.com/watch?v=rfscVS0vtbw",
    "title": "Learn Python - Full Course for Beginners [Tutorial]",
    "is_short": false,
    "thumbnail": "https://i.ytimg.com/vi/rfscVS0vtbw/hqdefault.jpg",
    "duration_seconds": 16012,
    "views": 47000000,
    "published": "7 years ago",
    "channel_id": "UC8butISFwT-Wl7EV0hUK0BQ",
    "channel_name": "freeCodeCamp.org",
    "channel_handle": "freecodecamp",
    "badges": [
      "CC"
    ],
    "description": "This course will give you a full introduction into all of the core concepts in python.",
    "created_at": "2018-07-11T18:00:42Z",
    "category": "Education",
    "keywords": [
      "python",
      "python tutorial",
      "learn python"
    ],
    "likes": 880000,
    "comment_count": 38000,
    "is_live": false,
    "channel_subscribers": 11000000,
    "captions": [
      {
        "language": "en",
        "name": "English (auto-generated)",
        "auto": true
      },
      {
        "language": "es",
        "name": "Spanish",
        "auto": false
      }
    ],
    "chapters": [
      {
        "title": "Introduction",
        "start_seconds": 0
      },
      {
        "title": "Installing Python & PyCharm",
        "start_seconds": 77
      }
    ],
    "related": [
      {
        "id": "8DvywoWv6fI",
        "url": "https://www.youtube.com/watch?v=8DvywoWv6fI",
        "title": "Python for Everybody - Full University Python Course",
        "is_short": null,
        "thumbnail": null,
        "duration_seconds": null,
        "views": null,
        "published": null,
        "channel_id": "UC8butISFwT-Wl7EV0hUK0BQ",
        "channel_name": "freeCodeCamp.org",
        "channel_handle": "freecodecamp",
        "badges": null,
        "description": null
      }
    ]
  },
  "page": null,
  "meta": {
    "platform": "youtube",
    "endpoint": "video",
    "params": {
      "video_id": "rfscVS0vtbw"
    },
    "request_id": "sp_req_1f8c2d3e4a5b6c7d",
    "api_version": "v1",
    "fetched_at": "2026-11-30T09:30:00Z",
    "cached": false
  }
}

An illustrative answer: live answers have the same shape, with the page's current data.

Every field, with its type, is in the API reference, and every error code in Errors.

Price

Each call costs 1 credit, a not-found answer too. Cached answers and other errors cost nothing, and credits never expire. New accounts start with 100 free credits. See pricing for the packs.

FAQ

Which links does it take?

watch?v=<id>, youtu.be/<id>, and /shorts/, /live/, /embed/ and /v/ links, on youtube.com, www., m. or music. The 11-character id alone works too.

Does it work on Shorts and live streams?

Yes. is_short and is_live say which it is.

Does it give the transcript?

It lists the caption tracks in captions. Video transcript reads one of them as text.

Are the counts exact?

views is exact where YouTube shows the exact number, else its rounding (12M). channel_subscribers is rounded by YouTube.

Works with

On other platforms

YouTube guides

Start free

Your first 100 credits are on us

Sign up, create a key and make your first call in a few minutes.

No credit card required