【问题标题】:Searching Channel with Youtube API使用 Youtube API 搜索频道
【发布时间】:2014-10-15 04:44:59
【问题描述】:

我在我的iOS 应用程序中使用Youtube Data Api V3。有人可以给我一些例子来按名称搜索一些频道。

我正在尝试以下方式,但它不起作用

https://www.googleapis.com/youtube/v3/search/list?key={YOUR_API_KEY}&part=sn-p&type=channel&q=AnimalPlanetTV

谁能帮助我如何按名称获取频道数据

谢谢

【问题讨论】:

    标签: ios iphone youtube-api youtube-data-api youtube-channels


    【解决方案1】:
    【解决方案2】:

    这是live example

    您需要使用 API V3 的Channel list

    结果和snippet一样

    {
     "kind": "youtube#channelListResponse",
     "etag": "\"gMjDJfS6nsym0T-NKCXALC_u_rM/RKAMAh1QnoE3ilYYcvWIqvcDEZo\"",
     "pageInfo": {
      "totalResults": 1,
      "resultsPerPage": 5
     },
     "items": [
      {
    
       "kind": "youtube#channel",
       "etag": "\"gMjDJfS6nsym0T-NKCXALC_u_rM/MenmiFqQVVN5JQ9MJpC9gddZ4Lw\"",
       "id": "UCkEBDbzLyH-LbB2FgMoSMaQ",
       "snippet": {
        "title": "Animal Planet",
        "description": "Animal Planet is the world's only entertainment brand that immerses viewers in the full range of life in the animal kingdom with rich, deep content via multiple platforms and offers animal lovers and pet owners access to a centralized online, television and mobile community for immersive, engaging, high-quality entertainment, information and enrichment.",
        "publishedAt": "2007-02-14T18:26:59.000Z",
        "thumbnails": {
         "default": {
          "url": "https://yt3.ggpht.com/-FEsYkupUb-A/AAAAAAAAAAI/AAAAAAAAAAA/6SiqnVvRZJY/s88-c-k-no/photo.jpg"
         },
         "medium": {
          "url": "https://yt3.ggpht.com/-FEsYkupUb-A/AAAAAAAAAAI/AAAAAAAAAAA/6SiqnVvRZJY/s240-c-k-no/photo.jpg"
         },
         "high": {
          "url": "https://yt3.ggpht.com/-FEsYkupUb-A/AAAAAAAAAAI/AAAAAAAAAAA/6SiqnVvRZJY/s240-c-k-no/photo.jpg"
         }
        }
       }
      }
     ]
    }
    

    【讨论】:

    • 它会为您提供准确的搜索名称,但如果用户想要搜索“汽车”并且假设会显示许多其他结果怎么办?
    • 那么你有多个结果
    猜你喜欢
    • 1970-01-01
    • 2014-11-04
    • 2019-12-14
    • 1970-01-01
    • 2015-07-12
    • 2022-01-21
    • 2016-07-11
    • 2015-04-30
    • 2011-06-10
    相关资源
    最近更新 更多