npm install call-of-duty-api
const API = require('call-of-duty-api')();
or
const API = require('call-of-duty-api')({ platform: "battle" });
- psn
- steam
- xbl
- battle
- acti
- uno ( numerical identifier )
!> Login is required to remove any restrictions on certain endpoints.
try {
await API.login(<username>, <password>);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWLeaderboard(<page>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWcombatmp(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWcombatwz(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWmp(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWwz(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWBattleData(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWweeklystats(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWloot(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWAnalysis(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.MWMapList();
} catch(Error) {
//Handle Exception
}
try {
let data = await API.getBattlePassLoot(<season>, <platform>?);
} catch(Error) {
//Handle Exception
}
!> To search all platforms, pass in 'all'
try {
let data = await API.FuzzySearch(<text>, <platform>?);
} catch(Error) {
//Handle Exception
}
try {
let data = await API.getPurchasable(<platform>?);
} catch(Error) {
//Handle Exception
}
!> Logged in user only
try {
let data = await API.getCodPoints(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
!> Logged in user only
try {
let data = await API.getLoggedInUserInfo();
} catch(Error) {
//Handle Exception
}
!> Logged in user only
try {
let data = await API.ConnectedAccounts(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
!> Logged in user only
try {
let data = await API.getEventFeed();
} catch(Error) {
//Handle Exception
}
!> Logged in user only
try {
let data = await API.getLoggedInIdentities();
} catch(Error) {
//Handle Exception
}
!> Logged in user only
try {
let data = await API.Settings(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}