obtaining back and lay prices from horse racing UK

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sanjay
    Junior Member
    • Jul 2020
    • 4

    #1

    obtaining back and lay prices from horse racing UK

    I'm looking for some help on how to obtain current available back and lay odds of a selection, i have been using James Butler's Programming for Betfair and have typed in the code (updated according to website) and checked for typos, at present it displays market id, course, selection id, etc but the back and lay columns remain empty, i am new to programming.
    any help is much appreciated!

    ​​​​​​​cheers
  • MarcusMel
    Junior Member
    • Aug 2009
    • 19

    #2
    Most of what you need to know is in the sample code stored on github.
    https://docs.developer.betfair.com/#...-Documentation.

    I do not know which programming language James Butler uses in his sample code.

    Prices are available in a call to listmarketbook and are in an array called ex.

    sample send
    -------------------Send Data-----------------------------------
    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.160934221"],"priceProjection":{"priceData":["EX_BEST_OFFERS"]}}, "id": 1}
    ------------------------------------------------------

    Here is a cut sample of what is returned in a Jason string

    {"jsonrpc":"2.0","result":[{"marketId":"1.160934221","isMarketDataDelayed" :fa lse,"status":"OPEN","betDelay":0,"bspReconciled":f alse,"complete":true,"inplay":false,"numberOfWinne rs":1,"numberOfRunners":13,"numberOfActiveRunner s" :12,"lastMatchTime":"2019-08-03T15:40:44.267Z","totalMatched":228327.64,"totalA vailable":870489.68,"crossMatching":true,"runnersV oidable":false,"version":2878880017,"runners":[{"selectionId":20838557,"handicap":0.0,"status" :"A CTIVE","adjustmentFactor":22.547,"lastPriceTraded" :5.8,"totalMatched":62314.79,"ex":{"availableToBack":[{"price":5.7,"size":100.72},{"price":5.6,"size" :27 6.46},{"price":5.5,"size":419.76}],"availableToLay":[{"price":5.8,"size":107.03},{"price":5.9,"size" :13 4.77},{"price":6.0,"size":248.26}],"tradedVolume":[]}},

    Note calling "ex":{ an array is probably incorrect.
    Last edited by MarcusMel; 21-12-2020, 02:51 PM.

    Comment

    • Sanjay
      Junior Member
      • Jul 2020
      • 4

      #3
      Thanks for the reply MarcusMel, ive cracked it eventually.

      Comment

      Working...
      X