Search youtube via this simple ruby api
Pull request Compare This branch is 1 commit ahead, 28 commits behind grosser:master.
Latest commit acd0d8f Jul 13, 2012 wehal3001 add simple 'debug' parameter to search options-hash for debugging URL…
… composition

Search youtube via this simple ruby api

  • simple
  • no dependencies


sudo gem install youtube_search


rails plugin install git://

  "title"=>"Killer Whale Imitates Boat Motor",
  "content"=>"Top YouTube Videos on ...",
  "raw" => <REXML::Element ... >,
  "embeddable" => true,

page / per_page are supported'cats', :page => 10, :per_page => 4).first

and standard youtube options'cats', 'time' => 'this_week', 'orderby' => 'viewCount').first

I can haz iframe:

# DISCLAIMER this iframe may steal 4 minutes of your life ;)
id ='lolcats').first['video_id']
%{<iframe src="{id}" width=640 height=480 frameborder=0></iframe>}

Retrieve videos by playlist ID

videos = YoutubeSearch.playlist_videos('5F23DAF4BFE3D14C')


  • more detailed xml parsing (you can fetch everything via 'raw', but more defaults would be nice)
  • parse dates into ruby objects



Michael Grosser
Hereby placed under public domain, do what you want, just do not hold me accountable...
Flattr Build Status