0 votes
1.6k views
in General by
Hi, I want to get thumbnail image URL of a YouTube video dynamically using video ID. How to do this ?

1 Answer

0 votes
by

1) You can use the Youtube API to get the thumbnails
https://developers.google.com/youtube/v3/

Sample code can be found and downloaded from here.
https://code.google.com/archive/p/youtube-api-samples/downloads

2) Or - the easy way, to link with the default generated Youtube images on Google server.
You can call it directly always. eg:

http://img.youtube.com/vi/<youtube-video-id>/default.jpg and
http://img.youtube.com/vi/<youtube-video-id>/0.jpg
– These are full size thumb images

http://img.youtube.com/vi/<youtube-video-id>/mqdefault.jpg
– – This is medium default image

http://img.youtube.com/vi/<youtube-video-id>/maxresdefault.jpg
– – This is high resolution image

http://img.youtube.com/vi/<youtube-video-id>/1.jpg – small thumb
http://img.youtube.com/vi/<youtube-video-id>/2.jpg – small thumb
http://img.youtube.com/vi/<youtube-video-id>/3.jpg
– These are small thumb images

Related questions

0 votes
1 answer 1.5k views
+1 vote
1 answer 9.3k views
0 votes
1 answer 2.0k views
0 votes
1 answer 1.5k views
0 votes
1 answer 1.0k views
0 votes
1 answer 1.1k views
asked Oct 4, 2021 in General by Tester Testee (220 points)
...