Call Of Duty API Command

Been banging my head against the wall for about a week with this.
I want to create a command that will show my real time stats for Modern Warfare but I can’t figure it out. I have the public API link ( but can’t get any further.

Exactly what values in the JSON payload do you want Nightbot to output?

Hi, thanks for replying.
I was hoping to get top stats lke, total kills, best kdr, best kill streak, total suicides, best kills and most deaths.

I wrote the following command code that outputs the following values: kills, bestKD, bestKillStreak, suicides, bestKills, deaths.

$(eval a=JSON.parse(decodeURIComponent(`$(querystring $(urlfetch json`));`Total Kills: ${a.kills} | Best KDR: ${a.bestKD} | Best Kill Streak: ${a.bestKillStreak} | Total Suicides: ${a.suicides} | Best Kills: ${a.bestKills} | Most Deaths: ${a.deaths}`)

You, are an absolute legend! THANK YOU!

Is there any way to have this put in a format for just warzone stats? would just be kills, KD, Score, and wins?

Exactly where in the JSON payload are the warzone stats located?

I’m not entirely sure what you mean, relatively new to this, im just looking for a way to pull realtime stats from to be shown just like the command in this thread shows?

I was able to write a command for the original poster because they provided a URL that gave their COD stats in JSON format ( and told me specifically what stats they wanted Nightbot to output.

I want you to do the same. I may have found a URL for your COD stats ( but I’d like to you confirm those stats are yours as well as exactly what stats values in the JSON you want Nightbot to output.

yes that is correct, this is is the info i would like in the command “wins”:37.0,“kills”:1187.0,“kdRatio”:2.173992673992674,“downs”:1393.0,“topTwentyFive”:214.0,“topTen”:132.0,“contracts”:253.0, “topFive”:90.0,“score”:1218420

It seems you’ve been playing since you replied, as your current stats are a little different now and took a while to find. I still managed to find what I think are the right stats.

$(eval a=JSON.parse(decodeURIComponent(`$(querystring $(urlfetch json`));`Total Wins: ${a.wins} | Total Kills: ${a.kills} | Best KDR: ${a.kdRatio} | Total Downs: ${a.downs} | Top 25: ${a.topTwentyFive} | Top 10: ${a.topTen} | Total Contracts: ${a.contracts} | Top 5: ${a.topFive} | Score: ${a.score}`)
1 Like

You are a god, that is amazing, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.