YouTube/Vimeo API - MP4 files

17,185

Solution 1

First of all, according to API 3 Link to video not showing Vimeo is now handling API support here with additional support via Email.

For a PRO account, here are the steps to accessing MP4 files for your videos on Vimeo using the new V3 API:

  1. Create a new Vimeo app here: https://developer.vimeo.com/apps/new
  2. Once created, click on the oAuth2 button at the top and copy your access token.
  3. Make a GET request to https://api.vimeo.com/videos/VIDEO_ID and add the Header "Authorization : Bearer ACCESS_TOKEN" where VIDEO_ID is the ID in the standard Vimeo URL and ACCESS_TOKEN is the token from #2.

This will return a "files" key that includes multiple video sizes.

If you're not a PRO user or are attempting to access files uploaded by other users, this link seems to do the trick: http://player.vimeo.com/v2/video/VIDEO_ID/config. This only works if the video is downloadable.

Solution 2

In ASP or c# you can use below code, this will return you json string

        string url = "https://api.vimeo.com/me/videos/" + videoId;


        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

        request.Method = "GET";
        request.Accept = "application/vnd.vimeo.*+json;version=3.0";


        request.Headers.Add(HttpRequestHeader.Authorization, "Bearer YOUR_ACCESS_TOKEN");
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();

        Stream resStream = response.GetResponseStream();

        var reader = new StreamReader(resStream);

        string jsonResponse = reader.ReadToEnd();

Solution 3

On Vimeo, PRO users have direct access to all of their video file links through the New API.

This includes any formats they generate (hd, sd, etc) and an hls stream.

Share:
17,185
STeN
Author by

STeN

Smartphones/SmartTVs/HbbTV and NFC technology is my experience and background as developer and application architect for more then 10 years. @PetrMazanec

Updated on June 05, 2022

Comments

  • STeN
    STeN almost 2 years

    I think YouTube or Vimeo does not have (even paid) any longer API, that will allow me streaming with use of the progressive download the video files (MP4, MPEG-TS or even FLV) I have uploaded there, right?

    Is there possibly other platform have such API?

    Petr

  • STeN
    STeN about 10 years
    Thanks - any idea about the YouTube?
  • rilar
    rilar about 10 years
    Please explain how I access the .mp4 file in my Vimeo PRO. Cant find it nowhere in the New API docs.
  • Dashron
    Dashron about 10 years
    When requesting a video resource (either directly through /videos/id, or through a collection like /groups/id/videos) there should be a "files" key on the response.
  • AJB
    AJB about 9 years
    FFS. I'm searching in circles now. Back to the same erroneous answer. Did I mention how much I hate, hate, hate Vimeo and their insane API?
  • AJB
    AJB about 9 years
    All of this, just to get a goddamned MP4 URL? Seriously?
  • Dashron
    Dashron about 9 years
    If you want to just copy and paste it, it's on your clip settings. If you want it via code Vimeo needs to ensure these urls are kept secret by using modern, standard practices of authentication tokens and a structured url framework. If you can not find the urls please contact VImeo through direct support channels (vimeo.com/help/contact) and provide your exact request (including url and access token)
  • Dashron
    Dashron over 8 years
    Note that the player.vimeo.com url is not a supported, standard method for accessing video files. It can, and will change at the will of Vimeo's development team, without any notification to the public.
  • nrutas
    nrutas over 8 years
    the URL has changed -- the "v2" part is now gone. the rest remains. player.vimeo.com/video/VIDEOIDHERE/config