YouTube Search Results as RSS Feed

imageToday we were working on producing some custom Youtube video searches that output to RSS feed. The intent being to then consume the result into a Yahoo Pipes manipulation and ultimately use the result in a new iPhone / iPad app.

Google and Youtube have made the quite easy, which was nice.

YouTube Search as RSS

Search

If you wanted to search for the term “A380” (like the aircraft) then you would use a URL like this: http://www.youtube.com/rss/search/a380.rss 

http://www.youtube.com/rss/search/[SEARCH_TERMS].rss

Tag

If you wanted to find all the videos recently posted that are tagged “A380” you would use a URL like this: http://www.youtube.com/rss/tag/a380.rss

Two Words

The above examples can have a space in the search. "Airbus A380” would be:

http://www.youtube.com/rss/search/airbus%20a380.rss

Must have the two words

Using the + sign you can conjoin two words.

http://www.youtube.com/rss/search/airbus+a380.rss

However this appears to deliver the same results as the above search.

Google YouTube API

There is an API available to do more complex searches. These produce some interesting results. The API is available here.

YouTube User Search

Using a USER ID like ours “interactivewebs” you can find all the videos published by us using this search: http://www.youtube.com/rss/user/interactivewebs/videos.rss

Sorting

It is possible to sort the search results using a tag on the end that looks like this:

=video-date-uploaded.rss

http://www.youtube.com/rss/search/a380=video-date-uploaded.rss

Also

Did you know, you can use complex boolean searches at YouTube, and get these out as an RSS feed, but that you may need to fiddle with the feed url to get it to work properly.
You can use:
  quoted strings
  parenthesis ( …. )
  AND
  OR
  "-" for negation (or is it just excluding the next word)
in searches.  For example here is a search I just conducted:
("light sport aircraft" OR (microlight OR ultralight OR lightsportaircraft OR lsa)) AND -ultralightnews
Fancy huh.  You can grab this as an RSS by using the rss link in your browser should it provide it, however take note, that YouTube seems to cut the query short in the RSS link if it’s too long (and doesn’t fully evaluate it either if you force it), and it does not return in the expected "most recent upload" order, so some modification of the string is necessary to make it useful.  Here’s the RSS feed for the above search
http://gdata.youtube.com/feeds/base/videos?q=(%22light%20sport%20aircraft%22%20OR%20(microlight%20OR%20ultralight%20OR%20lightsportaircraft%20OR%20lsa))%20AND%20-ultralightnews&client=ytapi-youtube-search&alt=rss&v=1&orderby=published

Returning Large Images of the Feed

We also found a neat little search that looks like this:

http://gdata.youtube.com/feeds/base/videos?q=%28a380%29youtube-search&alt=rss&v=1&orderby=published

The end result of this produces some great looking feeds for our use.

Hope this helps others.

2 Replies to “YouTube Search Results as RSS Feed”

    1. This is true. The V3 release from Google has stopped this for good.

      Someone has created a small PHP script that scrapes a Youtube URL for video links, and then outputs them as an atom feed: https://gist.github.com/Skalman/801436d9693ff03bc4ce

      URLs such as https://www.youtube.com/user/scishow/videos work.

      Caveats:

      The tool doesn’t scrape dates
      Playlists won’t include more than 100 videos
      Playlists include the “play all” link
      Author is correctly set only for channels (e.g. not playlists)
      Maybe Youtube will block you if you use this too much (but hopefully the limits are high enough)
      Likely several more…

Leave a Reply

Your email address will not be published. Required fields are marked *