Project

randomapi

0.0
No commit activity in last 3 years
No release in over 3 years
Gets data from randomapi.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

< 0.10, >= 0.7
< 0.10, >= 0.8
>= 0.4.0
>= 1.0.3, ~> 1.0
 Project Readme

randomapi-ruby

API to access data from https://randomapi.com

#Installation Bundler:

gem install randomapi

#Initialization If you use only 1 API key & API id, it makes sense to pass them in the initializer:

RandomApi.configure do |config|
  config.api_key = "YOUR_API_KEY_HERE"
  config.api_id = "YOUR_API_ID_HERE"
end

#Client creation To make requests you need to create a client:

client = RandomApi.client # uses api key & id from initializer
client = RandomApi.client(api_key: "ANOTHER_API_KEY", api_id: "ANOTHER_API_ID") # passes key & id directly

#Making calls

client.request # makes request to API to return 1 result
client.request(results: 5) # give me 5 results!
client.request(results: 5, myvar: 1) # give me 5 results with variable "myvar" set to 1

Contributing to randomapi

  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make pull request

License

This code is free to use under the terms of the MIT license.

Copyright

Copyright (c) 2015 Denis Kuznetsov.