How to Grab Youtube Video Thumbnail?

Getting the thumbnail of a Youtube video through it’s ID is not that hard. You just have to transform the URL a little bit to get a high quality JPG file, used as a main thumbnail through
[ad name=”In Post”]
All Youtube videos have their own unique ID which is 11 charcaters long. A typical Youtube video URL will look like this:

The part in bold is the part you are interested in. You can get it by using a simple explode() function.

After you get the ID you just need to point an image to the following URL structure:

Where the part in bold should be replaced with the specific video ID.

Using the above video as example will return this image:
grab youtube thumbnail of video

If you want to save it to your server and not hotlink the Youtube servers you can use something like cURL or file_get_contents.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.