API call outline for a Total Points betting use case

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • asp
    Junior Member
    • Mar 2023
    • 5

    #1

    API call outline for a Total Points betting use case

    Hi,

    I've been chipping away at this use case, but it feels like I'm wading through mud. Any help (high level is fine) on the calls I should be making would be greatly appreciated.

    I've basically been betting "Total Points" over/unders manually, and would like to be able to automate. The manual process (assume an NBA game) is:

    - With a total line I'm happy to bet over (or under), go to a game
    - Click "Total Points" to see what is available for the line I'm interested in
    - If there is an unmatched amount that is large enough to bet, with odds I'm happy with, then make the bet

    So far, via API I've been able to:
    - Call listMarketCatalogue to get a market catalogue for upcoming games to extract a market_id
    - Call listMarketBook to get the different lines (selections)
    - Call listRunnerBook to get more info (totalAvailable looks to be the only useful info - no idea what numberOfRunners means in an NBA context)

    What I'd like to be able to do is:
    - Call listMarketCatalogue to get a market catalogue for upcoming games to extract a market_id
    - Call listMarketBook to get the different lines (selections)
    - Call listRunnerBook to get more info, but have that info include both totalAvailable and the odds being offered (so far I've only seen odds on existing orders returned in listMarketBook)
    - If an available amount found at a price I'm happy with, place an order (I can probably figure this out, just haven't gotten to it yet)

    Any input on how to get that additional info would be greatly appreciated.

    Another question I have is that for a Total Points book there appear to be two "keyLines":

    "keyLine": [ { "selectionId": 7017824, "handicap": 227.5 }, { "selectionId": 7017823, "handicap": 227.5 } ]

    After making test bets, it appears that one is the over, and the other the under. Is the only way to tell which is which by the order of their IDs? That seems a little shitty.

    Thanks in advance,

    Alan.




  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    This isn't a full answer. The two selections are the "runners" in this event. Find the runner names and it'll tell you which is over and which is under.

    If you want a list of the day's games, use listEvents, stating the EventType (which is the indicator the sport). With the ids from the Events list, you can choose the specific marketCatalogues for the type(s) of market you are interested in. Then get the related marketBook for each marketCatalogue.

    I advise new starters to construct classes for every API call (though not necessarily all the bank ones) so that they get to see how the data is connected and where each element is. The marketCatalogue is, broadly speaking, for fixed data, and the marketBook for data that changes during the event. .

    Comment

    • WTPooh
      Member
      • May 2012
      • 88

      #3
      1. You don't need to call listRunnerBook. You can get all the info from listMarketBook. For example with this request
      {"jsonrpc":"2.0","method":"SportsAPING/v1.0/listMarketBook","params":{"marketIds":["1.211721945"],"priceProjection":{"priceData":["EX_ALL_OFFERS"]},"orderProjection":"ALL"}}
      you will get all the prices and volumes available, your matched bets and unmatched orders.

      2. 7017824 is selectionId for "Under". 7017823 is selectionId for "Over". These are fixed values and they never change.​

      Comment

      • asp
        Junior Member
        • Mar 2023
        • 5

        #4
        Thank you both for the responses. I'll make the changes today.

        Comment

        Working...
        X