Skip to content

API Reference

kekda.py edited this page Feb 1, 2022 · 8 revisions

The following section outlines the API of brawlpy.

Version Info

brawlpy.__version__

A string representation of the version.

Client

class brawlpy.Client(token : str)
Methods What they do
async get_player Get information about a single player by player tag.
async get_battle_log Get list of recent battle results for a player.
async get_club Get information about a single club by club tag.
async get_club_members Get a list of club members.
async brawlers Get list of available brawlers.
async get_brawler_byID Get information about a brawler by giving its ID.
async get_brawler_byName Get information about a brawler by giving its Name.
async events Get event rotation for ongoing events.
async get_players_rankings Get player rankings for a country or global rankings.
async get_brawlers_rankings Get brawler rankings for a country or global rankings.
async get_club_rankings Get club rankings for a country or global rankings.

Represents a client connection that connects to the Brawl Stars API.

Parameters:

 await get_player(tag : str) 

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

Raises:

  • TagNotFoundError - Raised if you entered a invalid tag.

Parameters:

  • tag (str) - The tag of the player, that you wanna get the information off

Returns:
  The Information about the player of the tag u entered

Return Type:
  Player

 await get_battle_log(tag : str) 

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.

Raises:

  • TagNotFoundError - Raised if you entered a invalid tag.

Parameters:

  • tag (str) - The tag of the player, that you wanna get the battle logs of

Returns   BattleLogs

Return Type   List[Dict]

 await get_club(tag : str) 

Get information about a single clan by club tag. Club tags can be found in game.

Raises:

  • TagNotFoundError - Raised if you entered a invalid tag.

Parameters:

  • tag (str) - The tag of the club, that you wanna get the information of

Returns   The Information about the club of the tag u entered

Return Type   Club

 await brawlers() 

Get list of all the available brawlers.

Returns:
  A list of all the brawlers available.

Return Type:
  List[Brawler]

 await get_brawler_byID(brawlerID : int) 

Get information about a brawler by their ID.

Raises:

  • BrawlerNotFound - Raised if you entered a invalid ID.

Parameters:

  • brawlerID (int) - The ID of the brawler that you wanna get the information of

Returns   The Information about the brawler of the ID u entered

Return Type   Brawler

 await get_brawler_byName(name : str) 

Get information about a brawler by their name.

Raises:

  • BrawlerNotFound - Raised if you entered a invalid Name.

Parameters:

  • name (str) - The name of the brawler that you wanna get the information of

Returns   The Information about the brawler of the name u entered

Return Type   Brawler

 await events() 

Get event rotation for ongoing events.

Returns:
  A list of all the events currently in rotation

Return Type:
  List[Dict]