Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How to get Youtube channel details using Youtube data API if channel has custom url

$
0
0

I would like to fetch details of a YouTube channel which has a custom URL, like https://www.youtube.com/c/pratiksinhchudasamaisawesome.

Custom channel URLs follow this format: https://www.youtube.com/c/{custom_channel_name}.

I can fetch the details of YouTube channels by Channel ID and username without any issues. Unfortunately, I need to use the custom channel URL which is the only time I encounter this issue.

I developed my app few months ago, and the custom channel URL was working up until a few days ago. Now, the YouTube data API does not return anything for the YouTube custom channel URL if I try get details using their custom name.

To get the details of this channel: https://www.youtube.com/user/thenewboston, for example, the request would be:

GET https://www.googleapis.com/youtube/v3/channels?part=snippet&forUsername=thenewboston&key={YOUR_API_KEY}

Response

200- SHOW HEADERS -{"kind": "youtube#channelListResponse","etag": "\"zekp1FB4kTkkM-rWc1qIAAt-BWc/8Dz6-vPu69KX3yZxVCT3-M9YWQA\"","pageInfo": {"totalResults": 1,"resultsPerPage": 5 },"items": [  {"kind": "youtube#channel","etag": "\"zekp1FB4kTkkM-rWc1qIAAt-BWc/KlQLDlUPRAmACwKt9V8V2yrOfEg\"","id": "UCJbPGzawDH1njbqV-D5HqKw","snippet": {"title": "thenewboston","description": "Tons of sweet computer related tutorials and some other awesome videos too!","publishedAt": "2008-02-04T16:09:31.000Z","thumbnails": {"default": {"url": "https://yt3.ggpht.com/--n5ELY2uT-U/AAAAAAAAAAI/AAAAAAAAAAA/d9JvaIEpstw/s88-c-k-no-rj-c0xffffff/photo.jpg"     },"medium": {"url": "https://yt3.ggpht.com/--n5ELY2uT-U/AAAAAAAAAAI/AAAAAAAAAAA/d9JvaIEpstw/s240-c-k-no-rj-c0xffffff/photo.jpg"     },"high": {"url": "https://yt3.ggpht.com/--n5ELY2uT-U/AAAAAAAAAAI/AAAAAAAAAAA/d9JvaIEpstw/s240-c-k-no-rj-c0xffffff/photo.jpg"     }    },"localized": {"title": "thenewboston","description": "Tons of sweet computer related tutorials and some other awesome videos too!"    }   }  } ]}

It works perfectly.

Now we have to get details of these channels:

Then we get:

GET https://www.googleapis.com/youtube/v3/channels?part=snippet&forUsername=annacavalli&key={YOUR_API_KEY}

Response

200- SHOW HEADERS -{"kind": "youtube#channelListResponse","etag": "\"zekp1FB4kTkkM-rWc1qIAAt-BWc/TAiG4jjJ-NTZu7gPKn7WGmuaZb8\"","pageInfo": {"totalResults": 0,"resultsPerPage": 5 },"items": [ ]}

This can be easily reproduced using the API explorer.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>