npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

brawlstars-typescript-sdk

v1.0.0

Published

Client for Brawl Stars API

Downloads

1

Readme

Visit Brawlstars

Brawlstars

Brawl Stars API

npm

Table of Contents

Installation

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