How to track grenade spartan kills via the API?

Hello- I’ve been using a little script to track my spartan company’s commendation progress on a per player basis.

> var arenaResponse = UrlFetchApp.fetch('https://www.haloapi.com/stats/h5/servicerecords/arena?players=’+name, {headers: headers});
> var arenaData = JSON.parse(arenaResponse.getContentText());
> var arenaGrenades = arenaData.Results[0].Result.ArenaStats.TotalGrenadeKills;
> var warzoneResponse = UrlFetchApp.fetch('https://www.haloapi.com/stats/h5/servicerecords/warzone?players=’+name, {headers: headers});
> var warzoneData = JSON.parse(warzoneResponse.getContentText());
> var warzoneGrenades = warzoneData.Results[0].Result.WarzoneStat.TotalGrenadeKills;

We then add warzoneGrenades and arenaGrenades to get their total number of grenade kills, and then we compare that with how many grenade kills they had one week before so we can see how many grenade kills they got this week.

Anyways, this system has been working great (or so I thought) until WZ firefight came out. As it turns out, killing an enemy AI with a grenade will increase the warzone’s TotalGrenadeKills property. Since AI grenade kills don’t count towards the company commendation, I would like a way to track just the spartan kills.

On a related note, if you kill somebody with a plasma grenade or splinter grenade, do you know if you still earn a “grenade kill” medal? I could just look at those, but I think you can only get those if you use a frag. If they do give you a kill, would I need to add grenade kills + stuck medals together? And/or hail mary? I’m just not sure if it ALWAYS awards a “Grenade Kill” medal every time you actually get a grenade kill.

How did you track regular warzone and even regular warzone then? There are marines and AI in both of those that when killed with a grenade I imagine will increase the property. Short of doing the research in a custom game to see if you get a Grenade kill medal on every grenade kill against a spartan, then doing a warzone match and killing an AI with a grenade and comparing is my best bet.

In a perfect world, there would be group commendation endpoint.

Well, I’m guessing that the warzone stats probably has been wrong the whole time and we just didn’t notice it until now because there were so few AI grenade kills happening.

I think you would need to use the new “Events for Match” stats.

You’d have to collect all of a player’s matches from the past week using “Matches for Player”.

Then get the Event stats for each match and count each kill where:

The killer was the player who’s stats you’re collecting:
“Killer.Gamertag == Player.gamertag”
The kill was with a grenade:
“KillerWeaponStockId == GrenadeId”
The victim was another player (not AI)
“VictimAgent==1”

Thanks Seph! That looks like it would work… not a very fun solution, but doable. Thanks.