To get a YouTube video thumbnail via the YouTube API, you must first obtain a YouTube video id, which allows you to retrieve various YouTube video thumbnails. You may access video thumbnails in various sizes and resolutions using the YouTube API. You can get video thumbnails, captions, descriptions, ratings, statistics, and more using the YouTube Data API. To get YouTube video thumbnails, you’ll need to use API version 3 and a key.
There are four different resolutions: standard definition, medium quality, high quality, and maximum resolution. Different sizes are available, including 120X90, 320X180, 480X360, 640X480, 1280X720, and 1920X1080. https://i.ytimg.com/vi/ and https://img.youtube.com/vi/ are two urls for getting a YouTube video thumbnail.
To get all the information about a YouTube video, you can use the YouTube Video Information Generator tool with a YouTube URL or video id.
Default YouTube Video Thumbnail
The following url will get you the default YouTube thumbnail image. One of the thumbnails configured as default is used as the default thumbnail image.
https://img.youtube.com/vi/<video id>/default.jpg
https://i.ytimg.com/vi/<video id>/default.jpg
example
https://img.youtube.com/vi/PNISsMR92DB/default.jpg
size : 120 X 90
All YouTube Video image urls
For each YouTube video, four pictures are created. The size of the first image is accurate. The remaining images will be displayed as thumbnails.
https://img.youtube.com/vi/<video id>/0.jpg
https://img.youtube.com/vi/<video id>/1.jpg
https://img.youtube.com/vi/<video id>/2.jpg
https://img.youtube.com/vi/<video id>/3.jpg
https://img.youtube.com/vi/<video id>/default.jpg
https://i.ytimg.com/vi/<video id>/0.jpg
https://i.ytimg.com/vi/<video id>/1.jpg
https://i.ytimg.com/vi/<video id>/2.jpg
https://i.ytimg.com/vi/<video id>/3.jpg
https://i.ytimg.com/vi/<video id>/default.jpg
YouTube Videos By Resolution
Based on image resolution, there are four sorts of images available for YouTube video thumbnails. Standard definition, medium quality, high quality, and highest resolution are the options. For everyday use, a standard definition quality image will be displayed in a standard resolution. The resolution of the medium quality resolution image will be higher than that of the standard definition quality image. Image accuracy is ensured by using high-resolution pictures. The maximum quality resolution will display the image’s highest possible quality resolution.
Standard Definition Quality Resolution
https://img.youtube.com/vi/<video id>/sddefault.jpg
Size : 640 X 480
Medium Quality Resolution
https://img.youtube.com/vi/<video id>/mqdefault.jpg
Size : 960 X 640
High Quality Resolution
https://img.youtube.com/vi/<video id>/hqdefault.jpg
Size : 1280 X 720
Maximum Quality Resolution
https://img.youtube.com/vi/<video id>/maxresdefault.jpg
Size : 1920 X 1080
YouTube Data API (v3)
The YouTube Data API version 3 allows to retrieve YouTube video informations such as Caption, Description, Rating, Statistics, sizes. To get all the information, the api key is required along with YouTube video id.
https://www.googleapis.com/youtube/v3/videos?key=<API_KEY>&part=snippet&id=<VIDEO_ID>