APIs /
oEmbed
oEmbed is an open standard for embedding videos and/or images into a website. To find out more about oEmbed, view the spec.
Endpoint
You can use the API endpoint to request the embed code for a video from its URL. The response format can be either xml or json.
http://vimeo.com/api/oembed.format
Vimeo videos can use one of three URL schemes:
http://vimeo.com/*
http://vimeo.com/channels/*/*
http://vimeo.com/groups/*/videos/*
If you supply a channel video URL, extra data about that channel will be returned with the response. Similarly, you’ll get data about a group if you use the group URL.
All of the above URLs will also work with HTTPS.
Discovery
Vimeo supports discovery of the oEmbed URL. Each page that has a video will have two link tags with types application/json+oembed and application/xml+oembed containing the URLs for JSON and XML oEmbed responses.
Arguments
All arguments are sent as query parameters and must be urlencoded (as per RFC 1738).
| url | (required) The Vimeo URL for a video. |
| width | The exact width of the video. Defaults to original size. |
| maxwidth | Same as width, but video will not exceed original size. |
| height | The exact height of the video. Defaults to original size. |
| maxheight | Same as height, but video will not exceed original size. |
| byline | Show the byline on the video. Defaults to true. |
| title | Show the title on the video. Defaults to true. |
| portrait | Show the user’s portrait on the video. Defaults to true. |
| color | Specify the color of the video controls. |
| callback | When returning JSON, wrap in this function. |
| autoplay | Automatically start playback of the video. Defaults to false. |
| loop | Play the video again automatically when it reaches the end. Defaults to false. |
| xhtml | Make the embed code XHTML compliant. Defaults to false. |
| api | Enable the Javascript API for Moogaloop. Defaults to false. |
| wmode | Add the "wmode" parameter. Can be either transparent or opaque. |
| iframe | Use our new embed code. Defaults to true. |
If the owner of a video is a Plus member, some of these settings may be overridden by their preferences. is_plus is provided in the response to alert you when the owner is a Plus member.
Examples
These are sample responses (they have been shortened for formatting). If a group video URL is used, additional data will be returned about the group. If a video’s privacy is set to anything other than public or password protected, only the embed code, width, and height will be returned.
XML
http://vimeo.com/api/oembed.xml?url=http%3A//vimeo.com/7100569
<?xml version="1.0" encoding="utf-8"?>
<oembed>
<type>video</type>
<version>1.0</version>
<provider_name>Vimeo</provider_name>
<provider_url>http://vimeo.com/</provider_url>
<title>Brad!</title>
<author_name>Casey Donahue</author_name>
<author_url>http://vimeo.com/caseydonahue</author_url>
<is_plus>1</is_plus>
<html><iframe src="http://player.vimeo.com/video/7100569" width="1280" height="720" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></html>
<width>1280</width>
<height>720</height>
<duration>118</duration>
<description>Brad finally gets the attention he deserves.</description>
<thumbnail_url>http://b.vimeocdn.com/ts/294/128/29412830_1280.jpg</thumbnail_url>
<thumbnail_width>1280</thumbnail_width>
<thumbnail_height>720</thumbnail_height>
<video_id>7100569</video_id>
</oembed>
JSON
http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/7100569
{
"type": "video",
"version": "1.0",
"provider_name": "Vimeo",
"provider_url": "http:\/\/vimeo.com\/",
"title": "Brad!",
"author_name": "Casey Donahue",
"author_url": "http:\/\/vimeo.com\/caseydonahue",
"is_plus": "1",
"html": "<iframe src=\"http:\/\/player.vimeo.com\/video\/7100569\" width=\"1280\" height=\"720\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>",
"width": 1280,
"height": 720,
"duration": 118,
"description": "Brad finally gets the attention he deserves.",
"thumbnail_url": "http:\/\/b.vimeocdn.com\/ts\/294\/128\/29412830_1280.jpg",
"thumbnail_width": 1280,
"thumbnail_height": 720,
"video_id": 7100569
}
PHP and Javascript Examples
We have two examples for you: a really basic example for embedding a specific video on a page, and a fancier one that grabs and embeds the latest video from a user. Both examples are available from our API Examples repo on GitHub.