How to get listEvents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thebettrader
    Junior Member
    • Apr 2016
    • 35

    #1

    How to get listEvents

    Hello,

    I am trying to return all events for "soccer" and "basketball" which starts within 24 hours.
    I just edited the post as I found out the problem. So the below code actually does work with an
    exception:

    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEvents", "params": {"filter":{"eventTypeIds": ["1","7522"] },"marketStartTime":{"from":"2016-05-16T22:53:00Z","to":"2016-05-17T22:53:00Z"},"inPlayOnly": "false"}, "id": 1}


    There are events returned much later in datetime as this event for example, - even that I have specified from/to within 24 hours?

    event":{"id":"27628499","name":"Portugal v Austria","countryCode":"FR","timezone":"Europe/London","openDate":"2016-06-18T19:00:00.000Z"},"marketCount":1}



    Also another question came up. The above code doesn't return the odds for the events.

    How could it be possible to include odds for moneyline/match betting,Total,Spread along
    with above code when returning all events within 24 hours?

    Thank you!
    Last edited by thebettrader; 16-05-2016, 10:40 PM.
  • dashee
    Junior Member
    • May 2015
    • 6

    #2
    Originally posted by thebettrader View Post
    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEvents", "params": {"filter":{"eventTypeIds": ["soccer,basketball"] },"marketStartTime":{"from":"2016-05-16T22:53:00Z","to":"2016-05-17T22:53:00Z"},"inPlayOnly": "false"}, "id": 1}
    There's a few errors that I can spot. Firstly, eventTypeIds take numerical values. For example, football is 1, tennis is 2, horse racing is 7 and basketball is 7522 (these IDs can be obtained from a listEventTypes call). Secondly, each id should have its own quotation marks, so your query should look something like this:

    {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEvents", "params": {"filter":{"eventTypeIds": ["1","7522"] },"marketStartTime":{"from":"2016-05-16T22:53:00Z","to":"2016-05-17T22:53:00Z"},"inPlayOnly": "false"}, "id": 1}

    Comment

    • dashee
      Junior Member
      • May 2015
      • 6

      #3
      Originally posted by thebettrader View Post

      There are events returned much later in datetime as this event for example, - even that I have specified from/to within 24 hours?

      event":{"id":"27628499","name":"Portugal v Austria","countryCode":"FR","timezone":"Europe/London","openDate":"2016-06-18T19:00:00.000Z"},"marketCount":1}



      Also another question came up. The above code doesn't return the odds for the events.

      How could it be possible to include odds for moneyline/match betting,Total,Spread along
      with above code when returning all events within 24 hours?

      Thank you!

      I suspect you're seeing those events because of a misplaced curly bracket. The curly bracket should appear after the inPlayOnly parameter, not the eventTypeIDs. Placing it after eventTypeIDs just nullifies the additional arguments.

      As for the other question, if you know you want all the Match Odds football markets for the next 24 hours, for example, you could instead use listMarketCatalogue with an additional marketTypeCodes argument. Once you have the market IDs, you can then get price information by calling listMarketBook and passing the market IDs.

      Comment

      • thebettrader
        Junior Member
        • Apr 2016
        • 35

        #4
        Originally posted by dashee View Post
        I suspect you're seeing those events because of a misplaced curly bracket. The curly bracket should appear after the inPlayOnly parameter, not the eventTypeIDs. Placing it after eventTypeIDs just nullifies the additional arguments.

        As for the other question, if you know you want all the Match Odds football markets for the next 24 hours, for example, you could instead use listMarketCatalogue with an additional marketTypeCodes argument. Once you have the market IDs, you can then get price information by calling listMarketBook and passing the market IDs.
        Thank you, yes I noticed also that I should call with integers to return the sports and the curly bracket did solve the problem also.

        Yes, I will try to see how I am able to use the listMarketBook to return the odds in the manner you describe.

        Thank you for your help!

        {"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEvents", "params": {"filter":{"eventTypeIds": ["1","7522"] ,"marketStartTime":{"from":"2016-05-17T00:41:00Z","to":"2016-05-18T00:41:00Z"},"inPlayOnly": "false"}}, "id": 1}

        Comment

        Working...
        X