views:

29

answers:

1

Is there any YouTube php wrapper that I can use to retrieve video's rating by their id?

+2  A: 

Use Zend/Google's PHP library. From Zend's Zend_Gdata_YouTube documentation:

<?php
  $yt = new Zend_Gdata_YouTube($httpClient,
                         $applicationId,
                         $clientId,
                         $developerKey);
?>

From the (perhaps better documented) Google site:

<?php
  $videoEntry = $yt->getVideoEntry('the0KZLEacs');
  echo 'Rating: ' . $videoEntry->getVideoRatingInfo() . "\n";
?>
Tim Lytle