youtube - 是否可以通过标签探索YouTube视频?

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

我一直在查看YouTube API,但我想知道是否可以通过井号(例如)搜索YouTube视频。

我想浏览YouTube视频以了解#funny
我已阅读YouTube API文档,但未发现任何内容。

最佳答案

Search: list

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/

相关文章:

flash - 如果对象标签中没有 classid,YouTube 嵌入如何工作?

youtube - 如何自动播放嵌入YouTube视频

php - 如何使用来自谷歌的外部托管 jquery 覆盖核心 jquery 文件

python - 如何用 PyDrive 替换/更新 Google Drive 上的文件?

python - YouTube API 的官方客户端是线程安全的吗?

iphone - 如何从YouTube网址获取缩略图?

google-apps-script - 脚本在 SpreadsheetApp.openById 上失败 - 需要权限

youtube - 三星智能电视YouTube JavaScript Player API

c# - 批量上传到 YouTube - ASP.NET 4 C#

python - Selenium 向下滚动动态站点