Answers
YouTube video ID, channel ID (UC…) and @handle: what is each?
Short answer
The video ID is the 11-character code after watch?v= or youtu.be/; the channel ID is the permanent 24-character ID starting with UC; the @handle is the channel's changeable public name. okdata YouTube video detail takes a video ID or any video link and returns the channel ID as author.id and the handle as author.username, for $0.002.
YouTube links mix three kinds of identifier, and tools ask for different ones. A video ID names one video. A channel ID names a channel for good. A handle is the channel's @name, chosen by the owner and open to change. Knowing which is which saves you from storing the one that breaks.
The three side by side
| Video ID | Channel ID | Handle | |
|---|---|---|---|
| Example | Xk3_9fQpL2w |
UCq7mT2vXbN4rLk9sHd0aWzE |
@trailkitgear |
| Shape | 11 characters from A-Z, a-z, 0-9, - and _ |
UC + 22 characters, 24 in total |
3 to 30 characters, with _, - and . allowed inside |
| In URLs | watch?v=, youtu.be/, /shorts/, /live/ |
youtube.com/channel/UC… |
youtube.com/@handle |
| Changes? | Never | Never | The owner can change it |
The alphabet of video and channel IDs is the URL-safe variant of base64, which is why - and _ appear. Older links in /c/name and /user/name form still exist; YouTube says no new custom URLs can be set up and that those legacy links now redirect to the handle URL. Handles are not case-sensitive.
Which to store
Key videos on the video ID and channels on the channel ID. Store the handle and the channel title as labels you refresh. A handle in a spreadsheet from last year may now point nowhere, or at a different channel.
Getting from one to another
YouTube video detail accepts id or any of the link forms above as url and returns author.id (the channel ID, UC…) and author.username (the handle without the @). YouTube video search returns the same author fields for every result. The catalog has no channel endpoint, so going from a handle to its channel ID takes one of these:
- one of the channel's videos through video detail, then read
author.id; - a search for the channel's name, then keep results whose
author.usernamematches; - YouTube's own Data API, whose
channels.listtakesforHandle=@nameand returns the channel resource, if you have a Google Cloud project and key.
| Job | Calls | Cost |
|---|---|---|
| Video link to video ID, channel ID and handle | 1 | $0.002 |
| Handle to channel ID via a search page | 1 | $0.004 |
| 200 video links from a sheet | 200 | $0.40 |
Example
curl -G "https://api.okdata.online/v1/youtube/videos/get" \
-H "Authorization: Bearer $OKDATA_API_KEY" \
--data-urlencode 'url=https://youtu.be/Xk3_9fQpL2w' \
--data-urlencode 'fields=id,author.id,author.username,author.name'
data.item in the response then holds just those fields:
{ "id": "Xk3_9fQpL2w",
"author": { "id": "UCq7mT2vXbN4rLk9sHd0aWzE", "username": "trailkitgear", "name": "Trail Kit" } }
Limits
- A video's own ID never changes, but the video can be removed or made private; detail then returns
not_found, which is still charged as one call. - A playlist ID (
PL…) or a channel link is not a video link; video detail cannot read them. - Handle rules differ for non-Latin scripts; YouTube's handle page lists the lengths for Han, Hangul and others.
For counts once you have the ID, see getting a YouTube video's views and likes.
Sources
- YouTube Help: Understand your YouTube channel's URLs
- YouTube Help: Learn about YouTube handles
- YouTube Data API: Channels list (forHandle parameter)
- Base64 (Wikipedia): the URL-safe alphabet YouTube uses
Where people asked this (read 2026-11-12)
Updated