brawlstars-typescript-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Visit Brawlstars

Brawlstars

Brawl Stars API

npm

Table of Contents

Installation

npm pnpm yarn
npm i brawlstars-typescript-sdk
pnpm i brawlstars-typescript-sdk
yarn add brawlstars-typescript-sdk

Getting Started

import { Brawlstars } from "brawlstars-typescript-sdk";

const brawlstars = new Brawlstars({
  // Defining the base path is optional and defaults to https://api.brawlstars.com/v1
  // basePath: "https://api.brawlstars.com/v1",
  apiKey: "API_KEY",
});

const getResponse = await brawlstars.brawlers.get({
  brawlerId: "brawlerId_example",
});

console.log(getResponse);

Reference

brawlstars.brawlers.get

Get information about a brawler.

🛠️ Usage

const getResponse = await brawlstars.brawlers.get({
  brawlerId: "brawlerId_example",
});

⚙️ Parameters

brawlerId: string

Identifier of the brawler.

🔄 Return

Brawler

🌐 Endpoint

/brawlers/{brawlerId} GET

🔙 Back to Table of Contents


brawlstars.brawlers.list

Get list of available brawlers.

🛠️ Usage

const listResponse = await brawlstars.brawlers.list({});

⚙️ Parameters

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

Brawler

🌐 Endpoint

/brawlers GET

🔙 Back to Table of Contents


brawlstars.clubs.getInformation

Get information about a single clan by club tag. Club tags can be found in game. Note that clan tags start with hash character '#' and that needs to be URL-encoded properly to work in URL, so for example clan tag '#2ABC' would become '%232ABC' in the URL.

🛠️ Usage

const getInformationResponse = await brawlstars.clubs.getInformation({
  clubTag: "clubTag_example",
});

⚙️ Parameters

clubTag: string

Tag of the club.

🔄 Return

Club

🌐 Endpoint

/clubs/{clubTag} GET

🔙 Back to Table of Contents


brawlstars.clubs.listMembers

List club members.

🛠️ Usage

const listMembersResponse = await brawlstars.clubs.listMembers({
  clubTag: "clubTag_example",
});

⚙️ Parameters

clubTag: string

Tag of the club.

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

ClubMember

🌐 Endpoint

/clubs/{clubTag}/members GET

🔙 Back to Table of Contents


brawlstars.events.getRotation

Get event rotation for ongoing events.

🛠️ Usage

const getRotationResponse = await brawlstars.events.getRotation();

🔄 Return

ScheduledEvent

🌐 Endpoint

/events/rotation GET

🔙 Back to Table of Contents


brawlstars.players.getBattleLog

Get list of recent battle results for a player. NOTE: It may take up to 30 minutes for a new battle to appear in the battlelog.

🛠️ Usage

const getBattleLogResponse = await brawlstars.players.getBattleLog({
  playerTag: "playerTag_example",
});

⚙️ Parameters

playerTag: string

Tag of the player.

🔄 Return

Battle

🌐 Endpoint

/players/{playerTag}/battlelog GET

🔙 Back to Table of Contents


brawlstars.players.getInformation

Get information about a single player by player tag. Player tags can be found either in game or by from clan member list.

🛠️ Usage

const getInformationResponse = await brawlstars.players.getInformation({
  playerTag: "playerTag_example",
});

⚙️ Parameters

playerTag: string

Tag of the player.

🔄 Return

Player

🌐 Endpoint

/players/{playerTag} GET

🔙 Back to Table of Contents


brawlstars.rankings.getBrawlerRankings

Get brawler rankings for a country or global rankings. Brawler identifiers can be found by using the /v1/brawlers API endpoint.

🛠️ Usage

const getBrawlerRankingsResponse = await brawlstars.rankings.getBrawlerRankings(
  {
    countryCode: "countryCode_example",
    brawlerId: "brawlerId_example",
  }
);

⚙️ Parameters

countryCode: string

Two letter country code, or 'global' for global rankings.

brawlerId: string

Identifier of the brawler.

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

PlayerRanking

🌐 Endpoint

/rankings/{countryCode}/brawlers/{brawlerId} GET

🔙 Back to Table of Contents


brawlstars.rankings.getClubRankings

Get club rankings for a country or global rankings.

🛠️ Usage

const getClubRankingsResponse = await brawlstars.rankings.getClubRankings({
  countryCode: "countryCode_example",
});

⚙️ Parameters

countryCode: string

Two letter country code, or 'global' for global rankings.

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

ClubRanking

🌐 Endpoint

/rankings/{countryCode}/clubs GET

🔙 Back to Table of Contents


brawlstars.rankings.getPlayerRankings

Get player rankings for a country or global rankings.

🛠️ Usage

const getPlayerRankingsResponse = await brawlstars.rankings.getPlayerRankings({
  countryCode: "countryCode_example",
});

⚙️ Parameters

countryCode: string

Two letter country code, or 'global' for global rankings.

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

PlayerRanking

🌐 Endpoint

/rankings/{countryCode}/players GET

🔙 Back to Table of Contents


brawlstars.rankings.getPowerPlaySeasonRankings

Get power play rankings for a country or global rankings. Season identifiers can be found by using the /rankings/{countryCode}/powerplay/seasons API endpoint. Also, 'latest' can be used as seasonId to get rankings for the latest season.

🛠️ Usage

const getPowerPlaySeasonRankingsResponse =
  await brawlstars.rankings.getPowerPlaySeasonRankings({
    countryCode: "countryCode_example",
    seasonId: "seasonId_example",
  });

⚙️ Parameters

countryCode: string

Two letter country code, or 'global' for global rankings.

seasonId: string

Identifier of the season.

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

PlayerRanking

🌐 Endpoint

/rankings/{countryCode}/powerplay/seasons/{seasonId} GET

🔙 Back to Table of Contents


brawlstars.rankings.getPowerPlaySeasons

Get list of power play seasons for a country or global rankings.

🛠️ Usage

const getPowerPlaySeasonsResponse =
  await brawlstars.rankings.getPowerPlaySeasons({
    countryCode: "countryCode_example",
  });

⚙️ Parameters

countryCode: string

Two letter country code, or 'global' for global rankings.

before: string

Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

after: string

Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both.

limit: number

Limit the number of items returned in the response.

🔄 Return

PowerPlaySeason

🌐 Endpoint

/rankings/{countryCode}/powerplay/seasons GET

🔙 Back to Table of Contents


Author

This TypeScript package is automatically generated by Konfig

Package Sidebar

Install

npm i brawlstars-typescript-sdk

Weekly Downloads

0

Version

1.0.0

License

Unlicense

Unpacked Size

268 kB

Total Files

137

Last publish

Collaborators

  • konfig-publisher