Call Of Duty API Command

Asked Mar 10, 2020·11 replies·Last activity 6 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

11 replies

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 https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/psn/gamer/squidlegz2014/profile/type/mp))`)).data.lifetime.all.properties;`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 was able to write a command for the original poster because they provided a URL that gave their COD stats in JSON format (https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/psn/…) 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 (https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/psn/…) 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 https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/psn/gamer/Dumpauss/profile/type/mp))`)).data.lifetime.mode.br_all.properties;`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}`)

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

Didn't find your answer? The community is on Discord.

Ask on Discord