Giter VIP home page Giter VIP logo

Comments (9)

taycaldwell avatar taycaldwell commented on September 16, 2024

getRankedStats should return information for a summoner in their placements.

Can you provide a code snippet?

Here is an example of a summoner currently in their placements, and the data returned:

{
   "modifyDate": 1456041435000,
   "champions": [
      {
         "id": 103,
         "stats": {
            "totalDeathsPerSession": 38,
            "totalSessionsPlayed": 4,
            "totalDamageTaken": 84403,
            "totalQuadraKills": 0,
            "totalTripleKills": 0,
            "totalMinionKills": 516,
            "maxChampionsKilled": 9,
            "totalDoubleKills": 2,
            "totalPhysicalDamageDealt": 52060,
            "totalChampionKills": 22,
            "totalAssists": 22,
            "mostChampionKillsPerSession": 9,
            "totalDamageDealt": 390010,
            "totalFirstBlood": 0,
            "totalSessionsLost": 3,
            "totalSessionsWon": 1,
            "totalMagicDamageDealt": 236988,
            "totalGoldEarned": 38554,
            "totalPentaKills": 0,
            "totalTurretsKilled": 2,
            "mostSpellsCast": 0,
            "maxNumDeaths": 11,
            "totalUnrealKills": 0
         }
      },
      {
         "id": 0,
         "stats": {
            "totalDamageTaken": 84403,
            "totalTripleKills": 0,
            "totalMinionKills": 516,
            "maxChampionsKilled": 9,
            "maxLargestCriticalStrike": 0,
            "totalChampionKills": 22,
            "totalPhysicalDamageDealt": 52060,
            "rankedPremadeGamesPlayed": 0,
            "totalSessionsLost": 3,
            "totalNeutralMinionsKilled": 8,
            "totalSessionsWon": 1,
            "totalMagicDamageDealt": 236988,
            "maxLargestKillingSpree": 2,
            "totalPentaKills": 0,
            "maxTimeSpentLiving": 624,
            "totalDeathsPerSession": 38,
            "totalQuadraKills": 0,
            "totalSessionsPlayed": 4,
            "totalDoubleKills": 2,
            "totalAssists": 22,
            "maxTimePlayed": 2160,
            "mostChampionKillsPerSession": 9,
            "totalDamageDealt": 390010,
            "botGamesPlayed": 0,
            "killingSpree": 6,
            "totalFirstBlood": 0,
            "rankedSoloGamesPlayed": 0,
            "totalHeal": 9927,
            "totalGoldEarned": 38554,
            "mostSpellsCast": 0,
            "totalTurretsKilled": 2,
            "maxNumDeaths": 11,
            "totalUnrealKills": 0,
            "normalGamesPlayed": 0
         }
      }
   ],
   "summonerId": 32236660
}

from riot-api-java.

Linnun avatar Linnun commented on September 16, 2024

I'd like to add that specifically the leagues endpoint will always return an empty dataset until you are actually placed in a league (for obvious reasons).

rithms already provided a way to get ranked stats, which will also work if a summoner is still to be placed.

What exact data would you like to receive?

from riot-api-java.

JonZarate avatar JonZarate commented on September 16, 2024

Yes, I was getting a null league entry, I will try the function rithms suggested.
Thank you.

from riot-api-java.

JonZarate avatar JonZarate commented on September 16, 2024

I just realised. I can't see how many W/L the summoner has in RankedStats. Is it supposed to be there ? I can't find it.

from riot-api-java.

Linnun avatar Linnun commented on September 16, 2024

I have added an example script that should retrieve your desired data:

https://github.com/rithms/riot-api-java/blob/master/examples/RankedWinsAndLosses.java

Please let me know, if you need help with anything else.

from riot-api-java.

taycaldwell avatar taycaldwell commented on September 16, 2024

Wins and losses can be retreived from the totalSessionsWon and totalSessionsLost fields.

As you can see from my example above, RankedStats divides stats by champions. The 'id' field is the champion ID of the champion for those stats. A champion ID of 0 means overall stats.

So you can get W/L for each individual champion, and overall W/L.

from riot-api-java.

taycaldwell avatar taycaldwell commented on September 16, 2024

That example might not work for him, as it has version 4 features like the ApiConfig. I believe he's using the v3.9.0 jar form the releases page.

Here's the example using 3.9.0 syntax:
https://gist.github.com/rithms/19e2a8235dbdd0caee3c

from riot-api-java.

Linnun avatar Linnun commented on September 16, 2024

It should work with 3.9.0, if you replace

ApiConfig config = new ApiConfig().setKey("YOUR-API-KEY-HERE");
RiotApi api = new RiotApi(config);

with

RiotApi api = new RiotApi("YOUR-API-KEY-HERE");

(and adjust the imports)

from riot-api-java.

JonZarate avatar JonZarate commented on September 16, 2024

Yes I am using the one from the release page but I had no problems to initialize the API. The code is working too, thank you. I didn't figure out the first id was for overall data.

from riot-api-java.

Related Issues (20)

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.