Have I misunderstood the API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spacebiscuit
    Junior Member
    • Feb 2015
    • 5

    #1

    Have I misunderstood the API

    Hi,

    I'm not sure if I have misunderstood what the API does or not but I
    presume that I can for example request a list of market prices for all events in a competition.

    So far I managed to get all events in for example the Premiership with listEvents with params:

    Code:
    $params = '{"filter":{"competitionIds":["31"],
                  "marketTypeCodes":["CORRECT_SCORE"],
                  "marketStartTime":{"from":"' . date('c') . '"}},
                  "maxResults":"100"}';
    This just gives me a list of events though, where are the market prices?

    The documentation is an absolute mess and the only examples are for Horse Racing (perhaps an example for the most popular sport and the most popular competition would be helpful!).

    Any help would be appreciated.

    Thanks,

    David.
  • Franklin1
    Junior Member
    • Mar 2012
    • 91

    #2
    Originally posted by spacebiscuit View Post
    The documentation is an absolute mess
    I have to disagree, but anyway.

    here are the betting operations:
    https://api.developer.betfair.com/se...ons-MarketBook

    You will need to call listMarketBook using the marketIDs returned by your listEvents call.

    Now, if you might return more than 200 markets you might decide to use Navigation Data, and that does get messy.
    https://api.developer.betfair.com/se...r+Applications

    Comment

    • betdynamics
      Junior Member
      • Sep 2010
      • 534

      #3
      I too find the documentation adequate - not stellar but contains certainly contains enough information to work out how to approach things.

      The naming of the API calls are (fairly) logical:

      listCompetitions - returns info about Competitions
      listEvents - returns info about Events
      listMarketCatalogue - returns "stable" info about Markets
      listMarketBook - returns "dynamic" info about Markets (i.e. prices)

      By "stable" I mean things that change infrequently (like selection names). By "dynamic", I mean things that change frequently (like prices).

      Yes, I would like to see some things moved from the MarketCatalogue to the MarketBook to make my life easier, but I can work around most things.

      Some things require more than one step to achieve what you want, but I suspect this is to ensure that people do not flood the Exchange with requests for masses of data.

      Also, play around with the Visualiser - it will give you a good idea of what each call does and the information it returns.

      Comment

      • spacebiscuit
        Junior Member
        • Feb 2015
        • 5

        #4
        Thank you for the replies.

        I've made some ore progress having found some more examples which were buried in the documentation. I agree that all of the information is there, it just seems to be the end result of a project that has been added to and modified over a long period of time by many people. It just seems to be bloated and a little overwhelming for a newbie.

        My approach so far has been to drill down on correct score as follows:

        listEvents->listMarketCatalogue->listMarketBook

        listMarketCatalogue gives me the market ID and also the selectionId's for each correct scoreline. If these ID's do not change then I can hardcode them. For example a 0-0 scoreline seems to have a selectionId=1, is this fixed for all events?

        Thanks again,

        Alan.

        Comment

        Working...
        X