Using the Service Record API I’m able to retrieve “TotalGamesCompleted”, but using that is the “start” offset for Matches for Player it shows there are more entries. Come to realize that value does not include the number of matches that weren’t finished. Because of how the Matches for Player API places the oldest match at the furthest “start” I need a solid way of knowing what that value is. Otherwise I’ll just be using “TotalGamesCompleted” and marching backwards in counts of 25 until I reach the end.
(Unfortunately) this is how I do it too.
If you want to find the first game a player has played you can either:
Blindly loop through all matches from the start, 25 at a time, until your response doesn’t contain 25 matches. - Blindly loop through all matches using TotalGamesCompleted as an start offset, 25 at a time, until your response doesn’t contain 25 matches.Either way, it’s not a very efficient search. A couple of solutions for 343 could be:
Allow the match history to be queried in reversed. - Provide a TotalGamesPlayed on the service record.
> - Allow the match history to be queried in reversed.
This would be easiest I feel, a simple sort=ASC/DESC parameter.
This is true. Simply knowing the offset would still be a pain because the offset changes with each match. Having a “sort” function would be very useful.