Card image cap
Integrations/ May 29, 2021 ()

OpenGraphr + Vimeo: Extract Open Graph information from Vimeo videos using our API

We are happy to announce that we are successfully integrated with Vimeo! Now, with just an API call including a Vimeo link we will extract the metadata information from the video and give back to you the thumbnail, video title and description, and much more!

Extracting information from a Vimeo link

First of all, enter your profile and copy your token. You will need it for the following steps :-)

We will be making a GET request to the following API endpoint: https://api.opengraphr.com/v1/og.

To make a request, you will need to include your api_token and the requested url:

GET https://api.opengraphr.com/v1/og?api_token={YOUR_API_TOKEN}&url={YOUR_URL}.

By default, our API will cache results for a month, but you can refresh the cache by sending the force=1 parameter:

GET https://api.opengraphr.com/v1/og?api_token={YOUR_API_TOKEN}&url={YOUR_URL}&force=1.

Using our API to extract Vimeo metadata

Once the GET request is sent, you will get a response like this from our API. In this case, we are requesting the following URL: https://vimeo.com/553310558

{
    "title": "Apple \"Privacy. That's iPhone\"",
    "description": "Director: Rupert Sanders Production House: MJZ Producer: Laurie Boccaccio DoP: Jess Hall Production Designer: Jacqueline Abrahams Agency: TBWA",
    "image": "https:\/\/i.vimeocdn.com\/filter\/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1143208249_1280x720&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png",
    "url": "https:\/\/vimeo.com\/553310558",
    "raw": {
        "title": "Apple \u201cPrivacy. That\u2019s iPhone\u201d on Vimeo",
        "metadescription": "Director: Rupert Sanders Production House: MJZ Producer: Laurie Boccaccio DoP: Jess Hall Production Designer: Jacqueline Abrahams Agency: TBWA",
        "og_site_name": "Vimeo",
        "og_url": "https:\/\/vimeo.com\/553310558",
        "og_type": "video.other",
        "og_title": "Apple \"Privacy. That's iPhone\"",
        "og_description": "Director: Rupert Sanders Production House: MJZ Producer: Laurie Boccaccio DoP: Jess Hall Production Designer: Jacqueline Abrahams Agency: TBWA",
        "og_updated_time": "2021-05-29T11:17:32-04:00",
        "og_image": "https:\/\/i.vimeocdn.com\/filter\/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1143208249_1280x720&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png",
        "og_image_secure_url": "https:\/\/i.vimeocdn.com\/filter\/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1143208249_1280x720&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png",
        "og_image_type": "image\/jpg",
        "og_image_width": 1280,
        "og_image_height": 720,
        "og_video_url": "https:\/\/player.vimeo.com\/video\/553310558?autoplay=1",
        "og_video_secure_url": "https:\/\/player.vimeo.com\/video\/553310558?autoplay=1",
        "og_video_type": "text\/html",
        "og_video_width": 1280,
        "og_video_height": 720,
        "twitter_card": "player",
        "twitter_site": "@vimeo",
        "twitter_title": "Apple \"Privacy. That's iPhone\"",
        "twitter_description": "Director: Rupert Sanders Production House: MJZ Producer: Laurie Boccaccio DoP: Jess Hall Production Designer: Jacqueline Abrahams Agency: TBWA",
        "twitter_image": "https:\/\/i.vimeocdn.com\/filter\/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1143208249_1280x720&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png",
        "twitter_player": "https:\/\/player.vimeo.com\/video\/553310558",
        "twitter_player_width": 1280,
        "twitter_player_height": 720,
        "twitter_app_name_iphone": "Vimeo",
        "twitter_app_id_iphone": 425194759,
        "twitter_app_url_iphone": "vimeo:\/\/app.vimeo.com\/videos\/553310558",
        "twitter_app_name_ipad": "Vimeo",
        "twitter_app_id_ipad": 425194759,
        "twitter_app_url_ipad": "vimeo:\/\/app.vimeo.com\/videos\/553310558",
        "twitter_app_name_googleplay": "Vimeo",
        "twitter_app_id_googleplay": "com.vimeo.android.videoapp",
        "twitter_app_url_googleplay": "vimeo:\/\/app.vimeo.com\/videos\/553310558"
    }
}

And that's it! Easy, right? Now let's see some examples of how to implement this using actual code!

Extract Vimeo information using PHP

You can easily get the Open Graph information of a given Vimeo link by using the following script in PHP:

$token = 'YOUR_TOKEN';
$url = 'https://vimeo.com/553310558';

$requestUrl = 'https://api.opengraphr.com/v1/og?api_token=' . $token . '&url=' . urlencode($url);
$response = json_decode(file_get_contents($requestUrl), true);

var_dump($response);

Extract Vimeo information using JavaScript

You can easily get the Open Graph information of a given Vimeo URL by using the following script in plain JS:

const token = 'YOUR_TOKEN'
const url = 'https://vimeo.com/553310558'

const requestUrl = `https://api.opengraphr.com/v1/og?api_token=${token}&url=${encodeURIComponent(url)}`
fetch(requestUrl)
    .then(response => response.json())
    .then(og => {
        console.table(og)
    })

Extract Vimeo information using NodeJS

You can easily get the Open Graph information of a given Vimeo URL by using the following script in NodeJS:

const axios = require('axios')
const express = require('express')
const app = express()
const token = 'YOUR_TOKEN'

app.get('/site/info', async (req, res) => {
    const { url } = req.query
    const requestUrl = 'https://vimeo.com/553310558'

    const response = await axios.get(requestUrl, {
        params: {
            url,
            api_token: token,
            // force: 1,
        },
    })
    const og = response.data
    res.json(og)
})

app.listen(3000, function () {
    console.log('Example app listening on port 3000!')
})

Extract Vimeo information using C-Sharp

You can easily get the Open Graph information of a given Vimeo URL by using the following script in C#:

using System;
using System.Net;
using System.IO;
using Newtonsoft.Json;

namespace CSharpDemo
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            var token = 'YOUR_TOKEN';
            var url = 'https://vimeo.com/553310558';
            var urlEncoded = Uri.EscapeDataString(url);

            var requestUrl = "https://api.opengraphr.com/api/og?api_token=" + token + "&url=" + urlEncoded;

            var request = WebRequest.Create(requestUrl);
            request.ContentType = "application/json;";

            string text;

            var response = (HttpWebResponse)request.GetResponse();

            using (var sr = new StreamReader(response.GetResponseStream()))
            {
                text = sr.ReadToEnd();

                dynamic og = JsonConvert.DeserializeObject(text);

                Console.WriteLine("Title\t\t" + og.title);
                Console.WriteLine("Description\t" + og.description);
                Console.WriteLine("Image\t\t" + og.image);
            }
        }
    }
}

Extract Vimeo information using Python

You can easily get the Open Graph information of a given Vimeo URL by using the following script in Python:

import requests

TOKEN = 'YOUR_TOKEN'
url = 'https://vimeo.com/553310558'

endpoint = 'https://api.opengraphr.com/api/og'
response = requests.get(endpoint, params={ 'url': url, 'api_token': TOKEN }).json()
print(response)