filter: marketStartTime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NiLEVentures
    Junior Member
    • Nov 2012
    • 2

    #1

    filter: marketStartTime

    I cannot seem to get the marketStartTime filter to work. Here is an example of my JSON-RPC. I am trying to get the markets for tomorrow 26th Feb but the response is still returning markets for 25th Feb.
    Any suggestions?
    {
    "jsonrpc":"2.0",
    "method":"SportsAPING/v1.0/listEventTypes",
    "params":{
    "filter":{
    "eventTypeIds":[
    "7"
    ],
    "marketCountries":[
    "GB",
    "IE"
    ],
    "marketTypeCodes":[
    "WIN"
    ]
    },
    "marketStartTime":{
    "from":"2015-02-26T00:00:00Z",
    "to":"2015-02-26T23:59:59Z"
    }
    },
    "id":1
    }
    Last edited by NiLEVentures; 25-02-2015, 08:11 PM. Reason: Improve formating
    NB: There are 10 types of people in the world, those who understand the binary system and those who don't
  • Merlin
    Junior Member
    • Jan 2009
    • 56

    #2
    Hi NiLEVentures,

    in your code, you are calling 'listEventTypes', which is probably not what you want. If you want a list of the WIN markets in the UK and Ireland for a particular day, you should be using listMarketCatalogue. Your filter looks OK, so the only thing you would need to add is a 'maxResults' parameter. You might also want to look at the 'marketProjection' parameter, as the basic call doesn't return very much information.

    Cheers

    Merlin

    Comment

    • NiLEVentures
      Junior Member
      • Nov 2012
      • 2

      #3
      Applying marketfilter to listMarketCatalogue

      Hi Merlin - thank you for taking the time to read and reply to my post.

      I used the call to "listEventTypes" for illustrative purposes, because it is very straight forward. You are correct in your deduction that i really want the data from "listMarketCatalogue.
      Here is the my full call to "lismarketCatalogue". You will see that this time I have set the "marketStartTime" dates "2014" in the "marketfilter" but I still get a response containing all the current available data.

      I must be doing something fundamentally wrong because if this is an error in the "marketfilter", there would be a lot of people jumping up and down about it.

      Here is the call:
      {
      "jsonrpc":"2.0",
      "method":"SportsAPING/v1.0/listMarketCatalogue",
      "params":{
      "filter":{
      "eventTypeIds":[
      "7"
      ],
      "marketCountries":[
      "GB",
      "IE"
      ],
      "marketTypeCodes":[
      "WIN"
      ]
      },
      "marketStartTime":{
      "from":"2014-02-26T00:00:00Z",
      "to":"2014-02-26T23:59:59Z"
      },
      "sort":"FIRST_TO_START",
      "maxResults":"28",
      "marketProjection":[
      "EVENT",
      "MARKET_START_TIME",
      "RUNNER_METADATA"
      ]
      },
      "id":1
      }
      NB: There are 10 types of people in the world, those who understand the binary system and those who don't

      Comment

      • gus
        Senior Member
        • Jan 2009
        • 134

        #4
        I use listEvents to get my list of Horse Racing Meetings for the day, so my (REST) cal to listEvents looks like:

        https://api.betfair.com/exchange/betting/rest/v1.0/listEvents/{"filter":{"marketCountries":["GB","IE"],"marketStartTime"
        :{"from":"2015-03-04T00:00:00.136Z","to":"2015-03-04T23:59:59.136Z"},"eventTypeIds":["7"]}}

        The point is, that works in the sense that I get only events between the specified from and to dates.

        I wonder if there's something wrong with the format of your dates ... they look un-JSONish to me because JSON dates usually have three decimal places after the seconds (milliseconds presumably?) They should conform to ISO8601 apparently. It might be worth looking at:

        http://stackoverflow.com/questions/1...on-date-format

        Personally I just get a Timestamp for the dates I want and then do a bit of string parsing on it to get it to look JSON-ish, but I'm sure there are better approved methods!

        Of course I may be barking up the wrong tree entirely, but it might be worth a try.

        Comment

        • Fred77
          Junior Member
          • Jan 2009
          • 37

          #5
          Your marketStartTime should be within filter section. If you put your JSON into a formatter it makes it easier to read. e.g. I just tried http://jsonformatter.curiousconcept.com/

          Code:
          {
            "jsonrpc":"2.0",
            "method":"SportsAPING/v1.0/listMarketCatalogue",
            "params":{
              "filter":{
                "eventTypeIds":[
                  "7"
                ],
                "marketCountries":[
                  "GB",
                  "IE"
                ],
                "marketTypeCodes":[
                  "WIN"
                ],
                "marketStartTime":{
                  "from":"2014-02-26T00:00:00Z",
                  "to":"2014-02-26T23:59:59Z"
                }
              },
              "sort":"FIRST_TO_START",
              "maxResults":"28",
              "marketProjection":[
                "EVENT",
                "MARKET_START_TIME",
                "RUNNER_METADATA"
              ]
            },
            "id":1
          }

          Comment

          • merecat_
            Junior Member
            • May 2009
            • 35

            #6
            Anyone struggling with formatting should open the visualiser in a good browser (e.g. Chrome), open the debug tools (F12), make the request, and then observe the format of the request - for this it is helpful to pump it into a tool like this: jsonformatter.curiousconcept.com

            Comment

            Working...
            X