Mitul Dabhi
answered Nov 30 '-1 00:00
Do not need cUrl or web api to get YouTube video thumbnail .
because it can be easily get by its Video id
https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
// High quality image - high quality thumbnail
https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg
// Medium Quality image - medium quality thumbnail
https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg
// Standard Quality image - thumbnail
https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg
PHP code to get YouTube video thumbnail image
$youtube_url="https://www.youtube.com/watch?v=952ACYyWgc4";
$data=explode("?v=",$youtube_url);
$image_url="https://img.youtube.com/vi/".$data[1]."/sddefault.jpg";
//short image $image_url="https://i3.ytimg.com/vi/".$data[1]."/sddefault.jpg";
echo "<img src='".$image_url."' />";