Hi there!
I mod a few channels on twitch and stumbled upon a thread on Nightdev community where someone needed help fetching data from the COD tracker API. The thread I'm referring to is this: /t/warzone-custom-api-command/1534609341339144445#m1534609346342817922
I really love it, but it seems it fetches data from plunder and battle royale combined. I'd like to only display the values on Battle Royale, but I can't figure out how to filter through these results as they all have the same tags (like kdRatio is displayed 3 times). Since I'd like to implement this command for the #1 NA kills player, it's important it only shows the value of kills, deaths and KD from Battle Royale, not including plunder.
https://i.imgur.com/yA1AdQ8.png this shows you the values combined (the first value highlighted) and the 2nd value which we want to display. From what I've seen, the only difference is this part which is in the code before it shows the 2nd value:
{"type":"mode","attributes":{"mode":"br"},"metadata":{"name":"Battle Royale"}
which obviously refers to the Battle Royale value.
I have no clue how to get the 2nd result, as the command will only display the first result. Is anyone able to help me out on this matter?
The command used (copied from the thread link above, adjusted to match one of the streamers I mod for) is:
$(eval s=$(urlfetch json https://api.tracker.gg/api/v2/warzone/standard/profile/battlenet/PORK%2311126/).data.segments[0].stats; r=s.kdRatio.value; k=s.kills.value; d=s.deaths.value; w=s.wins.value; Wins: ${w} | Kills: ${k} | Deaths: ${d} | Kills/Deaths Ratio: ${r})Thanks in advance!