C# - ListEvents response is empty?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skit
    Junior Member
    • Apr 2014
    • 7

    #1

    C# - ListEvents response is empty?

    Hello,

    Just some quick questions about the new API.
    What I'm trying to do in summary is list all soccer events that whill go live (listEvents used) and for each I want information about the match odds market. It is my understanding that the only way to do is is iterate over the events list and for each run listMarketCatalogue to obtain the match odds market id and then the listMarketBook to get the current status of the market (odds, liquidity, etc)?

    In summary, calling ListEvents and for each event call listMarketCatalogue and listMarketBook.

    Can anyone just confirm that this is the best way of doing this?
    All I want is to list on a table the market name "Team A vs Team B", start time, current status (inplay or not | open, suspended, etc) and the current odd to back and to lay with the current liquidity in each as well as total market liquidity.

    Thank you.
    Last edited by skit; 09-04-2014, 08:02 PM.
  • tkw141
    Junior Member
    • Nov 2013
    • 18

    #2
    Hi Skit,

    You're almost right.
    You don't need to use listEvents as you can retrieve the "Match Odds" marketIds directly from listMarketCatalogue using a single request.
    If you only want Match Odds markets then set Market Types = MATCH_ODDS
    Set Max Resuts=1000
    Additional Data = EVENT
    There are other filters such as Starts After, Starts Before, Turns Inplay, and Competition Ids that can be used to refine the list.

    You then need to break the list of marketIds into smaller batches that you then pass to listMarketBook. Note that listMarketBook can only return at limited amount of data per request so the size of a batch will depend on how much data you want per marketId. I pass 40 marketIds at a time to listMarketBook.

    I'd recommend you read the API-NG documentation:
    HTML Code:
    https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/API-NG+Overview
    And also learn to use the Visualiser. This is a great help when learning the various functions:
    HTML Code:
    https://developer.betfair.com/visualisers/api-ng-sports-operations/
    There is information about this in the "Getting Started" section of the documentation

    Hope that helps,
    Tony

    Comment

    • skit
      Junior Member
      • Apr 2014
      • 7

      #3
      Thank you so much for your help.

      Just another quick question. I have indeed changed the code to reflect what you said and now in just 2 requests (dependent on the number of events but on an ideal situation) I can get all the information needed.

      One listMarketCatalogue call and a subsequent listMarketBook call.

      Im considering joining the results of this two queries by marketId (in a Dictionary for example) but an easier way of doing this could be simply "merging" the first marketCatalogue with the first marketBook and so on (to get all the information needed about each market "in one place").
      Can the order by which this results are returned be trusted? I know listMarketCatalogue follows my marketSort 'restriction' but will the listMarketBook follow it too?

      Thank you!

      Comment

      Working...
      X