2017 © Pedro Peláez
 

library rls-api

Rocket League Stats PHP API

image

craigchilds/rls-api

Rocket League Stats PHP API

  • Thursday, April 27, 2017
  • by CraigChilds94
  • Repository
  • 2 Watchers
  • 6 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

rls-api (PHP Implementation)

Build Status Codacy Badge, (*1)

This is the un-official PHP client library for the RocketLeagueStats API., (*2)

Installation

composer require craigchilds/rls-api

Usage

Here are a few examples of how you can use the api to fetch different types of data., (*3)

Fetching a list of the playlists
use RocketLeagueStats\Stats as Api;

$api = new Api([
    'api_key' => 'your_api_key_here'
]);

$playlists = $api->playlists()->toCollection();
Fetching a player by platform & name
use RocketLeagueStats\Stats as Api;
use RocketLeagueStats\Data\Platform;

$api = new Api([
    'api_key' => 'your_api_key_here'
]);

$player = $api->player(Platform::PS4, 'PS4_UserNameHere');
Searching for a player on any platform
use RocketLeagueStats\Stats as Api;

$api = new Api([
    'api_key' => 'your_api_key_here'
]);

$results = $api->search('UserNameHere')->toCollection();
Environment Variables

If you want you can supply the api key through an environment variable. Lets say, if you had DotEnv installed on your project you could add the entry to your .env file., (*4)

RLS_API_KEY="rls_api_key_here"

And then you will not need to pass it in the constructor of the RocketLeagueStats\Stats class. Here is an example batch player request without passing the api key:, (*5)

use RocketLeagueStats\Stats as Api;
use RocketLeagueStats\Data\Collection;

$api = new Api();

$players = new Collection([
    ['player' => 'UserName1', 'platform' => Platform::PS4],
    ['player' => 'UserName1', 'platform' => Platform::Steam],
]);

$allPlayers = $api->batch($players);

The Versions

27/04 2017

dev-master

9999999-dev http://documentation.rocketleaguestats.com/

Rocket League Stats PHP API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CraigChilds94