The gooru gem allows your Ruby app to talk to the Gooru API


Add this line to your application's Gemfile:

gem 'gooru'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gooru


Gooru API key

Some areas of the Gooru API require sign in via an API key.

You may want to request an API key from Gooru before you get started.

Environment variables

If you're using an API key, you may want to store it in an environment variable.

Environment variables can be a way to store sensitive data you don't want in source control.

Consider using a tool like Dotenv to manage these variables across different developer and server environments.

You'll see the environment variable approach used in the examples below.


Sign In

The Sign In call takes your API key and returns a session token.

If you're using the signed in areas of the Gooru API, you'll need to hang on to the returned session token and use it in later requests.

The Sign In call is not needed if you're only using the public areas of the API.

response =
  apiKey:   ENV["GOORU_API_KEY"],
  userName: ENV["GOORU_USER_NAME"],
  password: ENV["GOORU_PASSWORD"])

if response.success?
  puts "You've been authenticated!"
  puts "Your session token is #{['token']}"
  puts "You were unable to be authenticated…"
  puts "The error message was: #{['error']}"

Required parameters

  • apiKey
  • userName
  • password


The Resources call takes a query and returns a list of matching resources.

You can optionally pass a session token if you're signed in, but it is not required.

response = Gooru::Resources.get(
  query: "algebra")

if response.success?
  results =["searchResults"]
  puts "We found #{results.length} resources matching 'algebra'"
  puts "The error message was: #{['error']}"

Required parameters

  • query

Optional parameters

  • sessionToken


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request