BetfairApiNgRails
API-NG is Betfair's next generation API for developers looking to create automated betting systems or custom interfaces for themselves or for Betfair customers. Using this gem you may do calls to API-NG for fetching some interesting information about competitions, events and markets.
WARNING!!!
Last version of gem supports only list* requests.
Installation
Add this line to your application's Gemfile:
gem 'betfair_api_ng_rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install betfair_api_ng_rails
After this run next rake command:
$ bundle exec rake betfair_api_ng_rails:install
After installation will appear two files:
config/betfair_api_ng_rails.yml
config/initializers/betfair_api_ng_rails.rb
In this files you must specify credentials to API-NG. Also you should notice that this gem used non-interactive login and you must generate ssh keys for logining well. More information about this you may find there.
Usage
Sample code for fetching competitions list:
requester = BetfairApiNgRails::Api::Soccer::CompetitionRequester.new provider: :bf
res = requester.load
For all available methods see there.
Also you may passing filering params in load:
requester = BetfairApiNgRails::Api::Soccer::CompetitionRequester.new provider: :bf
res = requester.load parameters: { event_ids: [1, 2] }
Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request