Install
npm install call-of-duty-api
Usage
const API = require('call-of-duty-api')();
or
const API = require('call-of-duty-api')({ platform: "battle" });
Platforms
- psn
- steam
- xbl
- battle
- acti
- uno ( numerical identifier )
Login :id=login
!> Login is required to remove any restrictions on certain endpoints.
try {
await API.login(<username>, <password>);
} catch(Error) {
//Handle Exception
}
Modern Warfare
- Leaderboards :id=leaderboards
Example
try {
let data = await API.MWLeaderboard(<page>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- MP Match Details :id=mp-match-details
Example
try {
let data = await API.MWcombatmp(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- WZ Match Details :id=wz-match-details
Example
try {
let data = await API.MWcombatwz(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- MP Details :id=mp-details
Example
try {
let data = await API.MWmp(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- WZ Details :id=wz-details
Example
try {
let data = await API.MWwz(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Battle Royale Information :id=br-info
Example
try {
let data = await API.MWBattleData(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Weekly Stats :id=weekly-stats
Example
try {
let data = await API.MWweeklystats(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Loot :id=mw-loot
Example
try {
let data = await API.MWloot(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Analysis :id=mw-analysis
Example
try {
let data = await API.MWAnalysis(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Map List :id=map-list
Example
try {
let data = await API.MWMapList();
} catch(Error) {
//Handle Exception
}
Response
- Get Battle Pass :id=battle-pass-loot
Example
try {
let data = await API.getBattlePassLoot(<season>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Fuzzy Search :id=fuzzy-search
!> To search all platforms, pass in 'all'
Example
try {
let data = await API.FuzzySearch(<text>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Get Store Loot :id=store-loot
Example
try {
let data = await API.getPurchasable(<platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Get Cod Points :id=cod-points
!> Logged in user only
Example
try {
let data = await API.getCodPoints(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Logged In User Info :id=user-info
!> Logged in user only
Example
try {
let data = await API.getLoggedInUserInfo();
} catch(Error) {
//Handle Exception
}
Response
- Connected Accounts :id=connected-accounts
!> Logged in user only
Example
try {
let data = await API.ConnectedAccounts(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}
Response
- Event Feed :id=event-feed
!> Logged in user only
Example
try {
let data = await API.getEventFeed();
} catch(Error) {
//Handle Exception
}
Response
- Logged In Identities :id=identities
!> Logged in user only
Example
try {
let data = await API.getLoggedInIdentities();
} catch(Error) {
//Handle Exception
}
Response
- Account Settings :id=settings
!> Logged in user only
Example
try {
let data = await API.Settings(<gamertag>, <platform>?);
} catch(Error) {
//Handle Exception
}