Skip to content
Ruby Embedly Client
Ruby Gherkin
Branch: master
Clone or download
Latest commit f988082 Jan 9, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Adds extract endpoint Apr 2, 2013
spec Merge remote-tracking branch 'romanbsd/optional-typhoeus' Jan 21, 2014
ChangeLog Release Jan 27, 2014
Gemfile secure gemsource Sep 11, 2014
MIT-LICENSE Adds license Jan 19, 2011 Fix link to dependency in readme May 17, 2014
Rakefile Merge remote-tracking branch 'romanbsd/optional-typhoeus' Jan 21, 2014
cucumber.yml First working version Jan 20, 2011


embedly is the Embedly Ruby client library and commandline tool. It allows you to integrate Embedly into your Ruby applications, as well as use Embedly's API from the commandline.

To find out what Embedly is all about, please visit To see our api documentation, visit


To install the official latest stable version, please use rubygems.

gem install embedly

If you would like cutting edge, then you can clone and install HEAD.

git clone git://
cd embedly-ruby
rake install


Getting Started

You can find rdocs at

require 'embedly'
require 'json'

embedly_api = :user_agent => 'Mozilla/5.0 (compatible; mytestapp/1.0;'

# single url
obj = embedly_api.oembed :url => ''
puts obj[0].marshal_dump
json_obj = JSON.pretty_generate(obj[0].marshal_dump)
puts json_obj

# multiple urls with opts
objs = embedly_api.oembed(
  :urls => ['',
  :maxwidth => 450,
  :wmode => 'transparent',
  :method => 'after'
json_obj = JSON.pretty_generate(objs.collect{|o| o.marshal_dump})
puts json_obj

# call api with key (you'll need a real key)
embedly_api = :key => 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
        :user_agent => 'Mozilla/5.0 (compatible; mytestapp/1.0;'
url = ''
obj = embedly_api.extract :url => url
puts JSON.pretty_generate(obj[0].marshal_dump)

Configuration options

You can configure some parameters in the api:

Embedly.configure do |config|
 # prints debug messages to the logger
 config.debug = true

 # use a custom logger
 config.logger =

 # Choose a request adatper (net_http, typhoeus or faraday)
 config.request_with :faraday


gem install jeweler
rake spec
rake features # if it complains of missing deps install them

Some tests will fail due to missing api key. Set the EMBEDLY_KEY environmental variable with your key to get them to pass.

EMBEDLY_KEY=xxxxxxxxxxxxx rake features

To turn on debugging, set the EMBEDLY_VERBOSE environmental variable.

EMBEDLY_VERBOSE=1 EMBEDLY_KEY=xxxxxxxxxxx rake features

We have provided some commandline tools to test the Embedly interface.

  • embedly_oembed
  • embedly_objectify
  • embedly_preview

Using --help with the commands should give you a good idea of how to use them.

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.


Copyright (c) 2011, Inc. See MIT-LICENSE for details.

You can’t perform that action at this time.