Get URL/Embed code to private Vimeo videos programatically
Asked Answered
S

1

9

We've been long time users of Vimeo PRO, we use it to host our videos that are shown in multiple websites. Those videos are set to private, so they can't be found in the public part of Vimeo. Until now, whenever we needed to show a video, we would either get the embed code from Vimeo or copy the "direct link" (i.e. http://player.vimeo.com/external/1234567890.hd.mp4?s=nskljdfnsdlkn3498hnc3h49fo83h4oif3) to the video file of the desired quality and load it on a third party player. No issues at all doing all this.

Now we're going to start handling a lot more videos, so I've been looking at a way of automatizing the process of obtaining those embed codes or direct links. Looks like the way to go is by using the Vimeo API.

However, I've started looking into it and I'm pretty confused. It talks about registering apps, give users permissions when they request access, and other things that seem an overkill for what I really need.

We have no apps to register or multiple users to grant access, we just have our Vimeo username/password and the idea is to code a function that can be used in different websites to request a video URL or its embed code based on its Vimeo ID.

Am I looking in the wrong place? If not, what "app" should I register? Every single website that's going to use a video from Vimeo? (we have dozens)

If the Vimeo API is the only way to go, could someone link to an example as simple as possible for the kind of usage we need?

Thanks!

Starchy answered 19/12, 2014 at 0:31 Comment(0)
B
11

The Vimeo API is the right system to use, and I'll describe briefly what will work best for your described workflow.

  1. Register an API app on https://developer.vimeo.com/apps

This is necessary for every API app. We need to know who is using our system, and how to contact them if necessary.

  1. Generate an access token.

There is general documentation at https://developer.vimeo.com/api/authentication, but you will likely be using the "single user application" workflow. It's a lofty title for "generate an access token via the UI on your application page, then hard code it into your app". This access token will interact with the API on behalf of the user who registered the application.

  1. Request your video information.

There are many different API calls to get video information. You can find these at https://developer.vimeo.com/api/endpoints. /me/videos will show all of the authenticated users videos, /videos/{video_id} will show a single video.

Bashee answered 2/1, 2015 at 15:18 Comment(5)
Is the following scenario possible using the API? After registering the app and get access token, set in vimeo video privacy as "Only me". In my app, programmatically authenticate as myself, using Oauth, then request video information using the video endpoint and embed the video, without requiring the user to enter any password.Comanchean
I am facing same situation as @JuanguiJordán but i couldn't get video information by set privacy as "Only me", i had authenticate as myself using Oauth but there is no private video information get.Typebar
If you are only ever going to access your own videos you should generate a new access token via your app settings. Once you have that token, any API request to one of your videos (or a collection of your videos such as GET /me/videos) should include all private information about that video.Bashee
hi Dashron, I am receiving information but only as player urls. I need the mp4 file link which can be obtained by /video_id/config. btw the videos are private so I am accessing them via api. how can I get video links as sd, hd etc..Isagogics
Hey Alp, you must have a pro or business account, you must own the api app and the video and you must have an authenticated access token tied to your user account, with the private and video_files scopes. We will have more detailed docs soon. Write into support if you have more questions!Bashee

© 2022 - 2024 — McMap. All rights reserved.