PHP Snippet: get Vimeo image thumbnails

Today I programmed a gallery of Vimeo videos.
The gallery was a list of images. These images were video previews with a link to detail page of the video.

In order to get the images of each video I’ve been searching in Vimeo API

This snippet of PHP can get images from any Vimeo video using its URL.

$id = <Vimeo video ID>;
$vimeo = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$id.php"));
$small = $vimeo[0]['thumbnail_small'];
$medium = $vimeo[0]['thumbnail_medium'];
$large = $vimeo[0]['thumbnail_large'];

For example, consider this video:
vimeo.com/15786406

It will be sufficient to use the snippet and assign to $id the number 15786406. The variables $small, $medium and $large will be small, medium and large vimeo thumbnail images respectively.

This entry was tagged as

5 responses to PHP Snippet: get Vimeo image thumbnails

  1. suraj

    thanks a lot for the big help

  2. You’re welcome :)

  3. Thanks – this was exactly what I was looking for and far less complicated than the other solutions I found.

  4. Kurt

    How is this done if the video is set to private. I created an App and have an API Key but I can’t find a solution for displaying thumbnails of videos that are set to private.

  5. Hi Kurt, this post was written using the old api. Check this link:
    http://stackoverflow.com/questions/28038654/show-thumbnails-from-private-vimeo-videos

Leave a Reply

Your email address will not be published.