16

For example, how could I get a JSON response of all the videos from channel "http://www.youtube.com/nba" that are tagged "playoffs"?

edt
  • 22,010
  • 30
  • 83
  • 118

3 Answers3

15

YouTube calls tags as categories.

The following URL shows videos from NBA channel with tags playoffs and sports (you can add more obviously) in JSON.

http://gdata.youtube.com/feeds/api/users/nba/uploads/-/sports/playoffs?v=2&alt=json

ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214
  • I tried this, but most of my tagged videos does not appear in the result. I have found [this track](https://code.google.com/p/gdata-issues/issues/detail?id=4247#makechanges) in Youtube Issues and I think that bug persists. – hugofcampos Nov 25 '13 at 19:10
4

Try something like this:

http://gdata.youtube.com/feeds/api/users/nba/uploads?q=playoffs

but this is xml format, look the api document and do it as json by yourself.

yuli chika
  • 9,053
  • 20
  • 75
  • 122
  • Thanks yuli chika! This is very close to what I am looking for and may work. But, my goal is to search by tag and not by "q" (http://code.google.com/apis/youtube/2.0/reference.html#qsp) as your example shows. Any idea how to search by tag? – edt May 09 '11 at 18:31
2

I think you're looking for the category-parameter. I ran a quick test to see how well it matches. Here's the result (yes, the page will load for a few seconds).

  • This link will show you the results and how well they match 'playoffs' with the keywords, when using category.

  • This link will show you the results when using the q-parameter.

So, I guess the link you're looking for is:

http://gdata.youtube.com/feeds/api/users/nba/uploads?category=playoffs&alt=json

martnu
  • 773
  • 4
  • 11