Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google api YouTube数据API Channel.list函数_Google Api_Youtube Api_Youtube Data Api_Google Apis Explorer - Fatal编程技术网

Google api YouTube数据API Channel.list函数

Google api YouTube数据API Channel.list函数,google-api,youtube-api,youtube-data-api,google-apis-explorer,Google Api,Youtube Api,Youtube Data Api,Google Apis Explorer,对于YouTube API的channel.list函数,您是否能够调用YouTube上任何频道的统计信息?查看下面的通话参数,似乎都需要您是该频道的所有者才能接收该频道的任何信息 我还尝试了API测试,看看是否可以通过用户名接收通道的数据,但似乎不起作用。初学者,如果有人能帮忙,我将不胜感激 您不需要是频道的所有者,只需要频道Id。您可以使用try me on a public api调用来测试这一点 要求 响应 谢谢你的回答!我现在让它为我工作。谢谢你的帮助! GET https://www

对于YouTube API的channel.list函数,您是否能够调用YouTube上任何频道的统计信息?查看下面的通话参数,似乎都需要您是该频道的所有者才能接收该频道的任何信息

我还尝试了API测试,看看是否可以通过用户名接收通道的数据,但似乎不起作用。初学者,如果有人能帮忙,我将不胜感激


您不需要是频道的所有者,只需要频道Id。您可以使用try me on a public api调用来测试这一点

要求 响应
谢谢你的回答!我现在让它为我工作。谢谢你的帮助!
GET https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=UCeY0bbntWzzVIaj2z3QigXg&key=[YOUR_API_KEY] HTTP/1.1   

Accept: application/json
{
  "kind": "youtube#channelListResponse",
  "etag": "y2BDT1Qkcr2Fm2FAHjDfG6Gn8Sc",
  "pageInfo": {
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#channel",
      "etag": "VCwefXyl53bCqIREF0zJeTfxZXk",
      "id": "UCeY0bbntWzzVIaj2z3QigXg",
      "snippet": {
        "title": "NBC News",
        "description": "» Subscribe to NBC News:",
        "customUrl": "nbcnews",
        "publishedAt": "2006-07-19T20:46:03Z",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/a/AATXAJzjPejETKc2lrL43-9gFFWRL9WKwEmOIvtbWyait1c=s88-c-k-c0xffffffff-no-rj-mo",
            "width": 88,
            "height": 88
          },
          "medium": {
            "url": "https://yt3.ggpht.com/a/AATXAJzjPejETKc2lrL43-9gFFWRL9WKwEmOIvtbWyait1c=s240-c-k-c0xffffffff-no-rj-mo",
            "width": 240,
            "height": 240
          },
          "high": {
            "url": "https://yt3.ggpht.com/a/AATXAJzjPejETKc2lrL43-9gFFWRL9WKwEmOIvtbWyait1c=s800-c-k-c0xffffffff-no-rj-mo",
            "width": 800,
            "height": 800
          }
        },
        "localized": {
          "title": "NBC News",
          "description": "» Subscribe to NBC News: "
        }
      },
      "contentDetails": {
        "relatedPlaylists": {
          "likes": "",
          "favorites": "",
          "uploads": "UUeY0bbntWzzVIaj2z3QigXg",
          "watchHistory": "HL",
          "watchLater": "WL"
        }
      },
      "statistics": {
        "viewCount": "1942288925",
        "commentCount": "0",
        "subscriberCount": "3700000",
        "hiddenSubscriberCount": false,
        "videoCount": "25734"
      }
    }
  ]
}