A JS wrapper for the CoD warzone API
npm install warzone-api
npm install warzone-api
`
How to use
- Create an instance
- Call the login method with valid activision login information
- Make requests for whatever data you'd like
`javascript
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)
});
`
Methods
Login
Pass in valid login information to this method to gain access to the methods that require authentication
`javascript
api.login('valid activision email', 'valid activision password').then(() => //do something);
`
Get Match Details
This method will return a json object containing all details about the requested match
`javascript
api.getMatchDetails('match id').then((json) => //do something);
`
Search Player
This method will return a json object containing details about whether the requested players exists
`javascript
//Available options for the platform argument are battle, psn, or xbl
api.searchPlayer('platform', 'username').then((json) => //do something);
`
Get Stats
This method will return a json object containing the requested players stats
`javascript
//Available options for the platform argument are battle, psn, or xbl
api.getStats('platform', 'username').then((json) => //do something);
`
Get Matches
This method will return a json object containing the requested players recent matches
`javascript
//Available options for the platform argument are battle, psn, or xbl
api.getMatches('platform', 'username').then((json) => //do something);
``