List of all markets

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Franklin1
    Junior Member
    • Mar 2012
    • 91

    #1

    List of all markets

    Am I being thick? I can't work out how to reliably build a list of all marketIDs on Betfair.

    I can use listEvents to tell me how many events and markets there are, but not the marketIDs.

    I can use listMarketCatalogue to get upto 1000 markets, but this call doesn't support paging.

    I can make my own paging by using filter.marketStartTime and MarketSort.FIRST_TO_START, but if I end up with 1000 markets starting at the same time this is going to break down (endless loop).

    Seems like a pretty basic desire - does anyone have any ideas, please?
  • Mr Magoo
    Junior Member
    • Jan 2011
    • 86

    #2
    I've been using listMarketCatalogue but I hate the lack of paging too. My workaround is to sort by market start time, and update the search start time. As you say, this all falls apart if you get too many markets starting at the same time. It's also inefficient, as you have to re-request the same markets.

    e.g. If your 1st request returns a full list of markets, and the last start time is 10pm, you'll have to request the next set of markets from (and including) 10pm, since there could be further markets that start then. But this means you can't help but retrieve the original 10pm market as well...

    If only there was a proper paging mechanism. It seems like an obvious omission from the APIA.

    Comment

    • nybbot
      Junior Member
      • Nov 2014
      • 3

      #3
      Could you use listCompetitions to get a list of competitionIds to use as a filter and repeatedly use listMarketCatalogue? Or filter using eventIds and competitionIds.

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #4
        Originally posted by Franklin1 View Post
        Am I being thick? I can't work out how to reliably build a list of all marketIDs on Betfair.

        I can use listEvents to tell me how many events and markets there are, but not the marketIDs.

        I can use listMarketCatalogue to get upto 1000 markets, but this call doesn't support paging.

        I can make my own paging by using filter.marketStartTime and MarketSort.FIRST_TO_START, but if I end up with 1000 markets starting at the same time this is going to break down (endless loop).

        Seems like a pretty basic desire - does anyone have any ideas, please?
        Isn't this what the navigation data is supposed to give you?

        See https://api.developer.betfair.com/se...r+Applications

        Comment

        • Franklin1
          Junior Member
          • Mar 2012
          • 91

          #5
          Originally posted by betdynamics View Post
          Isn't this what the navigation data is supposed to give you?

          See https://api.developer.betfair.com/se...r+Applications
          FFS! - I didn't look at there - thats exactly what I wanted - thank you

          Mr Magoo and nybbot - Thanks for your comments - I just wasted some time coding up a nice method which uses event.marketCount to use the eventID filter to ensure your listMarketCatalogue call does not go over 1K markets - this would be robust so long as no single event had > 1K markets.

          Comment

          • Franklin1
            Junior Member
            • Mar 2012
            • 91

            #6
            Doesn't even look like this navigation data is correct - Dnipro MARKET in HJK Helsinki v Torino EVENT?

            "type" : "EVENT", "name" : "HJK Helsinki v Torino", "id" : "27296175", "countryCode" : "FI"
            }, {
            "children" : [{
            "type" : "MARKET",
            "name" : "Asian Handicap",
            "id" : "1.116159101",
            "exchangeId" : "1",
            "marketType" : "ASIAN_HANDICAP",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : ""
            }, {
            "type" : "MARKET",
            "name" : "Correct Score",
            "id" : "1.116159079",
            "exchangeId" : "1",
            "marketType" : "CORRECT_SCORE",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Correct Score 2 Away",
            "id" : "1.116159045",
            "exchangeId" : "1",
            "marketType" : "CORRECT_SCORE2",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Correct Score 2 Home",
            "id" : "1.116159046",
            "exchangeId" : "1",
            "marketType" : "CORRECT_SCORE2",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "DRAW NO BET",
            "id" : "1.116159064",
            "exchangeId" : "1",
            "marketType" : "DRAW_NO_BET",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Dnipro +1",
            "id" : "1.116159047",
            "exchangeId" : "1",
            "marketType" : "TEAM_B_1",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Dnipro Total Goals",
            "id" : "1.116159092",
            "exchangeId" : "1",
            "marketType" : "TEAM_TOTAL_GOALS",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : ""
            }, {
            "type" : "MARKET",
            "name" : "Double Chance",
            "id" : "1.116159048",
            "exchangeId" : "1",
            "marketType" : "DOUBLE_CHANCE",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 2
            }, {
            "type" : "MARKET",
            "name" : "Half Time/Full Time",
            "id" : "1.116159081",
            "exchangeId" : "1",
            "marketType" : "HALF_TIME_FULL_TIME",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Hat-trick Scored?",
            "id" : "1.116159087",
            "exchangeId" : "1",
            "marketType" : "HAT_TRICKED_SCORED",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Karabakh +1",
            "id" : "1.116159049",
            "exchangeId" : "1",
            "marketType" : "TEAM_A_1",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Karabakh Total Goals",
            "id" : "1.116159052",
            "exchangeId" : "1",
            "marketType" : "TEAM_TOTAL_GOALS",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : ""
            }, {
            "type" : "MARKET",
            "name" : "Match Odds",
            "id" : "1.116159083",
            "exchangeId" : "1",
            "marketType" : "MATCH_ODDS",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Next Goal",
            "id" : "1.116159065",
            "exchangeId" : "1",
            "marketType" : "NEXT_GOAL",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Odd or Even",
            "id" : "1.116159088",
            "exchangeId" : "1",
            "marketType" : "ODD_OR_EVEN",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 2.5 Goals",
            "id" : "1.116159080",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_25",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 3.5 Goals",
            "id" : "1.116159067",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_35",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 4.5 Goals",
            "id" : "1.116159068",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_45",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 5.5 Goals",
            "id" : "1.116159090",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_55",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 6.5 Goals",
            "id" : "1.116159091",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_65",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 7.5 Goals",
            "id" : "1.116159043",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_75",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Over/Under 8.5 Goals",
            "id" : "1.116159044",
            "exchangeId" : "1",
            "marketType" : "OVER_UNDER_85",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Penalty Taken?",
            "id" : "1.116159089",
            "exchangeId" : "1",
            "marketType" : "PENALTY_TAKEN",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Sending Off?",
            "id" : "1.116159084",
            "exchangeId" : "1",
            "marketType" : "SENDING_OFF",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : 1
            }, {
            "type" : "MARKET",
            "name" : "Total Goals",
            "id" : "1.116159069",
            "exchangeId" : "1",
            "marketType" : "TOTAL_GOALS",
            "marketStartTime" : "2014-11-06T17:00:00.000Z",
            "numberOfWinners" : ""
            }
            ]

            Comment

            • Jolly Roger
              Junior Member
              • Feb 2013
              • 12

              #7
              IIRC the navigation file lists the markets first and the event at the bottom, I think you've copied the end of one event and the start of another. What helped for me is finding a browser addon which will parse JSON to make it easier to visualise.

              Comment

              • Franklin1
                Junior Member
                • Mar 2012
                • 91

                #8
                Originally posted by Jolly Roger View Post
                IIRC the navigation file lists the markets first and the event at the bottom, I think you've copied the end of one event and the start of another. What helped for me is finding a browser addon which will parse JSON to make it easier to visualise.

                You are correct - thanks.

                I usually use JSON format in Notepad++, but been having a miserable time of it with this large file.

                Comment

                • LABE
                  Junior Member
                  • Apr 2011
                  • 14

                  #9
                  Originally posted by Franklin1 View Post
                  How to reliably build a list of all marketIDs on Betfair. I can use listEvents to tell me how many events and markets there are, but not the marketIDs.
                  I can use listMarketCatalogue to get upto 1000 markets, but this call doesn't support paging. Does anyone have any ideas, please?
                  try link: http://www.betoptim.com/index.aspx?l...start=DownInst
                  - programming tools for support Betfairs Api-NG operations
                  - it contains combined operations - your need solves additional operation CompEvents_MarkBook
                  - in last phase of processing this operation can repeat operations listMarketCatalogue and listMarketBook
                  - uses filtering conditions (additional to Betfairs original) can reduce volume of data
                  - you can pass as entry filter list of EventsID, number of markets can reduce entry filter for marketname (f.e. "MATCH ODDS|OVER/UNDER*")
                  - it works quick in C++, returns downloaded current odds in CSV-structure
                  - demoversions including source code in Visual Basic, C#, Python

                  Comment

                  Working...
                  X