Josh
Josh

Reputation: 1

YouTube Data API Channel.list function

For the channel.list function of the YouTube API are you able to call statistics for any channel on YouTube? Reviewing the below call parameters it seems all require you to be the owner of that channel to receive any information on that channel.

I've also tried the API test to see if I can receive data by username for the channel but doesn't seem to work. Beginner so if anyone could help out I'd much appreciate it!

https://developers.google.com/youtube/v3/docs/channels/list?apix_params=%7B%22forUsername%22%3A%22Peter%20McKinnon%22%7D

Upvotes: 0

Views: 1040

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117281

You do not need to be the owner of the channel you just need the channel Id. You can tests this using the try me on channel.list its a public api call.

request

GET https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=UCeY0bbntWzzVIaj2z3QigXg&key=[YOUR_API_KEY] HTTP/1.1   

Accept: application/json

response

{
  "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"
      }
    }
  ]
}

Upvotes: 1

Related Questions