Log In Register
c
You don't need to register or get any kind of API key from Youtube or Google. Getting thumbnails, title and duration (in seconds) of a Youtube video in PHP using free API:

<?php
$url = 'http://youtu.be/qPTfXwPf_HM';
//or:
//$url = 'https://www.youtube.com/watch?v=qPTfXwPf_HM';
$data = json_decode(file_get_contents('http://api.rest7.com/v1/youtube_info.php?url=' . $url));

if (@$data->success !== 1)
{
    die('Failed');
}
echo 'Video ID=' . $data->id . '<br>';
echo 'Title=' . $data->title . '<br>';
echo 'Duration sec=' . $data->duration . '<br>';
echo 'Thumbnail 1 URL=' . $data->thumb1_url . '<br>';
//rest of the thumbnails:
echo '<pre>';
print_r($data);