NightDev Community Forums

Warzone/Rebirth Custom API Command

Hi, I used this command provided by Emily and everything worked well. I was trying to make it pull my K/D from the Rebirth/Resurgence Quads section. I’ve spent hours trying to figure it out and I thought I would go ahead and ask for assistance. I’ve viewed the api and I see where the rebirth K/D is, I just don’t know how to pull it from there. Can anyone offer assistance?

Here is my command:

$(eval s=$(urlfetch json https://api.tracker.gg/api/v2/warzone/standard/profile/battlenet/REXX%2311248/).data.segments[0].stats; r=s.kdRatio.value; k=s.kills.value; d=s.deaths.value; w=s.wins.value; `Warzone KD: ${r}`)

Here is where I see the Rebirth K/D all the way at the bottom:

https://api.tracker.gg/api/v2/warzone/standard/profile/battlenet/REXX%2311248/

I opened it up in this:
https://jsonformatter.curiousconcept.com/#

& I just don’t know how to pull it.

You’ll want this:

jsonObject.data.segments[3].stats.Argument.displayValue

List of arguments are:
kills, wins, wlRatio, kdRatio, gamesPlayed, or top10

also if you want the rank instead replace displayValue with rank

Hey Potato, thank you! I forgot to respond to this post as solved. It was under review. I ended up only using KD and wins, then it started working. I guess one of the variables wasn’t under segment 3?

1 Like