How to get Youtube Video Thumbnail Images

March 04, 2018

Problem

You know your youtube URL. And, you want to know its thumbnail image that you can use on your website, or somewhere. Note: Video can be any video on youtube.com website.

Get Youtube Thumbnail Images

Youtube provides video's thumbnails publically available to users. Anyone can use them. Youtube provides multiple resolution images. You need to know the video id.

If your youtube video looks like:https://www.youtube.com/watch?v=g0kFl7sBdDQ

Then, your video id is:g0kFl7sBdDQ

There are two ways to get thumbnail URL:

  1. Get URL from any of following possible URLs:
    1. https://i.ytimg.com/vi/<video_id>/default.jpg
      Having dimensions: 120x90
      This is the default image.
    2. https://i.ytimg.com/vi/<video_id>/mqdefault.jpg
      Having dimensions: 320x180
      This is called medium size thumbnail.
    3. https://i.ytimg.com/vi/<video_id>/hqdefault.jpg
      Having dimensions: 480x360
      This is called high size thumbnail.
    4. https://i.ytimg.com/vi/<video_id>/sddefault.jpg
      Having dimensions: 640x480
      This is called standard size.
    5. https://i.ytimg.com/vi/<video_id>/maxresdefault.jpg
      Having dimensions: 1280x720
      This is the maximum resolution available
  2. Use Youtube Rest APIs
    See: Using Youtube Rest APIs

Enjoy.


Similar Posts

Latest Posts