A YouTube channel ID is a unique identifier for a YouTube channel. In recent years YouTube has moved to channel names instead of IDs, and it's now often impossible to find a channel ID by simply browsing around YouTube's website. However, the unique ID is still very important for fetching public data like view and subscriber counts via the API.
How to get the channel ID?
The channel ID is pretty hidden, but we have several ways to get it:
Grab the ID from the Page Source
- To get a channel ID, visit the channel page you're interested in on YouTube, e.g.
https://www.youtube.com/@JamesJani
- Right-click on your browser and click View Page Source.
- Search (Ctrl-F) for
https://www.youtube.com/channel/
in the page source. - The channel ID will appear directly after the
/channel/
text in the URL path.
Check the ID in Developer Tools
- Navigate to the channel for which you're interested in fetching data
- Open Developer Tools in your browser (F12 on Windows/Linux or option + ⌘ + J on OSX)
- Click on the Network tab
- In the filter box type "browse" to filter the list of network requests
- Click on any interactive element of the channel page, e.g. the Home or Videos tab
- In the right side panel you should see a network request to the
/browse
endpoint. Click on it and the Channel ID will appear in the Request Payload under thebrowseId
parameter
Fetch the ID via the API
- Open a video published by the channel of interest
- Check the video ID in the URL
- Now use your API client of choice to run an API request to YouTube's
/videos
endpoint, e.g.https://www.googleapis.com/youtube/v3/videos?part=snippet&id=tlNBB0jdL3w
- The channel ID will be returned in the
channelId
parameter.
This helped me a lot! thank you very very much!
Woohoo! Glad to hear it 😀
Thank you so much!!! I was dreading having to wait for hours for my boss to respond to my DM for the channel ID
Haha, nice!
Thanks a alot mate