Youtube API v3 Search own videos by tag

只愿长相守 提交于 2019-12-17 19:52:43

问题


Is it possible to search videos by tags using Youtube API v3 ? I would like to search among my own videos.


回答1:


Use search method with ##tagname search string for q parameter and set type:video parameter. You can find other search operators here. Old one - tag:tangle doesn't work with new api for me. ## works fine.




回答2:


Recently tried the solution given by user 350D, but q=##{YOUR_TAG} does not appear to work with the latest YouTube API. It appears that the tag can only be retrieved when the video ID is provided as a parameter. I found that the following works for me:

First, retrieve a list of videos (returning minimal needed information, e.g. the video ID, title, and the high quality thumbnail URL):

https://www.googleapis.com/youtube/v3/search?key={YOUR API KEY}&fields=items(id(videoId),snippet(title,thumbnails(high(url))))&part=id,snippet;

Then batch the video IDs into one request to retrieve the associated tags:

https://www.googleapis.com/youtube/v3/videos?key={YOUR API KEY}&fields=items(id,snippet(tags))&part=snippet&id={videoID01,videoID02,etc};



回答3:


You can do a videos->list with with settings video ids as the ones in your playlist and iterate through them checking with tags. But searching by tags is not available in API anymore.



来源:https://stackoverflow.com/questions/16672685/youtube-api-v3-search-own-videos-by-tag

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