0 votes
478 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 346 views
+1 vote
1 answer 2.9k views
0 votes
1 answer 433 views
0 votes
1 answer 419 views
0 votes
2 answers 7 views
+1 vote
1 answer 863 views
...