Skip to content
Browse files

Merge branch 'master' of github.com:AlgoTrader/betfair

  • Loading branch information...
2 parents a29a4fe + f00c649 commit fd75419bef4d53dba5eb2d3c9807109a89aa2527 @AlgoTrader committed
Showing with 41 additions and 3 deletions.
  1. +41 −3 README.md
View
44 README.md
@@ -1,4 +1,42 @@
-betfair
-=======
+Betfair Next Generation JSON-RPC API for Node.js
+================================================
-New Betfair JSON API for node.js
+**Important Notice**. *This library utilizes the beta version of the Betfair next generation JSON API.
+To access the API you need to request an Application Key from the Betfair*.
+
+## Installation ##
+
+ npm install betfair
+
+## Synopsis ##
+
+Login to Betfair
+```JavaScript
+var betfair = require('betfair');
+var session = betfair.newSession('yourApllicationKey')
+
+session.login('name','password', function(err) {
+ console.log(err ? "Login OK" : "Login failed");
+});
+```
+
+Request countries list
+```JavaScript
+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
+```JavaScript
+session.logout(function(err) {
+ console.log(err ? "Logout OK" : "Logout failed");
+});
+```

0 comments on commit fd75419

Please sign in to comment.
Something went wrong with that request. Please try again.