How to get thumbnail from Youtube using youtube API

Mahabubur Rahman
0
I have a youtube video link. I want to get a thumb image from this image. Is there any way to get thumb image from a youtube link by using Youtube API ?
The answer will be of-course.

Each Youtube video has 4 generated images. There are approximately as below-

http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first link in the list is full image size and other links in the list are thumb images. The default image is -
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality thumb image of the video use a link same as follow-
http://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg  
For the maximum resolution  thumb image of the video use a link as follow-
http://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg 
For the medium quality thumb image size of the video use a link same as follow -
http://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg
For the standard quality thumb image of the video use a link as follow -
http://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg
All of above links are available on https. Just change http to https.

You can also use the YouTube Data API (v3)  or the older YouTube API v2.0  to get thumbnail images.

Tags

Post a Comment

0Comments
Post a Comment (0)