youtubeyoutube-api

How can I get a channel ID from YouTube?


I'm trying to retrive the data from my channel using the YouTube Data API V3.
For that I need my channel ID.
I've tried to find my channel ID from my YouTube account, and I failed in every single way.
If anyone have a single tip for me, I would be incredible glad.

This is the URL that I'm using to retrieve the data:

https://www.googleapis.com/youtube/v3/channels?id=fjTOrCPnAblTngWAzpnlMA&key={YOUR_API_KEY}&part=snippet,contentDetails,statistics

The ID is for the channel ID, and the key, I'm replacing the {YOUR_API_KEY} with my API KEY generated at my Google API console.

My channel ID is not:
- klauskkpm
- klausmachado
- klausmachado@gmail.com
- fjTOrCPnAblTngWAzpnlMA

My channel is: http://www.youtube.com/user/klauskkpm


Solution

  • To obtain the channel id you can view the source code of the channel page and find either data-channel-external-id="UCjXfkj5iapKHJrhYfAF9ZGg" or "externalId":"UCjXfkj5iapKHJrhYfAF9ZGg".

    UCjXfkj5iapKHJrhYfAF9ZGg will be the channel ID you are looking for.