betfair

Betfair JSON API

npm install betfair
6 downloads in the last week
59 downloads in the last month

Betfair API-NG for Node.js

NPM

Installation

npm install betfair

Synopsis

Login to Betfair

var betfair = require('betfair');
var session = betfair.newSession('yourApllicationKey')

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

Request countries list

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

Logout from Betfair

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