1

I just started with the Riot API, and I am stuck in getting summoners by their ranking. I used the getChampion() function but it retrieves data different from other sites which are already running.

I use it like this:

<?php
include('php-riot-api.php');
include('FileSystemCache.php');

//testing classes
//using double quotes seems to make all names work (see issue:     https://github.com/kevinohashi/php-riot-api/issues/33)
$summoner_name = "RiotSchmick"; 
$summoner_id = 585897;

$test = new riotapi('na');


$testCache = new riotapi('na', new FileSystemCache('cache/'));
$r = $test->getChampion(); echo "<pre>"; print_r($r);echo "</pre>";

this fetch array like this 
[champions] => Array
        (
            [0] => Array
                (
                    [id] => 266
                    [active] => 1
                    [botEnabled] => 
                    [freeToPlay] => 1
                    [botMmEnabled] => 
                    [rankedPlayEnabled] => 1
                )

            [1] => Array
                (
                    [id] => 103
                    [active] => 1
                    [botEnabled] => 
                    [freeToPlay] => 
                    [botMmEnabled] => 
                    [rankedPlayEnabled] => 1
                ) ..................

After I used $r->getSummoner(266); // 103 and all id I get from above array. But the summoners names I get are different from other running sites like http://na.op.gg/ranking/ladder/ and http://quickfind.kassad.in/rankings/na (both these sites have the same data but mine is different).

Mat
  • 202,337
  • 40
  • 393
  • 406
Tariq
  • 218
  • 2
  • 13
  • Please [edit] your question to show how you're using the API and how the results differ from what you're expecting. – Mat May 16 '15 at 06:16
  • @Mat! i have add code with question please review it once again .. thank u – Tariq May 16 '15 at 06:36

1 Answers1

2

I believe you want to use the https://euw.api.pvp.net/api/lol/euw/v2.5/league/master?type=RANKED_SOLO_5x5&api_key= and https://euw.api.pvp.net/api/lol/euw/v2.5/league/challenger?type=RANKED_SOLO_5x5&api_key= APIs rather than use summonerID data.

Reenen
  • 128
  • 9