Using Youtube Thumbnails on your Websites

YouTube takes screenshots of the videos you upload. Here is a quick reference of how you do this on your webpage. Each YouTube video has 4 generated images. The first is a full size cover image and the rest are thumbnail images:

480×360: http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

120×90: http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

120×90: http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg

120×90: http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg

The default thumbnail image (i.e. one of 0.jpg, 1.jpg, 2.jpg, 3.jpg) is:

120×90: http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg

For the high quality version and medium quality version of the thumbnail:

480×360: http://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg

320×180: http://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg

For the maximum resolution version of the thumbnail, the size depends on the video quality:

http://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg

All of the above urls are available over https too. Just change http to https in any of the above urls.

Alternatively, you can use the YouTube API to get thumbnail images.

Happy Coding 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s