Get information about YouTube videos with new v3 APIs

I used to fetch information about a clip using the YouTube V2 Data API, but now this version (v2) is officially deprecated.

I used this url to get information about the video:

'http://gdata.youtube.com/feeds/api/videos/'+ VIDEO_ID +'?v=2&alt=jsonc'

      

How to get video information in JSON format with new v3 APIs?

+8


source to share


1 answer


Depending on the information, you can use the following endpoint to get information about the required video. Just filter it using id query parameter to video id.

https://developers.google.com/youtube/v3/docs/videos/list



See below url: for example using video id 4Y4YSpF6d6w and setting the part to id, snippet, you will get the channelId, title, description, tags and categoryId attributes. The above documentation contains all the part parameters depending on the required video information.

GET https://www.googleapis.com/youtube/v3/videos?part=id%2C+snippet&id=4Y4YSpF6d6w&key= {YOUR_API_KEY}

+14


source







All Articles