The RapidAPI Developer Hub

Welcome to the RapidAPI developer hub. You'll find comprehensive guides and documentation to help you start working with RapidAPI as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

Ruby

Query RapidAPI using Ruby

In order to consume APIs on RapidAPI in Ruby, you must first install the gem:

# Add this to your Gemfile: 'rapidapi', '~> 0.1.3'

# then run this at the command line:
bundle install

Once you've installed the gem, require it in your code:

require 'rapidapisdk'

You can now instantiate a new RapidAPI client with your ProjectName and ProjectKey:

RapidAPI.config(project:'ProjectName',token: 'ProjectKey');

Now, to call an API, all you have to do is write the following code:

response = RapidAPI.call('APIName', 'FunctionName', { 
  'ParameterKey1': 'ParameterValue1',
  'ParameterKey2': 'ParameterValue2'
})