使用新的API v3获取youtube视频信息 [英] Get youtube video info with new APIs v3

查看:220
本文介绍了使用新的API v3获取youtube视频信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我通过YouTube数据API V2检索了剪辑的信息,但现在此版本(v2)已被正式弃用.

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

我使用此URL来获取视频信息:

I used this URL to get video info:

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

如何使用新的API v3获取JSON格式的视频信息?

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

推荐答案

根据信息,您应该能够使用以下端点来获取有关所需视频的信息.只需使用id查询参数对视频ID进行过滤即可.

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/视频/列表

请参见以下URL:例如,使用视频ID 4Y4YSpF6d6w,并将part设置为id,snippet,您将收到channelId,标题,说明,标签和categoryId属性.上述文档包含所有部分参数,具体取决于您需要的有关视频的信息.

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.

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

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

这篇关于使用新的API v3获取youtube视频信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆