How to get an image of a YouTube video

Posted 2 years ago

YouTube makes it really easy for you to return images from a video.

Each video will generate 4 individual images, accessed here.

// Background Thumbnail (480x360 pixels)

https://img.youtube.com/vi/<youtube-id-here>/0.jpg 

// Thumbnail (120x90 pixels)

https://img.youtube.com/vi/<youtube-id-here>/1.jpg 

// Middle Thumbnail (120x90 pixels)

https://img.youtube.com/vi/<youtube-id-here>/2.jpg 

// Final Thumbnail (120x90 pixels)

https://img.youtube.com/vi/<youtube-id-here>/3.jpg 


You can also return a bunch of other images.

// default image

https://img.youtube.com/vi/<youtube-id-here>/default.jpg

// High Quality Thumbnail (480x360 pixels)

https://img.youtube.com/vi/<youtube-id-here>/hqdefault.jpg

// Medium Quality Thumbnail (320x180 pixels)

https://img.youtube.com/vi/<youtube-id-here>/mqdefault.jpg

// Standard Definition Thumbnail (640x480 pixels)

https://img.youtube.com/vi/<youtube-id-here>/sddefault.jpg

// Max Res Thumbnail (1280x720 pixels)

https://img.youtube.com/vi/<youtube-id-here>/maxresdefault.jpg

You can additional use the short domain to return images.

https://i1.ytimg.com/vi/<youtube-id-here></maxresdefault.jpg