2

Recently , the youtube API has been updated to V3 , and I have a question:

How can I get the video details (views, name , description etc..) through Javascript using the url of the video ?

Example :

I have this url https://www.youtube.com/watch?v=DQ5w8LBI0kI&ab_channel=YT and I want to get via Javascript the name and description of it.

How can I do this ?

Nexussim Lements
  • 535
  • 1
  • 15
  • 47
  • Recently? The YouTube API V3 was released in 2013? Please check the documentation give it a try and come back if you have any issues there is lots of documentation on this **six** year old api. – Linda Lawton - DaImTo Apr 23 '19 at 11:17

3 Answers3

1

You can find a detailed information about how to retrieve any kind of data you want in the official documentation of youtube api.Here

Itay Elgazar
  • 125
  • 10
1

The API documentation is quite involved. Two good points to start from are the following:

Upon reading them -- and surely more for that matter -- do come back with concrete (programming!) questions.

One more hint: the API endpoint that provides you with the information attached to a given video is Videos.list. But that doc page becomes meaningful only after you familiarize yourself with the surrounding (programming) environment.

stvar
  • 6,551
  • 2
  • 13
  • 28
1

Steps to achieve:

  1. See the answer here to see how to get/parse video Id from a youtube video url.
  2. After you get a videoId e.g. DQ5w8LBI0kI, you have to use that in the below API to get views, name, description etc.

    https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id=DQ5w8LBI0kI&key=[YOUR_API_KEY]

See more about this Youtube API here

Rahul Saini
  • 216
  • 1
  • 16