Code Monkey home page Code Monkey logo

php-riot-api's Introduction

php-riot-api

PHP Wrapper for Riot Games API allows you to quickly make calls to the RIOT API with a proper API Key. Key features include caching (if enabled) and rate limiting. Simply replace API_KEY_HERE with your API key from Riot Games.

Testing.php is a simple testing class that shows how to call all the functions.

Getting Started

  • Replace INSERT_API_KEY_HERE
  • Create folder called 'cache' wherever the script is (make sure it's writeable by php-riot-api)
  • Create an instance of riotapi - $instance = new riotapi($platform);
  • $platform can be na1, euw1, eun1, br1, ru, kr, oc1, la1, la2, jp1, pbe1, tr1 (br/tr only can call getLeague() and getTeam() functions)
  • Make Calls to the functions listed below and receive JSON data
  • Caching is done locally, instantiate php-riot-api with "new riotapi('na1', new FileSystemCache('cache/'));" to create a cache in the subfolder 'cache'
  • DECODE_ENABLED is true by default. If you want your returns to be pure JSON and not an associative array, set it to false
  • Take a look at testing.php for example code, including error handling, caching

Functions

//Returns all champion information.
getChampion();

//Change platform
setRegion($region);

// Returns all free champions.
getChampion(true);
getFreeChampions();

//performs a static call. Not counted in rate limit.
getStatic($call, $id = null, $params = null);

//Returns match details including timeline (if exists) given a match id.
//Use with care, rate limiting is not ready for this function
getMatch($matchId);
//Returns match details given a match id, without timeline.
getMatch($matchId, false);

//Returns timeline of a match
getTimeline($matchId)

//Returns a user's matchList given their account id.
public function getMatchList($accountId,$params=null)

//Returns the league of a given summoner.
getLeague($summoner_id);
getLeaguePosition($summoner_id);

//Returns the challenger ladder.
getChallenger($queue = "RANKED_SOLO_5x5");
//Returns the master ladder.
getMaster($queue = "RANKED_SOLO_5x5");

//returns a summoner's id
getSummonerId($summoner_name);
//returns an account's id
getSummonerAccountId($summoner_name);

//Returns summoner info given summoner id.
getSummoner($summoner_id);
//Returns summoner masteries given summoner id.
getMasteries($summoner_id);
//Returns summoner runes given summoner id.
getRunes($summoner_id);

//Returns summoner info given account id.
getSummoner($accountId);

//Gets a summoner's info given their name, instead of id.
getSummonerByName($summoner_name);

//Return details of an array of matches
//Use with care, rate limiting is not ready for this function
getMatches($ids, $includeTimeline = true)

Not Complete

Region Checking - Some functions are only available in certain regions and not in others.

php-riot-api's People

Contributors

kevinohashi avatar ahubers avatar sylven avatar supericy avatar canisback avatar gaetanm avatar coltcarder avatar xorinzor avatar derpthemeus avatar playmono avatar primus852 avatar

Watchers

James Cloos avatar MJay Kurdi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.