Download the PHP package ptrtn/battlerite without Composer
On this page you can find all versions of the php package ptrtn/battlerite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ptrtn/battlerite
More information about ptrtn/battlerite
Files in ptrtn/battlerite
Package battlerite
Short Description A php-based client wrapping the battlerite API
License MIT
Informations about the package battlerite
Battlerite-sdk
PHP-based SDK for Battlerite API
Features
- Retrieve data for matches (by query)
- Retrieve detailed data for a specific match
- Retrieve data for players (by query)
- Retrieve detailed data for a specific player
- Retrieve team data for specific players and seasons
- Retrieve api status
Requirements
- Php 7.1 or higher
Installing
composer require ptrtn/battlerite-sdk
Usage
Retrieving data can be as simple as one method call. If no search query is specified, API defaults are used instead.
Api status
The following example returns API status, patch version and other data
Retrieving match data
Retrieving match data using API defaults
Retrieving team data
Retrieving detailed match data
Retrieving detailed player data
Custom querying
A custom search query can be used to retrieve the exact data needed.
Matches
For matches the following query options are available:
- Offset
- Limit
- Start date
- End date
- Player ids
- Team names
- Game modes
- Ascending sorting
- Descending sorting
Players
For players the following query options are available:
- Player name
- Steam id
- Player id
Note: up to 6 players (1 per region) can be found for a specific player name.
Teams
For teams the following query options are available:
- Season
- Player id
Caching
When sending a lot of requests, the default rate limit of 10 requests per minute will pose an issue. In order to prevent this, caching can be enabled for the player details and match details endpoints.
Optionally an alternative cache lifetime or caching system implementing the Doctrine\Common\Cache\Cache
interface can be configured.
How do I get an API key?
- In order to get an API key you should create a developer account and an app
- Once created, log in and browse to https://developer.battlerite.com/apps/your-app
- Scroll down to DEVELOPMENT API KEY THIS APP USES, it should look like:
Api documentation
Documentation for the Battlerite API can be found at http://battlerite-docs.readthedocs.io/en/latest/