Skip to content
Search youtube via this simple ruby api
Find file
Latest commit 2c5ecfe @grosser thx david!
Failed to load latest commit information.
lib v0.2.0
spec add method to retrieve information from a single video
.travis.yml bump travis
Gemfile actually need json
Gemfile.lock v0.2.0
Rakefile bump thx david!
youtube_search.gemspec license + thanks for the patch

Search youtube via this simple ruby api

  • simple
  • no dependencies


gem install youtube_search

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

or raw json with format: 'json'

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>}

Searching playlists


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
License: MIT Build Status

Something went wrong with that request. Please try again.