Cracking the code of Vimeo’s latest API and making video downloads a long overdue reality.

Recently, Vimeo launched V3 of its API (currently in beta) with a limited set of functions available for Pro accounts.

The endpoint we’re going to analyze today is “videos/clip_id”. For a full list of endpoints you might want to have a look here.

The idea behind this API call is to grab the response object, parse it and extract the clip download URL.

As I don’t want to tie this write-up to a specific programming language, I’m only going to explain the concept which then applies to any server side programming language that can perform a simple Http Web Request and I’ll leave the parsing part in your hands.

One of the tools I like for testing APIs is cUrl.  If you’re feeling lazy (like me) and simply want an installer, you can find one here.

Good, now that we have a neat command line testing tool for APIs we can dive into the Vimeo part.

To enable Vimeo’s V3 API, assuming that you already have a Vimeo PRO account, you will need to create a new app at https://developer.vimeo.com/apps/new?oauth2=enabled, or enable oauth2 for an existing application by adding “?oauth2=enabled” at the end of your apps edit page. For the moment there doesn’t seem to be any other way to enable oauth2 and so it took me two days to find out the querystring trick – imagine how lucky you are!

Once the app is created and oauth2 enabled, grab the “Client Identifier” and “Access Token” and simply run the following cUrl command :

curl –header “Authorization: Bearer ACCESS_TOKEN” https://api.vimeo.com/videos/CLIP_ID?client_id=CLIENT_IDENTIFIER

In a nutshell, the above translates to programming as an HTTP Web Request where the response JSON object will contain a video download link.  Yet again, doing an Http Web Request on the download link itself will get you the byte array of the video file which can then be programatically copied into a memory stream and outputted as an application/octet-stream for the download purpose.

Follow me @alexpana_dan.

We make good ideas great. The difference is execution. www.thedevelopmentfactory.com

 

  • Elliot Rock

    Interesting information