Betfair API-NG library for node.js
JavaScript
Latest commit 7fbd85b Jul 7, 2016 @AlgoTrader price fix
Permalink
Failed to load latest commit information.
src price fix Jul 7, 2016
.gitignore http_request es6 started Feb 10, 2016
.npmignore npm stuff Apr 25, 2016
README.md Update README.md Apr 22, 2016
index.js started tests refactoring Mar 16, 2016
package.json price fix Jul 7, 2016

README.md

Betfair API-NG for Node.js

NPM

Installation

npm install betfair

or

git clone git@github.com:AlgoTrader/betfair.git
cd betfair
npm install
npm run build

betrair API was completly rewritten in ES2015 and requires build step before usage

Synopsis

Login to Betfair

var betfair = require('betfair');
var session = new betfair.BetfairSession('yourApllicationKey');

session.login('name','password', function(err) {
    console.log(err ? "Login failed " + err : "Login OK");
});

Request countries list

var invocation = session.listCountries({filter: {}}, function(err,res) {
    if(err) {
        console.log('listCountries failed');
    } else {
        for(var index in res.response.result) {
            var item = res.response.result[index];
            console.log("country:%s markets:%s", item.counrtyCode, item.marketCount)
        }
    }
});

Logout from Betfair

session.logout(function(err) {
    console.log(err ? "Logout failed: " + err : "Logout OK");
});