Question about listMarketBook and priceProjection.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pacheco
    Junior Member
    • Jan 2022
    • 3

    #1

    Question about listMarketBook and priceProjection.

    Hello,

    I would like to get the odds exactly as they are on the Betfair website, I did it as in the example shown in the pdf but it didn't work.

    Could anyone show what is wrong or how to solve this problem ?​


    The code is:

    import requests

    import json

    url="https://api.betfair.com/exchange/betting/json-rpc/v1"

    header = { 'X-Application' : 'APP_KEY_HERE', 'X-Authentication' : 'SESSION_TOKEN_HERE' ,'content-type' : 'application/json' }

    req = '{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params":{"marketIds":["1.220230988"],"priceProjection":{"priceData":["EX_ALL_OFFERS"],"virtualise":"True"}}, "id": 1}'

    response = requests.post(url, data=req, headers=header)

    print(json.dumps(json.loads(response.text), indent=3))




    The result is:


    ...

    "availableToLay": [
    {
    "price": 2.1,
    "size": 497.62
    },
    {
    "price": 2.12,
    "size": 4776.93
    },
    {
    "price": 2.14,
    "size": 517.96
    }
    ],​





    Thanks
    You do not have permission to view this gallery.
    This gallery has 1 photos.
  • BetfairDeveloperProgram
    Administrator
    • Oct 2008
    • 680

    #2
    Morning pacheco.

    There could be a number of reasons for this, including logged out use of the Betfair website, using the Delayed App Key via the API while logged into the website etc.

    Please see the FAQ via https://support.developer.betfair.co...I-application-

    Kind Regards

    Neil

    Comment

    • pacheco
      Junior Member
      • Jan 2022
      • 3

      #3
      Originally posted by BetfairDeveloperProgram View Post
      Morning pacheco.

      There could be a number of reasons for this, including logged out use of the Betfair website, using the Delayed App Key via the API while logged into the website etc.

      Please see the FAQ via https://support.developer.betfair.co...I-application-

      Kind Regards

      Neil

      Morning Neil,

      I read your article and realized that my mistake was using the delayed app key.
      When I switched to the working key, the results came correctly.

      Thank you very much.​

      Célio Pacheco

      Comment

      Working...
      X