Oct. 17, 2012

How to use the Vimeo API in Python

Overview

In this post we will be looking on how to use the Vimeo API in Python. 

About the Vimeo API

Vimeo offers an API which lets us integrate with their site and build applications
on top of their data.

Vimeo provides a "Simple API" and an "Advanced API".

To perform authenticated read/write requests on videos, users, groups, channels,
albums, or upload, you will have to use the Advanced API.

It uses OAuth for authentication, so you will first need to sign up.

When using the Simple API, you don’t need to register or authenticate your app.

One of the drawback with using the Simple API is that it’s limited to public data
and is read-only. 

The response limits in the Simple API include up to 20 items per page.

Vimeos API provides different Response formats, and they all return the exact
same data.

Getting Started

After looking at the website of Vimeo, I found out that I can start out with this
URL: http://vimeo.com/api/v2/video/video_id.output

the video_id is the ID of the video you want information for.

the output specifies which type that we want (json, xml)

Common Vimeo Requests

Making a User Request
Making a Video Request
Making an Activity Request
Making a Group Request
Making a Channel Request
Making an Album Request

Using the Vimeo API to get data

This script will show how you can set up the script to make a Video request from
Vimeo.
import requests

import json

r = requests.get("http://vimeo.com/api/v2/video/48082757.json")

r.text

data = json.loads(r.text)

'do something with the data'
Vimeo has been kind enough to provide some API examples for us which can be found
on their GitHub repository. https://github.com/vimeo/vimeo-api-examples
More Reading
http://developer.vimeo.com/apis/

Recommended Python Training – DataCamp

For Python training, our top recommendation is DataCamp.

Datacamp provides online interactive courses that combine interactive coding challenges with videos from top instructors in the field.

Datacamp has beginner to advanced Python training that programmers of all levels benefit from.

 



Read more about:
Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, PythonForBeginners.com only recommend products or services that we try personally and believe will add value to our readers.