Skip to content

Instantly share code, notes, and snippets.

@bacoords
Last active March 19, 2026 09:40
Show Gist options
  • Select an option

  • Save bacoords/77ee4d13dfa76db03981cb4eb0df0c6f to your computer and use it in GitHub Desktop.

Select an option

Save bacoords/77ee4d13dfa76db03981cb4eb0df0c6f to your computer and use it in GitHub Desktop.
Grab a thumbnail of a private (but embeddable) Vimeo video
<?php
/**
* Grab the url of a publicly embeddable video hosted on vimeo
* @param str $video_url The "embed" url of a video
* @return str The url of the thumbnail, or false if there's an error
*/
function grab_vimeo_thumbnail($vimeo_url){
if( !$vimeo_url ) return false;
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) );
if( !$data ) return false;
return $data->thumbnail_url;
}
@sigkappel
Copy link
Copy Markdown

I just removed the resolution entirely and it give me the highest resolution image
return explode('_', $data->thumbnail_url)[0]

@Harsh-finology
Copy link
Copy Markdown

Does this work for private videos as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment