Can I publish a library that uses JSON RPC API?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlgoTrader
    Junior Member
    • Mar 2012
    • 243

    #1

    Can I publish a library that uses JSON RPC API?

    I have finished the complete port of https://github.com/AlgoTrader/betfair-sports-api Node.js API6 library. It took me a little more than two days.

    It supports all the existing JSON RPC API calls and also can login/logout using the original library.

    Can I publish it on github?

    The overall API impression is very positive. What I do not like most in current API. I think there is no need in numbers like 64.61744000000002, rounding to cents is just fine. I think the names EXECUTABLE and EXECUTION_COMPLETE are very misleading and long, MATCHED and UNMATCHED are much better. I also like to have keep-alive to keep HTTPS connections open for futher reusing
    Betfair Bots Made Easy
  • MarkL
    Junior Member
    • Oct 2008
    • 29

    #2
    Hi,

    It's perfectly fine to publish a library, but please don't publish the application key you've been assigned. So anyone who wants to use the library will need to obtain their own key.

    Regarding the "EXECUTABLE" vs "EXECUTION_COMPLETE" we're trying to get away from everything being a "Bet" as it's *not* a bet until it's matched, it's an Order. This should be better documented and we'll look in to that. Also, MATCHED and UNMATCHED don't express partially matched very well. An order is completely executed when it's fully matched.

    Regarding the rounding of values and the HTTP keep-alive, we'll look into that.

    Cheers,
    Mark

    Comment

    • AlgoTrader
      Junior Member
      • Mar 2012
      • 243

      #3
      Done. The library is there
      https://github.com/AlgoTrader/betfair
      Betfair Bots Made Easy

      Comment

      • hugor007
        Junior Member
        • Nov 2012
        • 1

        #4
        Thanks AlgoTrader for the library.

        Can you explain how to use your library in Website (HTML, Javascript, jQuery)?

        I read de Wiki documentation, make all tests with success, but i don't understand how import your JS library to use in Website?

        Thanks for help!

        Comment

        • AlgoTrader
          Junior Member
          • Mar 2012
          • 243

          #5
          If you mean browser, currently there is no easy way. There is no simple login procedure, so browser based app is out of question for now. There will be boom of browser apps as the new BF API is very browser friendly.

          If you mean server side, there are plenty HTTP servers for node.js, just use any one. I use express3. HTTP server and my lib are fully independent, if you have enough skills to bring them together, there are no much problems.
          Betfair Bots Made Easy

          Comment

          • MarkL
            Junior Member
            • Oct 2008
            • 29

            #6
            You will be able to build browser-based apps with the Betfair App Cloud

            Comment

            • AlgoTrader
              Junior Member
              • Mar 2012
              • 243

              #7
              The betfair library for node.js is updated (npm install betfair).
              version 0.0.2 has:
              - betting methods support
              - accounts api support

              For example:
              Code:
              node get_developer_app_keys.js 
              ===== Logging in to Betfair =====
              Remember new session token
              Login OK, 0.235 secs
              getDeveloperAppKeys err=null duration=0.135
              Request:{
                "jsonrpc": "2.0",
                "id": 1,
                "method": "AccountAPING/v1.0/getDeveloperAppKeys",
                "params": {}
              }
              
              Response:{
                "jsonrpc": "2.0",
                "result": [
                  {
                    "appName": "XXXXXXXXXXXXXXXXXXXXXXX",
                    "appId": 111111111,
                    "appVersions": [
                      {
                        "owner": "XXXXXX",
                        "versionId": 1111,
                        "version": "1.0-DELAY",
                        "applicationKey": "XXXXXXXXXXXXXXXXXX",
                        "delayData": true,
                        "subscriptionRequired": true,
                        "ownerManaged": false,
                        "active": true
                      },
                      {
                        "owner": "XXXXXX",
                        "versionId": 2222,
                        "version": "1.0",
                        "applicationKey": "XXXXXXXXXXXXXXXXXX",
                        "delayData": false,
                        "subscriptionRequired": true,
                        "ownerManaged": false,
                        "active": true
                      }
                    ]
                  }
                ],
                "id": 1
              }
              
              ===== Logging out... =====
              Closing session
              Logout OK, 0.054 secs
              Done, err = null
              Betfair Bots Made Easy

              Comment

              Working...
              X