Stream API Market Limit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chazni
    Junior Member
    • Apr 2019
    • 5

    #1

    Stream API Market Limit

    Hi,

    I'm trying to subscribe to all horse markets using the following filters:

    Code:
    var marketFilter = new API.MarketFilter()
    {
        EventTypeIds = new List<string>() { "7" },
        MarketTypes = new List<string>() { "WIN" },
        BettingTypes = new List<API.MarketBettingType?>() { API.MarketBettingType.Odds },
        TurnInPlayEnabled = true,
    };
    
    var marketDataFilter = new API.MarketDataFilter()
    {
        Fields = new List<API.MarketFields?>()
        {
            API.MarketFields.ExMarketDef,
            API.MarketFields.ExBestOffers,
            API.MarketFields.ExLastTradedPrice,
        },
        LadderLevels = 1,
    };
    However, this ends up returning 391 markets which exceeds the 200 market limit. If I only grab GB markets it works fine. However, I would like the ability to be able to get a list of all markets.

    Looking at the exchange API doc page:
    https://docs.developer.betfair.com/d...nge+Stream+API

    I cannot seem to see anything that lets me reduce this number of markets down further. There are 2 options I would like:
    1) Give a hard limit on the number of markets (e.g. tell the API to only ever send me 100 markets).
    2) Specify a date range (e.g. only obtain markets for the next 6 hours)

    Both of these are possible on the web API, so it is possible for me to grab a list of market IDs using the web API and put that list in the market filter.

    Is this the way I'm supposed to do this or is there a way to do this kind of filtering through the stream API?
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    I haven't attempted to code anything to do with the stream API. I've just looked at your options for reducting the number of markets you're getting and your options look limited, but you can't specify dates, which seems odd. You could specify multiple countries, but, of course, I've no idea whether that would suit your requirements.

    Perhaps someone who has done some streaming will be along to help shortly.

    Comment

    • chazni
      Junior Member
      • Apr 2019
      • 5

      #3
      At the moment it is not an issue since I will be sticking to GB markets for now but I would eventually like to run on any market. Adding more countries as I need to would be a reasonable way to begin expanding. And worst case I can just grab market IDs manually every 6 hours or so using the web API and resubscribe to the new markets. So I can definitely achieve what I want if there are no other solutions.

      A bit more context to my situation:

      The main reason I'm asking is that I read somewhere that if I subscribe with a set of filters, the stream API will continue to add markets that satisfy the filters I subscribed with as they open. This means I just need to subscribe once at the start and I will continue to get up to date markets automatically. So I was wondering if there were stream API versions of the following:

      marketStartTime: https://docs.developer.betfair.com/d...s-MarketFilter
      maxResults: https://docs.developer.betfair.com/d...arketCatalogue

      Comment

      • bfexplorer
        Senior Member
        • Sep 2018
        • 212

        #4
        Streaming api is missing selection name, so you must make rest api request to get all market information your app could implement. I do not know why betfair did not include such base data to Market Definition Data.

        Have a look at video from my test:

        https://youtu.be/lbHE0YeBLGA

        For trading apps like mine one, market browsing is done by rest api, so market ids are only used to open data stream for monitored markets, but of course there are many use case scenarios where streaming can be used only, but you actually cannot do so.

        It would be nice when betfair finally adds missing data to streaming api as well.

        Comment

        • chazni
          Junior Member
          • Apr 2019
          • 5

          #5
          Streaming api is missing selection name, so you must make rest api request to get all market information your app could implement.
          market browsing is done by rest api, so market ids are only used to open data stream for monitored markets
          These two points make sense. I will go ahead and do something similar for now, it will work for what I want to do.

          Cheers.

          Comment

          • strangecarr
            Junior Member
            • Apr 2019
            • 10

            #6
            Hi, I'm using historical data so don't think I can use the rest API to get the selection name. Looks like for different event IDs, the selection IDs in some markets are consistent, but I noticed on match odds for football - for the draw, the selection ID is always the same, however the home (and away) win have different selection IDs. This makes it a little difficult to handle the data. Does anyone know how the selection IDs are allocated to specific outcomes?

            Comment

            Working...
            X