Skip to content

Starcraft 2

Ben Weier edited this page Jun 6, 2023 · 4 revisions

In addition to all parameters documented here, all API methods can accept key, secret, token, origin, locale, for cases where you need to use different values to the default instance.

All methods accept a second headers argument allowing an object of { [key: string]: string } to be added to the request headers. For example, some requests can potentially return large response bodies and you might want to avoid this if the resource has not been updated between the previously observed state with a If-Modified-Since header. If a method does not accept an argument, or it's first argument is optional, pass null | undefined followed by a headers object, e.g. token(null, { 'X-Header-Key': 'X-Header-Value' })

Method parameters are encoded with encodeURIComponent for URL safety.

Methods with optional parameters will fallback to API endpoints that best match the provided parameters.


profile

sc2.profile({ region: 1 | 2 | 3; realm?: 1 | 2; profile?: number })

metadata

sc2.metadata({ region: 1 | 2 | 3; realm: 1 | 2; profile: number })

profileLadder

sc2.profileLadder({ region: 1 | 2 | 3; realm: 1 | 2; profile: number; id?: number })

ladder

sc2.ladder({ region: 1 | 2 | 3; resource: 'grandmaster' | 'season' })

account

sc2.account({ id: number })

legacyProfile

sc2.legacyProfile({ region: 1 | 2 | 3; realm: 1 | 2; profile: number; resource?: 'ladders' | 'matches' })

legacyLadder

sc2.legacyLadder({ region: 1 | 2 | 3; ladder: number })

legacyAchievements

sc2.legacyAchievements({ region: 1 | 2 | 3 })

legacyRewards

sc2.legacyRewards({ region: 1 | 2 | 3 })

league

sc2.league({ season: number; queue: number; teamType: 0 | 1; league: 0 | 1 | 2 | 3 | 4 | 5 | 6 })
Clone this wiki locally