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 https://cod-api.tracker.gg/v1/standard/bo4/profile/6/Marre-2788 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 https://cod-api.tracker.gg/v1/standard/bo4/profile/6/Marre-2788)`);a.data.stats.displayValue)
Amazing! Thank you kindly, it works like a charm
How can I get more then one string without using the same $(eval) twice in an command?
Let’s say for data.stats and 
!addcom -cd=5 !winpercent $(eval a=JSON.parse...;a.data.stats.displayValue+` `+a.data.stats.displayValue)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.