我一直在查看YouTube API,但我想知道是否可以通过井号(例如)搜索YouTube视频。
我想浏览YouTube视频以了解#funny
我已阅读YouTube 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.
以我的经验,这是对视频标题和描述的全文搜索,因此,假设您的哈希标签位于描述中,则应该可以对其进行搜索。
请求
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"
}
},
这是它返回的视频WATCH and TRY TO STOP LAUGHING - Super FUNNY VIDEOS compilation #funny在描述中。
您可以在这里自己尝试Google Apis Explorer
关于youtube - 是否可以通过标签探索YouTube视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49670740/