0.0.2 • Published 3 years ago
@mattplays/overwatch-api v0.0.2
OverwatchAPI
This package is a wrapper for the unofficial Overwatch API
Overwatch
This is an Unoffical API [Unoffical Docs](https://ow-api.com/docs/)
Usage
const {OverwatchAPI} = require("@mattplays/overwatch-api")
const API = new OverwatchAPI();
Functions
GetProfile
This endpoint retrieves stats commonly used by bots and other services.
Inputs
type OverwatchPlatform = "pc" | "xbox" | "ps4" | "nintendo-switch";
type OverwatchRegion = "us" | "eu" | "asia";
Parameter | Type | Required | Description |
---|---|---|---|
platform | OverwatchPlatform | Yes | The platform of the user |
region | OverwatchRegion | Yes | The region of the user |
battletag | string | Yes | The battletag of the user ie. My_Name_Is_Jeff_From_The_OW_Team#11561 |
Output
The GetProfile function returns a Promise<OverwatchProfile>
Usage
const API = new OverwatchAPI();
API.GetProfile("pc", "us", "My_Name_Is_Jeff_From_The_OW_Team#11561").then((data) => {
// Your Code Here :D
})
GetCompleteStats
Inputs
type OverwatchPlatform = "pc" | "xbox" | "ps4" | "nintendo-switch";
type OverwatchRegion = "us" | "eu" | "asia";
Parameter | Type | Required | Description |
---|---|---|---|
platform | OverwatchPlatform | Yes | The platform of the user |
region | OverwatchRegion | Yes | The region of the user |
battletag | string | Yes | The battletag of the user ie. My_Name_Is_Jeff_From_The_OW_Team#11561 |
Output
The GetCompleteStats function returns something im too lazy to add type def for so Promise<any>
is what you get.
Usage
const API = new OverwatchAPI();
API.GetCompleteStats("pc", "us", "My_Name_Is_Jeff_From_The_OW_Team#11561").then((data) => {
// Your Code Here :D
})
GetHeroStats
Inputs
type OverwatchPlatform = "pc" | "xbox" | "ps4" | "nintendo-switch";
type OverwatchRegion = "us" | "eu" | "asia";
type OverwatchHeros = ['ana' , 'ashe' , 'baptiste' , 'bastion' , 'brigitte' , 'doomfist' , 'dva' , 'echo' , 'genji' , 'hammond' , 'hanzo' , 'junkrat' , 'lucio' , 'mccree' , 'mei' , 'mercy' , 'moira' , 'orisa' , 'pharah' , 'reaper' , 'reinhardt' , 'roadhog' , 'sigma' , 'soldier' , 'sombra' , 'symmetra' , 'torbjorn' , 'tracer' , 'widowmaker' , 'winston' , 'zarya' , 'zenyatta'];
Parameter | Type | Required | Description |
---|---|---|---|
platform | OverwatchPlatform | Yes | The platform of the user |
region | OverwatchRegion | Yes | The region of the user |
battletag | string | Yes | The battletag of the user ie. My_Name_Is_Jeff_From_The_OW_Team#11561 |
heros | OverwatchHeros | Yes | An Array of heros you want stats for. |
Output
The GetHeroStats function returns something i was also too lazy to type def so Promise<any>
is your best friend.
Usage
const API = new OverwatchAPI();
API.GetHeroStats("pc", "us", "My_Name_Is_Jeff_From_The_OW_Team#11561", ["genji", "hanzo"]).then((data) => {
// Your Code Here :D
})
Return Types
OverwatchProfile
export interface OverwatchProfile {
competitiveStats: {
awards: {
cards: number,
medals: number,
medalsBronze: number,
medalsSilver: number,
medalsGold: number
},
games: {
played: number,
won: number
},
},
endorsment: number,
endorsementIcon: string,
gamesWon: number,
icon: string,
level: number,
levelIcon: string,
name: string,
prestige: number,
prestigeIcon: string,
private: boolean,
quickPlayStats: {
awards: {
cards: number,
medals: number,
medalsBronze: number,
medalsSilver: number,
medalsGold: number,
},
games: {played: number, won: number},
},
rating: number,
ratingIcon: string,
ratings: {
level: number,
role: string,
roleIcon: string
}[],
}