When I call `listEventTypes` with a filter on for Soccer, but all markets it usually gives me around 14,000 markets as marketCount.
Yet when I try and get hold of these markets with `listMarketCatalogue` I typically get more than this because maybe 2000 are duplicates. Maybe there's a problem with my paging method:
Since maxResults is 1000 for this endpoint, I usually try to page through the markets returned by having them returned date sorted, then getting the datetime of the last market and feeding it into the next call as the `fromDate` parameter (any better ways to get all these markets more than welcome). In python code, my request params look like:
I then just grab the new `fromDate` of the last item like
(remembering the `FIRST_TO_START` sorting), and feed that into the next call. Rince and repeat until no more markets to grab.
How can I do it without getting so many duplicates? (even using the marketType filter will not help me as for example "Match Odds" usually have near 1500 markets, so still hit the same problem)
Yet when I try and get hold of these markets with `listMarketCatalogue` I typically get more than this because maybe 2000 are duplicates. Maybe there's a problem with my paging method:
Since maxResults is 1000 for this endpoint, I usually try to page through the markets returned by having them returned date sorted, then getting the datetime of the last market and feeding it into the next call as the `fromDate` parameter (any better ways to get all these markets more than welcome). In python code, my request params look like:
Code:
mFilter = {"eventTypeIds": ["1"]
"marketStartTime": {"from": fromDate}
}
projection = ["EVENT", "COMPETITION", "RUNNER_DESCRIPTION"]
market_catalogue_req = json.dumps({'jsonrpc': '2.0',
'method': 'SportsAPING/v1.0/listMarketCatalogue',
'params': {'filter': mfilter,
'maxResults': '1000',
'marketProjection':
projection,
'sort': 'FIRST_TO_START',
},
'id': 1,
})
Code:
fromDate = marketCatalogue['result'][-1]['event']['openDate']
How can I do it without getting so many duplicates? (even using the marketType filter will not help me as for example "Match Odds" usually have near 1500 markets, so still hit the same problem)


Comment