warzone-api
v1.0.8
Published
A JS wrapper for the CoD warzone API
Downloads
11
Readme
warzone-api-wrapper
A JS wrapper for the CoD Warzone API
npm install warzone-api
const WarzoneAPI = require('warzone-api')
const api = WarzoneAPI();
//Using async await
const getPlayerStats = async (platform, username) => {
await api.login('valid activision email', 'valid activision password');
const response = await api.getStats(platform, username);
return response;
}
//Promise chaining
api.login('valid activision email', 'valid activision password')
.then(() => {
return api.getStats('psn', 'Bojo704')
}).then((response) => {
console.log(response)
});
api.login('valid activision email', 'valid activision password').then(() => //do something);
api.getMatchDetails('match id').then((json) => //do something);
//Available options for the platform argument are battle, psn, or xbl
api.searchPlayer('platform', 'username').then((json) => //do something);
//Available options for the platform argument are battle, psn, or xbl
api.getStats('platform', 'username').then((json) => //do something);
//Available options for the platform argument are battle, psn, or xbl
api.getMatches('platform', 'username').then((json) => //do something);