Get youtube video info with new APIs v3

匿名 (未验证) 提交于 2019-12-03 08:54:24

问题:

Usually I retrieved clip's info by YouTube Data API V2, but now this version(v2) has been officially deprecated.

I used this URL to get video info:

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

How to get info for a video in JSON format with new APIs v3?

回答1:

Depending on the information you should be able to use the following endpoint to gain the information about the video you require. Just filter it down using the id query parameter to the video id.

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

See the Below URL: for example using the video id 4Y4YSpF6d6w and setting part to id,snippet you will receive channelId, title, description, tags, and categoryId properties. The above documentation contains all of the part parameters depending on the information you require about the video.

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!