Skip to main content

Forums / Support / Halo API Support

Endpoint to get Halo 5 Spartan Rank?

OP radiactivepeter

I have recently been using the Halo API and so far I'm really enjoying it.
Nevertheless, I want to ask a question: is there a more simple endpoint for obtaining the player's spartan rank? Other than the "Halo 5 - Player Service Records - Arena". (https://developer.haloapi.com/docs/services/58acdf27e2f7f71ad0dad84b/operations/Halo-5-Player-Service-Records-Arena/console) ?

My motivation for this question is that I'm building a rather simple and fast application and I don't need all the data provided by the "Halo 5 - Player Service Records - Arena" endpoint, only the SpartanRank value.

If there isn't another way, then consider this topic as a suggestion regarding future api's like Halo: Infinite or if an update for the current api happens :)

Thanks!
Hello!

You're correct that the only way to retrieve Halo 5 Spartan Ranks is via the Service Record API.

Thanks for your interest in the API and for your feedback!
Hello!

You're correct that the only way to retrieve Halo 5 Spartan Ranks is via the Service Record API.

Thanks for your interest in the API and for your feedback!
Hey Respected Sir, is there any way to find when a player achieved a certain rank, for example when a player got Spartan Rank 152? I was hoping there is something similar to the CompletedDateUTC with commendation levels but for Spartan Ranks.
Hm, it's possible to get this information, but it's tricky. The only place where we provide historical rank information is via the Match Result endpoint. So you could crawl through a player's Match History and try to find the match where their "PrevSpartanRank" was 151 and their "SpartanRank" was 152. The Match Result endpoint unfortunately does not include when the match happened - you'll have to remember that information from the Match History endpoint.

A potential optimization exists where you could use a modified version of binary search so that you don't have to retrieve every match in a player's match history, in order to save on API calls against your rate limit. However, even with this, it'd still be expensive in terms of time and API calls in order to determine this information on-demand - you might be tempted to cache it or even attempt to precompute it.

I know this probably wasn't the answer you were looking for, but hopefully this helps.
Hm, it's possible to get this information, but it's tricky. The only place where we provide historical rank information is via the Match Result endpoint. So you could crawl through a player's Match History and try to find the match where their "PrevSpartanRank" was 151 and their "SpartanRank" was 152. The Match Result endpoint unfortunately does not include when the match happened - you'll have to remember that information from the Match History endpoint.

A potential optimization exists where you could use a modified version of binary search so that you don't have to retrieve every match in a player's match history, in order to save on API calls against your rate limit. However, even with this, it'd still be expensive in terms of time and API calls in order to determine this information on-demand - you might be tempted to cache it or even attempt to precompute it.

I know this probably wasn't the answer you were looking for, but hopefully this helps.
Thanks for your response, good to know it's possible. Like you said, it will be an expensive operation so might not be something I can include in my app right now but hopefully in the future I can find a way. Thanks Sir!