@mattplays/overwatch-api

This package is a wrapper for the unofficial Overwatch API

Usage no npm install needed!

<script type="module">
  import mattplaysOverwatchApi from 'https://cdn.skypack.dev/@mattplays/overwatch-api';
</script>

README

OverwatchAPI

This package is a wrapper for the unofficial Overwatch API

  1. Overwatch
    1. Usage
    2. Functions
      1. GetProfile
        1. Inputs
        2. Output
        3. Usage
      2. GetCompleteStats
        1. Inputs
        2. Output
        3. Usage
      3. GetHeroStats
        1. Inputs
        2. Output
        3. Usage
    3. Return Types
      1. OverwatchProfile

Overwatch

This is an Unoffical API Unoffical 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
```javascript
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
```typescript
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
```javascript
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
```typescript
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
```javascript
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
```typescript
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
}[],
}
```