Using vimeo's current API 3.0, and the stock Vimeo php library, my authenticated GET request for all videos by a certain user returns all the user's videos, but the data array for each video in the list does not include the basic video ID field anywhere.
It is not returned even when you do the call via Vimeo's API playground. This leads me to believe it is simply not returned in the data. I'm not filtering any of the fields, although I would like to eventually. The below example shows part of the complete dataset returned via the playground, and trust me there is no video_id field anywhere in there.
The video ID is the unique identifier for any video on Vimeo, and it can be found in the URI, of course. But it is not returned as a separate field in the complete serialized data for each video, as one might expect. The title and description fields, for example, are returned, but these are not unique identifiers for the video itself, only the ID is.
It's hard to believe one has to get the ID by trimming the URI, or the link.
I need the ID so I can tell which videos are already embedded in my website, and if any videos by the Vimeo user are new.
Here's a sample of returned data from a call. The first video data begins after the opening of the "data" array - the video_id is obviously 173001812, as you can tell from the URI. There are plenty more fields below the "embed" array, but there is no field for the video_id.
The old "Advanced" API did return the ID.
HTTP/1.1 200
Last-Modified: Tue, 12 Jul 2016 02:10:18 GMT
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 499
X-RateLimit-Reset: 2016-07-14T06:02:35+00:00
Content-Type: application/vnd.vimeo.video+json
Host: api.vimeo.com
{
"total": 176,
"page": 1,
"per_page": 25,
"paging": {
"next": "/users/468130/videos?page=2",
"previous": null,
"first": "/users/468130/videos?page=1",
"last": "/users/468130/videos?page=8"
},
"data": [
{
"uri": "/videos/173001812",
"name": "K2 Electric Foil Test 10R",
"description": "June 30, 2016.",
"link": "https://vimeo.com/173001812",
"duration": 28,
"width": 1920,
"language": null,
"height": 1080,
"embed": {
"uri": "/presets/212874",
"html": "<iframe src=\"https://player.vimeo.com/video/173001812?badge=0&autopause=0&player_id=0\" width=\"1920\" height=\"1080\" frameborder=\"0\" title=\"K2 Electric Foil Test 10R\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>",
"buttons": {
"like": false,
"watchlater": false,
"share": false,
"embed": false,
"hd": false,
"fullscreen": true,
"scaling": true
},
"logos": {
"vimeo": false,
"custom": {
I work for Vimeo...
This is correct, the numeric video ID is not returned as a standalone value anywhere. This is by design.
The unique identifier is actually the video's URI which is keyed to "uri" in the JSON response.