Package Exports
- betfair-client
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (betfair-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Betfair API-NG for Node.js
Installation
npm install betfair-client
or
git clone https://git.oschina.net/huahongxinxin/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");
});