Getting list of all todays races using Java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mayoman1973
    Junior Member
    • Jan 2017
    • 8

    #1

    Getting list of all todays races using Java

    I have downloaded the Java Betfair client library https://github.com/joelpob/jbetfairng
    So far so good. I have it logging in, retrieving basic market data but now trying to find some specific data. Namely a list of all todays races with the win & place prices for each horse.
    Doesn't look like this Java client is capable of doing this so I think I need to implement a new method to do this. First place I am stuck in is trying to get a list of marketIDs for all horse races. I figure with a list of market IDs I could progress a bit further using other methods in this client.
    Any ideas how I might do this?
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    First you'll want the MarketCatalogues for each of the day's races. They contain the marketIds for the WIN and PLACE markets.

    The following is a call my Visual Basic.Net program uses to get all the win and place markets for a day for all races in Great Britain, Ireland, and France. Each returned MarketCatalogue includes the marketId which you can use to do listMarketBook calls to get the odds.

    The parameters here are the API call and the parameters to pass. They are used to create the string sent to retrieve the required data. I don't know what the Java code looks like, but as you've already retrieved some data, this will probably make sense to you.

    Code:
          
    API_sendBetReq("listMarketCatalogue", """filter"":{""eventTypeIds"":[""7""],""marketStartTime"":{""from"": """ & date1 & """,""to"":""" & date1.Substring(0, 10) & "T23:59:00Z""},""marketTypeCodes"":[""WIN"",""PLACE""],""marketCountries"":[""GB"",""FR"",""IE""]},""maxResults"":""400"",""marketProjection"":[""MARKET_START_TIME"",""RUNNER_DESCRIPTION"",""EVENT""]")

    Comment

    • mayoman1973
      Junior Member
      • Jan 2017
      • 8

      #3
      Cheers Jabe, exactly the answer I was hoping for.

      Comment

      Working...
      X