PHPackages                             ahsan112/brawlstars-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ahsan112/brawlstars-php

ActiveLibrary[API Development](/categories/api)

ahsan112/brawlstars-php
=======================

BrawlStars api wrapper in PHP

118PHP

Since Nov 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ahsan112/brawl-stars-php)[ Packagist](https://packagist.org/packages/ahsan112/brawlstars-php)[ RSS](/packages/ahsan112-brawlstars-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

BrawlStars API
==============

[](#brawlstars-api)

A PHP library to conveniently access and query the BrawlStars API. It includes a pre-defined set of classes that initialise themselves dynamically from API responses.

This package uses the official BrawlStars API. For more information, please visit

To read the brawlstars-php documentation please vist

Requirements
------------

[](#requirements)

To use this package, you need to obtain an API key at

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

```
composer require ahsan112/brawlstars-php

```

Usage
-----

[](#usage)

When instantiating the BrawlStarsClient, you have to provide your API key:

```
$client = new BrawlStarsClient('key');
```

Players
-------

[](#players)

Refers to `/players` endpoint from the official docs.

### Retrieve a player

[](#retrieve-a-player)

```
$player = $client->getPlayer('tag');
```

A Player object is returned

```
$player->soloVictories()
$player->highestTrophies()
$player->brawlers();
$player->brawlers()->brawler('leon');
$player->brawlers()->brawler('leon')->power();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

### Retrieve a player's battle log

[](#retrieve-a-players-battle-log)

```
$battleLog = client->getPlayerBattleLog('tag');

$battleLog->all() // retrives all battles as BattleLogList Object
$battleLog->latest() // retrives the most recent battle by the player
$battleLog->latest()->result();
$battleLog->latest()->teams();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

Clubs
-----

[](#clubs)

Refers to `/clubs/{clubTag}` endpoint from the official docs.

```
$club = $client->getClub('club tag'); // returns Club object

$club->name();
$club->description();
$club->members(); // ClubMembersList Object
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

### Getting club president, vice-presidents, seniors

[](#getting-club-president-vice-presidents-seniors)

```
$president = $club->president();
$president->name();
$president->trophies();

$vicePresidents = $club->vicePresidents();
$seniors = $club->seniors();
```

Rankings
--------

[](#rankings)

### Season ranking

[](#season-ranking)

Refers to `/rankings{countryCode}/seasons/{seasonId}` endpoint from the official docs.

```
$seasonRanking = $client->getSeasonRanking(); // default is ('global', 'latest')
$seasonRanking = $client->getSeasonRanking('gb', '56');

$seasonRanking->topTen();
$seasonRanking->first()->name();
$seasonRanking->first()->trophies();
```

### Clubs Ranking

[](#clubs-ranking)

Refers to `/rankings{countryCode}/clubs` endpoint from the official docs.

```
$clubRanking = $client->getClubsRanking(); // default is ('global')
$clubRanking = $client->getClubsRanking('gb');

$clubRanking->topTen();
$clubRanking->first()->name();
$clubRanking->first()->trophies();
$clubRanking->first()->memberCount();
```

### Brawler Ranking

[](#brawler-ranking)

Refers to `/rankings{countryCode}/brawlers/{brawlerId}` endpoint from the official docs.

```
$brawlerRanking = $client->getBrawlerRanking('brawler id');

$brawlerRanking->topTen();
$brawlerRanking->first()->name();
$brawlerRanking->first()->trophies();
$brawlerRanking->first()->club();
```

### Player Ranking

[](#player-ranking)

Refers to `/rankings/{countryCode}/players` endpoint from the official docs.

```
$playerRanking = $client->getPlayerRanking('tag');

$playerRanking->topTen();
$playerRanking->first()->name();
$playerRanking->first()->trophies();
$playerRanking->first()->club();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

Events
------

[](#events)

Refers to `/events/rotation` endpoint from the official docs.

```
$events = $client->getEvents();

$events->all();
$events->first()->startTime();
$events->first()->endTime();
$events->first()->map();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c132fb7cd331b48a79c71478fe0d7aea23a199cf7e1bbab5bb403ea9ae2fbead?d=identicon)[ahsan112](/maintainers/ahsan112)

---

Top Contributors

[![Ahsan112](https://avatars.githubusercontent.com/u/129741754?v=4)](https://github.com/Ahsan112 "Ahsan112 (1 commits)")

---

Tags

apibrawlstarsbrawlstarsapiphpwrapper

### Embed Badge

![Health badge](/badges/ahsan112-brawlstars-php/health.svg)

```
[![Health](https://phpackages.com/badges/ahsan112-brawlstars-php/health.svg)](https://phpackages.com/packages/ahsan112-brawlstars-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
