PHPackages                             vientodigital/vimeo-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. vientodigital/vimeo-api

ActiveLibrary[Image &amp; Media](/categories/media)

vientodigital/vimeo-api
=======================

Official PHP library for the Vimeo API.

3.0.7(5y ago)0501Apache-2.0PHPPHP &gt;=7.1.0

Since Oct 23Pushed 5y agoCompare

[ Source](https://github.com/VientoDigital/vimeo.php)[ Packagist](https://packagist.org/packages/vientodigital/vimeo-api)[ Docs](https://github.com/vimeo/vimeo.php)[ RSS](/packages/vientodigital-vimeo-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (4)Versions (27)Used By (1)

> This is a fork of the official PHP library for the Vimeo API modified to work with @composer.

[![Packagist](https://camo.githubusercontent.com/523e3b52b7ca91a435546cade4920cd82bb50bed1fe0ad4f891901febffca94f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76696d656f2f76696d656f2d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vimeo/vimeo-api)[![License](https://camo.githubusercontent.com/44a4df99f071575f521d47d46d742b3d6ce430906b47a3905548d8b0aff7f883/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76696d656f2f76696d656f2d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vimeo/vimeo-api)[![Travis CI](https://camo.githubusercontent.com/5606ec841ba71b0b4c8841c3807d98ff994b5ee3737888c48d0741547c9c3fc3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f76696d656f2f76696d656f2e7068702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/vimeo/vimeo.php)[![StyleCI](https://camo.githubusercontent.com/b8627985fa008fd8785073ed0d55f08ca6d73f5ce73c7a44ad4754562a438b0f/68747470733a2f2f7374796c6563692e696f2f7265706f732f393635343030362f736869656c643f7374796c653d666c61742d737175617265)](https://styleci.io/repos/9654006/)

This is a simple PHP library for interacting with the [Vimeo API](https://developers.vimeo.com).

- [Get started with the Vimeo API](#get-started-with-the-vimeo-api)
- [Direct Help](#direct-help)
    - [NOTE: How to use the PHP library with Vimeo dot notation documentation.](#note-how-to-use-the-php-library-with-vimeo-dot-notation-documentation)
- [Installation](#installation)
- [Usage](#usage)
    - [Generate your access token](#generate-your-access-token)
        - [Unauthenticated](#unauthenticated)
        - [Authenticated](#authenticated)
    - [Make requests](#make-requests)
        - [Usage](#usage-1)
        - [Response](#response)
    - [Uploading videos](#uploading-videos)
        - [Upload videos from the server](#upload-videos-from-the-server)
        - [Replace videos from the server](#replace-videos-from-the-server)
        - [Upload or replace videos from the client](#upload-or-replace-videos-from-the-client)
            - [Simple POST uploads](#simple-post-uploads)
            - [Streaming uploads](#streaming-uploads)
        - [Upload videos from a URL](#upload-videos-from-a-url)
    - [Upload images](#upload-images)
- [Troubleshooting](#troubleshooting)
- [Framework integrations](#framework-integrations)
- [Contributors](#contributors)

Get started with the Vimeo API
------------------------------

[](#get-started-with-the-vimeo-api)

There is a lot of information about the Vimeo API at . Most of your questions are answered there!

Direct Help
-----------

[](#direct-help)

- [Stack Overflow](http://stackoverflow.com/questions/tagged/vimeo-api)
- [Vimeo Support](https://vimeo.com/help/contact)

#### NOTE: How to use the PHP library with Vimeo dot notation documentation.

[](#note-how-to-use-the-php-library-with-vimeo-dot-notation-documentation)

The API docs often uses dot notation to represent a hierarchy of data, like this: `privacy.view`. Because this library sends all data using JSON, you must use nested associative arrays, not dot notation.

```
// The documentation refers to the following as `privacy.view`
$params = ['privacy' => ['view' => 'disable']];
```

Installation
------------

[](#installation)

1. Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
composer require vimeo/vimeo-api
```

Please note that this library requires at least PHP 7.1 installed. If you are on PHP 5.6, or PHP 7.0, please use install the package with the following:

```
composer require vimeo/vimeo-api ^2.0
```

2. Use the library `$lib = new \Vimeo\Vimeo($client_id, $client_secret)`.

Usage
-----

[](#usage)

### Generate your access token

[](#generate-your-access-token)

All requests require access tokens. There are two types of access tokens:

- [Unauthenticated](#unauthenticated) - Access tokens without a user. These tokens can view only public data.
- [Authenticated](#authenticated) - Access tokens with a user. These tokens interact on behalf of the authenticated user.

#### Unauthenticated

[](#unauthenticated)

Unauthenticated API requests must generate an access token. You should not generate a new access token for each request. Instead, request an access token once and use it forever.

```
// `scope` is an array of permissions your token needs to access.
// You can read more at https://developer.vimeo.com/api/authentication#supported-scopes
$token = $lib->clientCredentials(scope);

// usable access token
var_dump($token['body']['access_token']);

// accepted scopes
var_dump($token['body']['scope']);

// use the token
$lib->setToken($token['body']['access_token']);
```

#### Authenticated

[](#authenticated)

1. Build a link to Vimeo so your users can authorize your app.

```
$url = $lib->buildAuthorizationEndpoint($redirect_uri, $scopes, $state)
```

NameTypeDescription`redirect_uri`stringThe URI the user is redirected to in Step 3. This value must be provided to every step of the authorization process, including creating your app, building your authorization endpoint, and exchanging your authorization code for an access token.`scope`arrayAn array of permissions your token needs to access. You can read more at .`state`stringA value unique to this authorization request. You should generate it randomly and validate it in Step 3.2. Your user needs to access the authorization endpoint (either by clicking the link or through a redirect). On the authorization endpoint, the user will have the option to deny your app any scopes you have requested. If they deny your app, they are redirected back to your `redirect_url` with an `error` parameter.
3. If the user accepts your app, they are redirected back to your `redirect_uri` with a `code` and `state` query parameter (eg. [http://yourredirect.com?code=abc&amp;state=xyz](http://yourredirect.com?code=abc&state=xyz)).

    1. You must validate that the `state` matches your state from Step 1.
    2. If the state is valid, you can exchange your code and `redirect_uri` for an access token.

```
// `redirect_uri` must be provided, and must match your configured URI
$token = $lib->accessToken(code, redirect_uri);

// Usable access token
var_dump($token['body']['access_token']);

// Accepted scopes
var_dump($token['body']['scope']);

// Set the token
$lib->setToken($token['body']['access_token']);
```

For additional information, check out the [example](https://github.com/vimeo/vimeo.php/blob/master/example/auth.php).

### Make requests

[](#make-requests)

The API library has a `request` method that takes three parameters. It returns an associative array containing all of the relevant request information.

#### Usage

[](#usage-1)

NameTypeDescription`url`stringThe URL path (e.g.: `/users/dashron`).`params`stringAn object containing all of your parameters (e.g.: `{ "per_page": 5, "filter" : "featured"}` ).`method`stringThe HTTP method (e.g.: `GET`).```
$response = $lib->request('/me/videos', ['per_page' => 2], 'GET');
```

#### Response

[](#response)

The response array contains three keys.

NameTypeDescription`body`arrayThe parsed request body. All responses are JSON, so we parse this for you and give you the result.`status`numberThe HTTP status code of the response. This partially informs you about the success of your API request.`headers`arrayAn associative array containing all of the response headers.```
$response = $lib->request('/me/videos', ['per_page' => 2], 'GET');
var_dump($response['body']);
```

### Uploading videos

[](#uploading-videos)

#### Upload videos from the server

[](#upload-videos-from-the-server)

To upload videos, you must call the `upload` method. It accepts two parameters. It returns the URI of the new video.

Internally, this library executes a `tus` upload approach and sends a file to the server with the [tus](https://tus.io/) upload protocol.

For more information, check out the [example](https://github.com/vimeo/vimeo.php/blob/master/example/upload.php)

NameTypeDescription`file`stringFull path to the upload file on the local system.`params`arrayParameters to send when creating a new video (name, privacy restrictions, etc.). See the [`/me/videos` documentation](https://developer.vimeo.com/api/endpoints/videos#POST/users/%7Buser_id%7D/videos) for supported parameters.```
$response = $lib->upload('/home/aaron/Downloads/ada.mp4')

// With parameters.
$response = $lib->upload('/home/aaron/Downloads/ada.mp4', [
    'name' => 'Ada',
    'privacy' => [
        'view' => 'anybody'
    ]
])
```

#### Replace videos from the server

[](#replace-videos-from-the-server)

To replace the source file of a video, you must call the `replace` method. It accepts two parameters. It returns the URI of the replaced video.

NameTypeDescription`video_uri`stringThe URI of the original video. Once uploaded and successfully transcoded, your source video file is swapped with this new video file.`file`stringFull path to the upload file on the local system.```
$response = $lib->replace('/videos/12345', '/home/aaron/Downloads/ada-v2.mp4')
```

#### Upload or replace videos from the client

[](#upload-or-replace-videos-from-the-client)

To upload from the client, you must mix some server-side and client-side API requests. We support two workflows, the first of which is much easier than the second.

##### Simple POST uploads

[](#simple-post-uploads)

This workflow is well documented on Vimeo's developer site. You can read more here: .

##### Streaming uploads

[](#streaming-uploads)

Streaming uploads support progress bars and resumable uploading. If you want to perform these uploads client-side, you need to start with some server-side requests.

Read through the [Vimeo documentation](https://developer.vimeo.com/api/upload/videos#resumable-upload) first. Steps 1 and 4 should be performed on the server, while Steps 2 and 3 can be performed on the client. With this workflow, the video is never transferred to your servers.

#### Upload videos from a URL

[](#upload-videos-from-a-url)

Uploading videos from a public URL (also called "pull uploads") uses a single, simple API call.

```
$video_response = $lib->request(
    '/me/videos',
    [
        'upload' => [
            'approach' => 'pull',
            'link' => $url
        ],
    ],
    'POST'
);
```

### Upload images

[](#upload-images)

To upload an image, call the `uploadImage` method. It takes three parameters.

For more information check out the [example](https://github.com/vimeo/vimeo.php/blob/master/example/upload_image.php).

NameTypeDescription`pictures_uri`stringThe URI to the pictures collection for a single resource, such as `/videos/12345/pictures`. You can always find this in the resource representation.`file`stringFull path to the upload file on the local system.`activate`boolean(Optional) Defaults to `false`. If true, this picture will become the default picture for the associated resource.```
$response = $lib->uploadImage('/videos/12345/pictures', '/home/aaron/Downloads/ada.png', true)
```

Troubleshooting
---------------

[](#troubleshooting)

If you have any questions or problems, create a [ticket](https://github.com/vimeo/vimeo.php/issues) or [contact us](https://vimeo.com/help/contact).

Framework integrations
----------------------

[](#framework-integrations)

- **WordPress** -
- **Laravel** -

If you have integrated Vimeo into a popular PHP framework, let us know!

Contributors
------------

[](#contributors)

To see the contributors, please visit the [contributors graph](https://github.com/vimeo/vimeo.php/graphs/contributors).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~58 days

Total

26

Last Release

2172d ago

Major Versions

1.3.0 → 2.0.02018-02-06

2.0.5 → 3.0.0-RC12018-11-15

PHP version history (2 changes)v1.1.0PHP &gt;=5.3.0

3.0.0-RC1PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/488202a656e6be4d5992b6c2d7bb91155587fa7144279b5c52f671b5d88eb24e?d=identicon)[victoryoalli](/maintainers/victoryoalli)

---

Top Contributors

[![Dashron](https://avatars.githubusercontent.com/u/218751?v=4)](https://github.com/Dashron "Dashron (43 commits)")[![erunion](https://avatars.githubusercontent.com/u/33762?v=4)](https://github.com/erunion "erunion (27 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (25 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (16 commits)")[![greedo](https://avatars.githubusercontent.com/u/410872?v=4)](https://github.com/greedo "greedo (10 commits)")[![Sventour](https://avatars.githubusercontent.com/u/5223394?v=4)](https://github.com/Sventour "Sventour (6 commits)")[![victoryoalli](https://avatars.githubusercontent.com/u/141497?v=4)](https://github.com/victoryoalli "victoryoalli (3 commits)")[![craigpotter](https://avatars.githubusercontent.com/u/1442635?v=4)](https://github.com/craigpotter "craigpotter (2 commits)")[![davekiss](https://avatars.githubusercontent.com/u/1256071?v=4)](https://github.com/davekiss "davekiss (2 commits)")[![muglug](https://avatars.githubusercontent.com/u/2292638?v=4)](https://github.com/muglug "muglug (1 commits)")[![panchesrbovski](https://avatars.githubusercontent.com/u/4184038?v=4)](https://github.com/panchesrbovski "panchesrbovski (1 commits)")[![MichalMMac](https://avatars.githubusercontent.com/u/3882687?v=4)](https://github.com/MichalMMac "MichalMMac (1 commits)")[![qzminski](https://avatars.githubusercontent.com/u/193483?v=4)](https://github.com/qzminski "qzminski (1 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (1 commits)")[![karlhorky](https://avatars.githubusercontent.com/u/1935696?v=4)](https://github.com/karlhorky "karlhorky (1 commits)")[![urakozz](https://avatars.githubusercontent.com/u/5797393?v=4)](https://github.com/urakozz "urakozz (1 commits)")[![hluup](https://avatars.githubusercontent.com/u/154532?v=4)](https://github.com/hluup "hluup (1 commits)")[![videoMonkey](https://avatars.githubusercontent.com/u/126849?v=4)](https://github.com/videoMonkey "videoMonkey (1 commits)")[![dstelljes](https://avatars.githubusercontent.com/u/8119229?v=4)](https://github.com/dstelljes "dstelljes (1 commits)")

---

Tags

videovimeo

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vientodigital-vimeo-api/health.svg)

```
[![Health](https://phpackages.com/badges/vientodigital-vimeo-api/health.svg)](https://phpackages.com/packages/vientodigital-vimeo-api)
```

###  Alternatives

[vimeo/vimeo-api

Official PHP library for the Vimeo API.

4617.6M38](/packages/vimeo-vimeo-api)[vimeo/laravel

A Vimeo bridge for Laravel

4191.7M4](/packages/vimeo-laravel)[jonnitto/plyr

Plyr.io for Neos.io

1236.7k2](/packages/jonnitto-plyr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
