Is this possible? Using Youtube API v3.0 to get video length and views? I can't seem to find anything on it as all the results are for v2.0.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The search endpoint doesn't have a way to return this info yet, but the videos endpoint can if you request the contentDetails
and the statistics
in the part
parameter ... something like this:
https://www.googleapis.com/youtube/v3/videos?part=contentDetails%2Cstatistics&id=voNEBqRZmBc&key={YOUR_API_KEY}
The returned object will have a duration
attribute that's in ISO 8601 format (under the contentDetails), and a views
attribute under the statistics.
标签:
youtube-api