Black Ops 4 Stats API data fetch


I am trying to get my head around how to pull a specific string of information from a Black Ops 4 stats API.

The API itself is and the specific string of information I would want to collect would be Stats 14 (Win %) and then the value.

I have only very limited knowledge of coding, and what I have tried have just failed as I don’t really know what I am doing.

Where would I even begin with this? I believe it should be a geturl, but after that I do not understand how I get the sub-string of the API url…

If anyone could help I would be very grateful


Use $(eval) to turn the info from the API into a JS object:

!addcom -cd=5 !winpercent $(eval a=JSON.parse(`$(urlfetch json`);[14].displayValue)
1 Like

Amazing! Thank you kindly, it works like a charm :slight_smile:

How can I get more then one string without using the same $(eval) twice in an command?
Let’s say for data.stats[15] and [14]


!addcom -cd=5 !winpercent $(eval a=JSON.parse...;[14].displayValue+` `[15].displayValue)
1 Like

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