0 votes
515 views
asked 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
answered 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 381 views
+1 vote
1 answer 5.3k views
0 votes
1 answer 460 views
0 votes
1 answer 421 views
0 votes
2 answers 988 views
+1 vote
1 answer 957 views
...