Published on Apr 21, 2020

How to get Thumbnail URL and other info from a Vimeo ID in WordPress

Sridhar Katakam

If you are looking to get thumbnail URL or other data like the video title from the video ID for public videos on Vimeo in your WordPress site, here’s a handy function that uses Vimeo’s oEmbed endpoints:

* Grab the specified data like Thumbnail URL of a publicly embeddable video hosted on Vimeo.
* @param  str $video_id The ID of a Vimeo video.
* @param  str $data 	  Video data to be fetched
* @return str            The specified data
function get_vimeo_data_from_id( $video_id, $data ) {
$request = wp_remote_get( '' . $video_id );
$response = wp_remote_retrieve_body( $request );
$video_array = json_decode( $response, true );
return $video_array[$data];

Sample usage:

echo get_vimeo_data_from_id( '158115405', 'thumbnail_url' );


Available data:

If you want to see the contents of the array, you could

echo '<pre>';
print_r( $video_array );
echo '</pre>';


$video_array = json_decode( $response, true );