What is a YouTube video ID?
A YouTube video ID is the 11-character string (letters, digits, - and _) that identifies a video, e.g. aqz-KE-bpKQ.
Definition
The same ID appears in every URL form: watch?v=ID, youtu.be/ID, shorts/ID and embed/ID. It's the best key for caching and de-duplication.
In practice
IDs are case-sensitive and use a URL-safe base64 alphabet, which is why they can contain - and _. They never change for the life of a video, even if the title, thumbnail or privacy setting does.
Other platforms have their own IDs — TikTok uses long numeric IDs, Instagram uses shortcodes — and the API's id field returns whichever the platform uses.
Why it matters when downloading video
- Use the
idfrom the response to name files and de-duplicate jobs. - You don't need to extract it yourself — the API accepts full URLs.
Extracting the ID yourself
const id = url.match(/(?:v=|youtu\.be\/|shorts\/|embed\/)([\w-]{11})/)?.[1];
FAQ
Are IDs always 11 characters?
Yes, for videos. Channel and playlist IDs are longer.
Related
Last updated 2026-10-25