1

I want to make a chrome extension for YouTube. I need to obtain a user's YouTube channel id, if it exists. How to do that? I tried to obtain google account id, but it does not look like YouTube channel ID.

chrome.identity.getProfileUserInfo(function(userInfo)
{
    console.log(userInfo.id);
});

After it is executed, I get 10053**7950021, but my YouTube channel has UCMEh1bYibhq7tCRRm6cA2dw, as I get from the link. Either they use a very weird base to transform that base-10 number into UC..., or google account is not the same as YouTube channel. Could you help please?

Fortnite
  • 81
  • 2
  • 6

1 Answers1

0

Well there is help on this at https://developers.google.com/youtube/v3/guides/working_with_channel_ids

It tells you how to work with YouTube channel ids.

There is more info on it here, here, here, and here.

  • I know about data api, but I can not use it client-side. I am making a chrome extension where I want to get the channelID to use it in my server-side then. – Fortnite Dec 23 '20 at 19:00
  • @Fortnite Look at this https://stackoverflow.com/questions/14366648/how-can-i-get-a-channel-id-from-youtube it might have the answer that you are looking for. – Officer Erik 1K-88 Dec 23 '20 at 19:13
  • It is not about extensions again. There is no way to use data api there or obtain a link somehow. There should be a way to get that with some chrome API. – Fortnite Dec 23 '20 at 19:17
  • @Fortnite I want to know, have you searched it up on google to see if you could find what you are wanting. Also, if you are wanting to get a YouTube channel id you most likely will have to use one of the YouTube APIs, also isn't YouTube apart of google, so I do believe you should try things. Also, try to use YouTube Data API, since it most likely will work if you just try to use it. – Officer Erik 1K-88 Dec 23 '20 at 19:33
  • I tried to search and the only thing I found is chrome `identity` api which gives the google ID, but not the YouTube one. But I have not found a chrome API to work with YouTube. That is what I ask for. YouTube data api is server-side and does not work in chrome extension which is only client-sided, so there is no way for me to use it. – Fortnite Dec 23 '20 at 19:41
  • @Fortnite Have you ever tried to use YouTube Data API for this, since the more I search the more I find that says that you might be able to use YouTube Data API for this. Here are some links to that stuff: https://developers.google.com/youtube/registering_an_application , https://www.w3resource.com/API/youtube/tutorial.php , https://console.developers.google.com/apis/library/youtube.googleapis.com?q=YouTube%20Data&id=125bab65-cfb6-4f25-9826-4dcc309bc508&project=project-id-0740673558340127806&safe=active&surl=1 , https://developers.google.com/youtube/v3/?hl=en_US – Officer Erik 1K-88 Dec 23 '20 at 20:00