Skip to content

Instantly share code, notes, and snippets.

@dushankw
Created February 21, 2024 04:10
Show Gist options
  • Save dushankw/428927cf3544b78812b5779f4367db1d to your computer and use it in GitHub Desktop.
Save dushankw/428927cf3544b78812b5779f4367db1d to your computer and use it in GitHub Desktop.

To get the channel ID of a public YouTube channel, you can follow these steps:

  1. Go to YouTube: Open YouTube in your web browser.

  2. Find the Channel: Use the search bar to find the channel you're interested in. Once you've found the channel, click on the channel name to go to the channel's homepage.

  3. Check the URL: There are a couple of ways the channel ID can appear in the URL, depending on how the channel URL is structured:

    • Standard Channel URL: For many channels, the URL when you visit their homepage will directly contain the channel ID. It will look something like https://www.youtube.com/channel/UCXXXXXXXXXXXXXXXXXXXXXX. In this URL, the channel ID is the alphanumeric string after /channel/ (e.g., UCXXXXXXXXXXXXXXXXXXXXXX).

    • Custom URL: Some channels may have a custom URL (e.g., https://www.youtube.com/c/ChannelName or https://www.youtube.com/ChannelName). In this case, you won't see the channel ID directly in the URL. To find the channel ID, you will need to use the "View Page Source" method described next.

  4. View Page Source (for Custom URL): If the channel has a custom URL, you can find the channel ID by viewing the page's source code:

    • Right-click on the channel's page (anywhere that's not a link or image) and select "View Page Source" or "View Page Info" depending on your browser.
    • Press Ctrl + F (Windows) or Command + F (Mac) to open the find function in your browser.
    • Type "channelId" into the search box. You should find a line in the source code that looks something like "channelId":"UCXXXXXXXXXXXXXXXXXXXXXX". The alphanumeric string (e.g., UCXXXXXXXXXXXXXXXXXXXXXX) after "channelId": is the channel ID.
  5. Point your RSS reader at https://www.youtube.com/feeds/videos.xml?channel_id=THE_CHANNEL_ID_HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment