0.0.1 • Published 9 years ago

betfairy v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

NPM version Build Status Dependency Status

Betfair JSON API for node.js

Install

$ npm install --save betfairy

Usage

var bf = require('betfairy')(APPLICATION_KEY, USERNAME, PASSWORD, DEBUG);

bf.login(function() {
	bf.account('getAccountFunds', function(err, res) {
        console.log(res);
    });

    bf.account('getAccountDetails', function(err, res) {
        console.log(res);
    });

    bf.betting('listMarketCatalogue', {
        maxResults: 20,
        marketProjection: [
            'COMPETITION',
            'EVENT',
            'EVENT_TYPE',
            'MARKET_START_TIME',
            'MARKET_DESCRIPTION',
            'RUNNER_DESCRIPTION',
            'RUNNER_METADATA'
        ],
        filter: {
            eventTypeIds: [
                '7'
            ],
            marketCountries: [
                'GB'
            ],
            marketStartTime: {
                from: new Date()
            },
            marketTypeCodes: [
                'PLACE',
                'WIN'
            ],
            turnInPlayEnabled: true
        }
    }, function(err, res) {
        console.log(res);
    });

	setInterval(function() {
		bf.keepAlive();
	}, 420000);
});

License

MIT © Ray Gerrard