Considering YouTube videos, programmatically get your channel?

I found at least five questions of the form "there is a YouTube channel here, how do I programmatically get videos on this channel?"

I want to do the opposite: given the video, what channel did it appear on?

So far I have looked for solutions on this in the official YouTube API. I've also looked at libraries like pafy. No luck yet.

+3


source to share


1 answer


https://developers.google.com/youtube/v3/docs/videos/list

It looks like you can make a video request and then install:

part=snippet

This will return channelId

, by the way. I made a request like this:



GET https://www.googleapis.com/youtube/v3/videos?part=snippet&id=f8WsO__XcI0&key={YOUR_API_KEY}

and I get the answer:

 {

 ...

 "items": [
  {

   "kind": "youtube#video",
   "etag": "\"IHLB7Mi__JPvvG2zLQWAg8l36UU/Xn3r39kJJF0iqtZbqFIeFUTgC0Q\"",
   "id": "f8WsO__XcI0",
   "snippet": {
    "publishedAt": "2015-04-13T21:20:53.000Z",
    "channelId": "UC6nSFpj9HTCZ5t-N3Rm3-HA",

 ...

 }

      

+1


source







All Articles