是否可以通过主题标签以某种方式探索 youtube 视频? [英] Is possible somehow explore youtube videos by hashtag?
问题描述
我一直在查看 YouTube API,我想知道是否可以通过主题标签(例如)以某种方式搜索 YouTube 视频
I have been looking at the YouTube API and I am wondering if it is possible somehow search YouTube videos by hashtags e.g.
我想浏览 YouTube 视频以获得标签 #funny
I want explore YouTube video for hashtag #funny
我已阅读 YouTube API 文档,但没有找到任何内容.
I have read YouTube API documentation but I haven't found anything.
推荐答案
返回与 API 请求中指定的查询参数匹配的搜索结果集合.默认情况下,搜索结果集会标识匹配的视频、频道和播放列表资源,但您也可以将查询配置为仅检索特定类型的资源.
Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.
根据我的经验,这是对视频标题和描述的全文搜索,因此假设您的哈希标签在描述中,您应该能够搜索它们.
In my experience this is a full text search on title and description of the video so assuming your hash tags are in the description you should be able to search on them.
请求
GET https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&q=%23funny&key={YOUR_API_KEY}
回复
{
"kind": "youtube#searchListResponse",
"etag": "\"RmznBCICv9YtgWaaa_nWDIH1_GM/wR5yPzOxAnu-87xJGtSkLXz_78Q\"",
"nextPageToken": "CBkQAA",
"regionCode": "DK",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 25
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "\"RmznBCICv9YtgWaaa_nWDIH1_GM/IByts9zZTVNkc5EfbIDTKpE6pf8\"",
"id": {
"kind": "youtube#video",
"videoId": "DODLEX4zzLQ"
},
"snippet": {
"publishedAt": "2017-06-17T10:03:47.000Z",
"channelId": "UCKy3MG7_If9KlVuvw3rPMfw",
"title": "WATCH and TRY TO STOP LAUGHING - Super FUNNY VIDEOS compilation",
"description": "Can you hold your laugh while watching these clips? :) Mix of best and funniest animal & human fails. We bet you will lose this laugh challenge. Anyways, what is your favorite clip? :) Hope...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/DODLEX4zzLQ/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/DODLEX4zzLQ/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/DODLEX4zzLQ/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Tiger Productions",
"liveBroadcastContent": "none"
}
},
这是它返回的视频 观看并尝试停止笑 - 超级有趣的视频汇编 #funny 在描述中.
This is the video it returned WATCH and TRY TO STOP LAUGHING - Super FUNNY VIDEOS compilation #funny is in the description.
您可以在这里自己尝试 Google APIs Explorer
You can try it yourself here Google Apis Explorer
这篇关于是否可以通过主题标签以某种方式探索 youtube 视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!