Grabbing YouTube’s Thumbnail Image

Sometimes there are simple solutions to life’s little problems. I had a need to get the thumbnail image associated with a YouTube video. I spent ages mucking around in the browser code inspector trying to work out how I could achieve this without much success.

Turns out that there is a simple, repeatable way using YouTube’s built-in thumbnail URLs

Get the Video ID

Every YouTube video has a predictable thumbnail URL, for example: https://www.youtube.com/watch?v=dQw4w9WgXcQ. Go on, click it, you know you want to!

So generically this is:

https://www.youtube.com/watch?v=VIDEO_ID

And in our example above the ID is dQw4w9WgXcQ.

Get Images

Read the rest