# Getting Start

### brawlstars-php

brawlstars-php is 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\
<https://developer.brawlstars.com/>

### Requirements

To use this package, you need to obtain an API key at <https://developer.brawlstars.com/>

### Installation <a href="#installation" id="installation"></a>

#### Using Composer <a href="#using-composer" id="using-composer"></a>

```
composer require ahsan112/brawlstars-php
```

### Usage <a href="#usage" id="usage"></a>

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

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ahsan112.gitbook.io/brawlstars-php/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
