Quick way to list current bets info

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • evan66
    Junior Member
    • Dec 2018
    • 17

    #1

    Quick way to list current bets info

    To get list of current bets I use:

    listCurrentOrders

    then use:
    listMarketCatalogue RUNNER_DESCRIPTION to get horse names

    then use:
    listEvents to get venue name

    then use:
    listMarketCatalogue MARKET_START_TIME to get race start time (UK time)

    This gives me:
    £2 Back, Mr Horse, Sandown, 14.00


    Thats four API calls
    Is there a quicker / shorter way to get this info.

    I’ve looked on BetFair API docs, and can’t see any other way.

    Thanks,
    Evan
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    If you've called listMarketCatalogue to get horse names, why would you call it again for start time? Store it and keep it stored! Same with venues. One call early in your program, not one every time you want to check how your bets are going. Get all the marketCatalogues you're likely to need at the start of your program.

    If you've already placed bets on an event, you've already got most of that stuff once.

    If you can do something once, that's plenty. MarketCatalogue data isn't going to change while your prog is running. MarketBook data is going to change - it tells you the new odds, what money's available, whether there have been horses withdrawn from races.

    To get the data you want requires one call - listCurrentOrders.

    Good luck!
    Last edited by jabe; 29-03-2019, 04:53 PM.

    Comment

    • evan66
      Junior Member
      • Dec 2018
      • 17

      #3
      Oh yea, I called listMarketCatalogue twice. That was stupid.
      Ok. Thanks

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        I've been writing programs for more than 40 years, so I've had a lot of time to get used to these things. Not so easy when you're learning everything new at the same time as writing something really complicated, though that's essentially what happened with me and my mega-complicated (and still incomplete) program in VB.NET, which was largely new to me - especially the object/class stuff.

        But, in general, a program has three parts - setting up what you need (initialisation - including, in this case, all the API calls to get data that you know won't change for the duration of the current run), doing whatever your program is written to do, and then clearing up nicely at the end.

        The initialisation in mine collects so much data that I save it to a file, so if I have to restart the program, it can get the data from the file instead of getting it from the API all over again.
        Last edited by jabe; 29-03-2019, 05:49 PM.

        Comment

        • evan66
          Junior Member
          • Dec 2018
          • 17

          #5
          Yeah, that's a good idea, storing some of the data on file. I'll look into it.
          Thanks jabe.

          Comment

          Working...
          X