how to get WIN/PLACE price using listMarketBook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gilliandoherty
    Junior Member
    • Nov 2018
    • 3

    #1

    how to get WIN/PLACE price using listMarketBook

    currently i am getting the back/lay price using listMarlketBook for WIN market. How do i retrieve the back/lay price for PLACE market. I tried to add the parameter marketType:WIN, PLACE but still getting only for WIN market. Can anyone suggest the correct method.
  • ajw
    Junior Member
    • Sep 2018
    • 14

    #2
    What market is this ? You have code ?

    Comment

    • gilliandoherty
      Junior Member
      • Nov 2018
      • 3

      #3
      I am checking for Horse race. The json format is as below. where marketIds is the real id of the market

      {""jsonrpc"": ""2.0"", ""method"": ""SportsAPING/v1.0/listMarketBook"", ""params"": {""marketIds"": ["" + marketIds + """], ""marketTypeCodes"":[""WIN"",""PLACE""], ""priceProjection"": {""priceData"": [""EX_BEST_OFFERS""],""orderProjection"":[""ALL""]}}, ""id"": 1}

      Comment

      • ajw
        Junior Member
        • Sep 2018
        • 14

        #4
        I don't think that's how it works. The place market has its own marketID

        Comment

        • BetfairDeveloperProgram
          Administrator
          • Oct 2008
          • 679

          #5
          Hi gilliandoherty,

          The listMarketBook operation doesn't accept marketTypeCodes, you need to make a request to listMarketCatalogue to retrieve the PLACE marketId's and then request these marketId/s via listMarketBook, for example (for PLACE markets only)

          Request

          Code:
          [{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketCatalogue", "params": {"filter":{"marketCountries":["GB"],"marketTypeCodes":["PLACE"],"marketStartTime":{"from":"2018-11-05T23:00:00Z","to":"2018-11-06T22:45:00Z"}},"maxResults":"200"}, "id": 1}]

          Response (snippet)
          Code:
          [{"jsonrpc":"2.0","result":[{"marketId":"1.150795364","marketName":"To Be Placed","totalMatched":7987.76},{"marketId":"1.150801947","marketName":"To Be Placed","totalMatched":1121.18},{"marketId":"1.150796264","marketName":"To Be Placed","totalMatched":0.0},{"marketId":"1.150790565","marketName":"To Be Placed","totalMatched":4129.38},.......
          listMarketBook Request

          Code:
          [{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.150795364"],"priceProjection":{"priceData":["EX_BEST_OFFERS","EX_TRADED"]},"orderProjection":"ALL"}, "id": 1}]
          Response (snippet)

          Code:
          {"jsonrpc":"2.0","result":[{"marketId":"1.150795364","isMarketDataDelayed":false,"status":"SUSPENDED","betDelay":1,"bspReconciled":true,"complete":true,"inplay":true,"numberOfWinners":3,"numberOfRunners":11,"numberOfActiveRunners":10,"lastMatchTime":"2018-11-06T14:03:09.964Z","totalMatched":0.0,"totalAvailable":0.0,"crossMatching":true,"runnersVoidable":false,"version":2500013739,"runners":[{"selectionId":11238580,"handicap":0.0,"status":"ACTIVE","adjustmentFactor":30.365,"ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}},{"selectionId":10991110,"handicap":0.0,"status":"ACTIVE","adjustmentFactor":21.578,"ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}},{"selectionId":11383707,"handicap":0.0,"status":"ACTIVE","adjustmentFactor":20.248,"ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}},{"selectionId":11223212,"handicap":0.0,"status":"ACTIVE","adjustmentFactor":19.551,"ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}},

          Thanks

          Neil

          Comment

          • gilliandoherty
            Junior Member
            • Nov 2018
            • 3

            #6
            @Neil : Thanks for the information

            Comment

            Working...
            X