Perhaps you want to get the thumbnail for a YouTube video so that you can display it on your web site or other application.

Assume you have a video URL like the following:

https://www.youtube.com/watch?v=dQw4w9WgXcQ

All you have to do in order to get the image for this particular video is look at the last part of the url, or in other words, the value for the query parameter "v". 

In this case, the value of "v" is "dQw4w9WgXcQ".

Now open up a web browser and in the url bar enter the following:

img.youtube.com/vi/dQw4w9WgXcQ/0.jpg

That URL will give you the image you see here.

The image that is described above is the main image for the video. But there are also different images you can get which are thumbnail images obtained by using the following URLs:

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

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

img.youtube.com/vi/dQw4w9WgXcQ/3.jpg

Those are three different small thumbnail images for the video.

That is the quick and easy way to get a YouTube video's images assocated with it. More is explained by janykste on this StackOverflow discussion.

YouTube's API also allows for a way to programmatically retrieve YouTube video thumbnails and images.

Share

Comments (0)

No comments found!

Write new comment