How to get thumbnail image from YouTube videos?

By Faruque Ahamed Mollick

Hello, guys! I hope you will like this post. In this post, I am going to tell you how to get the thumbnail image of any YouTube video.

YouTube automatically generate 4 types of the thumbnail image. You will able to get each thumbnail image from these URL given below:

https://img.youtube.com/vi/YouTube_Video_ID/0.jpg

https://img.youtube.com/vi/YouTube_Video_ID/1.jpg

https://img.youtube.com/vi/YouTube_Video_ID/2.jpg

https://img.youtube.com/vi/YouTube_Video_ID/3.jpg



The first URL which ends with 0.jpg will load the full-size image and all the other URLs (1.jpg, 2.jpg, 3.jpg) will load thumbnail with different size.

If you want to get thumbnail which is not automatically generated by YouTube and uploaded by the uploader then the above URLs will not work. You just need to change the URL structure. Below is the given URLs:

To load the default quality thumbnail use the URL similar to this:

https://img.youtube.com/vi/YouTube_Video_ID/default.jpg

To load the high-quality version of the thumbnail use an URL similar to this:

https://img.youtube.com/vi/YouTube_Video_ID/hqdefault.jpg

You can also load a medium quality version of the thumbnail for particular YouTube video, using an URL similar to:

https://img.youtube.com/vi/YouTube_Video_ID/mqdefault.jpg

The below URL will load the standard definition of the thumbnail:

https://img.youtube.com/vi/YouTube_Video_ID/sddefault.jpg

To load the maximum resolution version of the thumbnail use an URL similar to this:

https://img.youtube.com/vi/YouTube_Video_ID/maxresdefault.jpg

 

In all of the above image URL, you have to put the video id by replacing YouTube_Video_ID. You will easily get the ID for each youtube video from the Video URL. For example:

youtube.com/watch?v=Os_NuASrVvI&t

The red part of the above URL is the YouTube video id for that particular YouTube video. With this way, you will able to get video id for any YouTube video.

At the end, I want to inform you that you can use i3.ytimg.com works in place of img.youtube.com and it is also available over http.

Leave a Reply

Your email address will not be published. Required fields are marked *