有可能通过话题标签探索youtube视频吗?

时间:2018-04-05 11:00:42

标签: youtube google-api youtube-api youtube-data-api

我一直在关注YouTube API,我想知道是否有可能以某种方式通过主题标签搜索YouTube视频,例如

我想浏览YouTube视频标签#funny

我已阅读YouTube API文档,但我找不到任何内容。

1 个答案:

答案 0 :(得分:0)

Search: list

  

返回与API请求中指定的查询参数匹配的搜索结果集合。默认情况下,搜索结果集标识匹配的视频,频道和播放列表资源,但您也可以将查询配置为仅检索特定类型的资源。

根据我的经验,这是对视频标题和描述的全文搜索,因此假设您的哈希标记位于描述中,您应该可以搜索它们。

请求

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

自行试用