betfair-api
Version:
A library for interacting with the Betfair API
62 lines (47 loc) • 1.53 kB
Markdown
betfair-api
===========
Node Betfair API
## Installation
In your project, install the package: `npm install betfair-api --save`
Create a configuration file in `./config/exchanges.js` that matches the sample file provided at `./node_modules/betfair-api/config/exchanges.sample.js`.
Populate it with your Betfair details. This includes the path to your generated certificate as per the [Betfair Documentation](https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Certificate+Generation+With+XCA).
## Usage
```
var api = require('betfair-api');
var params = {
filter:{}
};
api.listCompetitions(params, function(err, res) {
if (err) {
console.log(err);
}
console.dir(res);
});
```
See `./test/e2e/readonly-methods.spec.js` for more examples.
### Available Methods
* login
* keepAlive
* getAccountFunds
* listCountries
* listEventTypes
* listCompetitions
* listEvents
* listMarketCatalogue
* listMarketBook
* placeOrders
* replaceOrders
* updateOrders
* cancelOrders
* listCurrentOrders
* listClearedOrders
## Tests
Jasmine in use via Grunt so run `grunt test`. Linting is also enabled via `grunt lint`. Alternatively, run `npm test`.
## Contributing
Please raise an issue if you encounter any problems or have any questions.
## Release History
* 0.0.1 Initial Commit and Project setup.
* 0.0.2 Fix for Config Location.
* 0.0.3 Update Readme.
* 0.1.0 Final Cleanup and bump to 0.1.0.
* 0.2.0 Add AU Exchange configuration variable to support AU Exchange