Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the search query work with Vimeo API for my videos (/me/videos)?

Description

I'm trying to understand how the "search query" via Vimeo API works. I've even tried it out via their "playground" on Vimeo API for developers.

video shopping vimeo api Screenshot of the playground on Vimeo. As you can see the query takes in a "string" but there is not description on how it works.

I'm attempting to find a video via the a keyword that I put in the title. I've used the playground to test and see how the query actually works.

What I've tried

Filling out the "query" text box in the image above with NOTHING returns 2 results.

{
    "total": 2,
    /* Rest of data here */
}

This is expected because I've only uploaded two videos so far.

I've attempted to put a word from the title in the query but they always return 0 results.

Here is the PHP code I'm using, which of course returns 0 results.

public function findVimeoVideoByKeyword($keyword) {
    $response = $this->lib->request('/me/videos', [
        'query' => $keyword
    ]);

    # handle response code here...
}

This is the return data that I've dumped when searching for a specific word in a title (0 results):

VimeoService.php on line 168:
array:3 [▼
  "body" => array:5 [▼
    "total" => 0 //0 results
    "page" => 1
    "per_page" => 25
    "paging" => array:4 [▶]
    "data" => []
  ]
  "status" => 200
  "headers" => array:20 [▶]
]

This is the data returned when I do not search for anything (3 results):

VimeoService.php on line 167:
array:3 [▼
  "body" => array:5 [▼
    "total" => 3 //3 results
    "page" => 1
    "per_page" => 25
    "paging" => array:4 [▶]
    "data" => array:3 [▶]
  ]
  "status" => 200
  "headers" => array:21 [▶]
]

Searching for a video by querying with the FULL title returns 0 results.

Question

How do I correctly use the "query" property to search for specific videos according to their title with Vimeo API ?

like image 651
kemicofa ghost Avatar asked Jul 12 '16 15:07

kemicofa ghost


People also ask

How does Vimeo API work?

The Vimeo API is a powerful toolset that lets developers deeply integrate Vimeo into their apps and services. To get started with the API, you'll need to create an API app and an authentication token. Visit our Developer Site for technical guides and reference documentation to help you get started.

How do I get private metadata from Vimeo private video?

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.


1 Answers

I went ahead and asked the same question on the VIMEO forums, and got a quick response from one of the devs.

When querying /me/videos only videos publicly available on vimeo.com are returned. Private videos are not indexed in search, and will not return when performing search queries.

I had originally thought that this was only for /videos and not for /me/videos

Apparently there is another approach for the search query to work on private videos.

Not yet implemented. We do have a workaround where if you enable Private Mode on your PRO account, you can then query videos on your account. Otherwise private videos are not available when performing search queries.

The key would be to put the PRO account in private mode which enables you to query videos on the account.

I have tested this. All that there is required to do is to set private mode by: Account Settings -> General -> Private Mode -> Enable It will then set your account to Private Mode and put all your videos as Private. The Search Query then works.

like image 97
kemicofa ghost Avatar answered Oct 27 '22 19:10

kemicofa ghost