Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (33 sloc) 0.997 kb

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({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");
});
Jump to Line
Something went wrong with that request. Please try again.