user3659537
user3659537

Reputation: 1

Youtube Search for Videos in given Channel only

How can (a user) SEARCH FOR OUR VIDEOS BY KEYWORDS (Public Videos -- OUR Channel Only..)..

We were basing our approach in https://developers.google.com/youtube/v3/code_samples/javascript#search_by_keyword

We want to use API KEY for Authorization.. and Access is via browser.. (JS)

So when the user enters KEYWORDS in a Search box the CONTEXT (where to search) should already be the given Channel XXXX (its Public Videos)..

What would be the API/methods to use and with what params..??

Upvotes: 0

Views: 376

Answers (1)

jlmcdonald
jlmcdonald

Reputation: 13667

The search endpoint is the correct one to use, passing the keywords as the 'q' parameter and the channel as the 'channelId' parameter. So, using the sample function you linked to, you might try something like this:

 function search() {
  var q = $('#query').val();
  var request = gapi.client.youtube.search.list({
    q: q,
    part: 'snippet',
    channelId: {whatever your ID is}
  });

Upvotes: 1

Related Questions