{"id":19028602,"url":"https://github.com/petersil1998/thresh-java","last_synced_at":"2026-05-02T02:30:22.063Z","repository":{"id":171273978,"uuid":"647660868","full_name":"Petersil1998/Thresh-Java","owner":"Petersil1998","description":"Object-Oriented Java Wrapper for Riot's League of Legends API ","archived":false,"fork":false,"pushed_at":"2023-10-01T14:11:58.000Z","size":578,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T03:25:19.030Z","etag":null,"topics":["api","cdragon","ddragon","gradle","java-20","league-of-legends-api","library","wrapper-library"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Petersil1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-31T08:57:05.000Z","updated_at":"2023-11-28T10:42:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3da7820-c717-42b3-8440-9e409e0e4101","html_url":"https://github.com/Petersil1998/Thresh-Java","commit_stats":null,"previous_names":["petersil1998/thresh-java"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Petersil1998%2FThresh-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Petersil1998%2FThresh-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Petersil1998%2FThresh-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Petersil1998%2FThresh-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Petersil1998","download_url":"https://codeload.github.com/Petersil1998/Thresh-Java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240079621,"owners_count":19744721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cdragon","ddragon","gradle","java-20","league-of-legends-api","library","wrapper-library"],"created_at":"2024-11-08T21:11:41.350Z","updated_at":"2026-05-02T02:30:22.003Z","avatar_url":"https://github.com/Petersil1998.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thresh\n\nThresh is an Object-Oriented Java Library, which takes over the Communication with the League of Legends API. It supports In-Memory caching and uses a (blocking) Rate Limiter. It makes retrieving Summoner Data, Match History,\netc. much easier.\n\nOther Projects:\n- [Spatula](https://github.com/Petersil1998/Spatula) for Teamfight Tactics\n- [Scuttlegeist](https://github.com/Petersil1998/Scuttlegeist) for Legends of Runeterra\n- [Fade](https://github.com/Petersil1998/Fade) for Valorant\n\n## Usage\n\nThresh can be included like this using **Gradle**:\n\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ndependencies {\n    ...\n    implementation 'com.github.Petersil1998:Core:v1.4'\n    implementation 'com.github.Petersil1998:STCommons:v1.4'\n    implementation 'com.github.Petersil1998:Thresh-Java:v1.4'\n}\n```\n\nor using **Maven**:\n\n```XML\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Petersil1998\u003c/groupId\u003e\n    \u003cartifactId\u003eCore\u003c/artifactId\u003e\n    \u003cversion\u003ev1.4\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Petersil1998\u003c/groupId\u003e\n    \u003cartifactId\u003eSTCommons\u003c/artifactId\u003e\n    \u003cversion\u003ev1.4\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Petersil1998\u003c/groupId\u003e\n    \u003cartifactId\u003eThresh-Java\u003c/artifactId\u003e\n    \u003cversion\u003ev1.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Setup\n\nIn Order for Thresh to work properly there are a few things you need to set up\nat the beginning of your application.\n\n```JAVA\npublic class Example {\n    public static void main(String[] args) {\n        // First we need to provide our Riot API Key. Ideally the API Key is encrypted\n        Settings.setAPIKey(() -\u003e EncryptionUtil.encrypt(System.getenv(\"API_KEY\")));\n        // If the provided API Key is encrypted, we need to provide a function to decrypt the API Key\n        Settings.setDecryptor(EncryptionUtil::decrypt);\n        // We also need to provide a language. The language is used to static Data like Champions, Item, etc.\n        Settings.setLanguage(Language.EN_US);\n        // If we want to use caching we can enable it in the Settings. Caching is disabled by default\n        Settings.useCache(true);\n        // We also need to add the Loader for the static LoL Data\n        Loader.addLoader(new LoLLoader());\n        // Lastly we need to initialize the static Data\n        Loader.init();\n    }\n}\n```\n\nNow Thresh is ready and set up!\n\n## Examples\n\n- **Summoner and Account Data**\n\n    ```JAVA\n    public class Example {\n        public static void main(String[] args) {\n            // Setup code...\n            \n            Summoner faker = Summoner.getSummonerByName(\"Faker\", LeaguePlatform.KR);\n            int summonerLevel = faker.getSummonerLevel();\n            // Get the URL for the profile Icon\n            String profileIconURL = Util.getProfileIconURL(faker.getProfileIcon());\n            // Get Account\n            Account account = Account.getAccountByPuuid(faker.getPuuid(), LeagueRegion.ASIA);\n            // Get the Tag (e.g. Faker#KR1)\n            String tag = account.toString();\n        }\n    } \n    ```\n\n- **Champion Mastery**\n\n    ```JAVA\n    public class Example { \n        public static void main(String[] args) {\n            // Setup code...\n           \n            Summoner faker = Summoner.getSummonerByName(\"Faker\", LeaguePlatform.KR);\n            ChampionMasteries masteries = ChampionMasteries.getChampionMasteriesOfSummoner(faker.getId(), LeaguePlatform.KR);\n            // Get Mastery Score\n            int masteryScore = masteries.getTotalMasteryPoints();\n            // Get Mastery Points on all Champions Combined\n            int totalMasteryPoints = masteries.getTotalMasteryPointsCombined();\n            // Get a List of all Champion Masteries\n            List\u003cChampionMasteries.Mastery\u003e championMasteries = masteries.getChampionMasteries();\n            for(ChampionMasteries.Mastery mastery: championMasteries) {\n                // Get the Champion\n                Champion champion = mastery.getChampion();\n                // Get the Mastery Level on that Champion\n                int masteryLevel = mastery.getChampionLevel();\n                // Get the Mastery Points on that Champion\n                int masteryPoints = mastery.getChampionPoints();\n            }\n        }\n    } \n    ```\n\n- **Rank and Leagues**\n\n    ```JAVA\n    public class Example {\n        public static void main(String[] args) {\n            // Setup code...\n            \n            Summoner faker = Summoner.getSummonerByName(\"Faker\", LeaguePlatform.KR);\n            // Get Solo/Duo and Flex Rank\n            PlayerRanks ranked = LoLRanked.getLoLRanksOfSummoner(faker.getId(), LeaguePlatform.KR);\n            RankEntry soloDuo = ranked.getRankSoloDuo();\n            int lp = soloDuo.getLeaguePoints();\n            RankEntry flex = ranked.getRankFlex5v5();\n  \n            // Get Challenger Solo Queue Players\n            League challengers = LoLRanked.getChallengerLeague(RankedQueue.SOLO_DUO, LeaguePlatform.EUW);\n            for(LeagueEntry leagueEntry: challengers.getEntries()) {\n                // Get all players and their LP\n                Summoner player = Summoner.getSummonerByID(leagueEntry.getSummonerId(), LeaguePlatform.EUW);\n                int playerLp = leagueEntry.getLeaguePoints();\n            }\n  \n            // Get a list of Gold 1 Flex Players\n            List\u003cRankEntry\u003e firstPage = LoLRanked.getRankEntries(RankedDivision.I, RankedTier.GOLD, RankedQueue.FLEX, LeaguePlatform.NA);\n            List\u003cRankEntry\u003e secondPage = LoLRanked.getRankEntries(RankedDivision.I, RankedTier.GOLD, RankedQueue.FLEX, LeaguePlatform.NA, 2);\n        }\n    } \n    ```\n\n- **Active Games**\n\n    ```JAVA\n    public class Example {\n        public static void main(String[] args) {\n            // Setup code...\n            \n            Summoner faker = Summoner.getSummonerByName(\"Faker\", LeaguePlatform.NA);\n            // Get Active Game of a given Summoner\n            ActiveGame game = ActiveGame.ofSummoner(faker.getId(), LeaguePlatform.NA);\n            Map map = game.getMap();\n            String gameMode = game.getGameMode();\n            int duration = game.getDuration();\n            // Get all Players of the blue Side Team\n            List\u003cParticipant\u003e blueTeam = game.getBlueSideTeam();\n            // Get a String, that can be entered in the Windows Commandline to spectate the Game\n            String cmd = game.getSpectatorCommandWindows(\"C:\\\\\");\n        } \n    } \n    ```\n\n- **Match History**\n\n    ```JAVA\n    public class Example {\n        public static void main(String[] args) {\n            // Setup code...\n            \n            Summoner faker = Summoner.getSummonerByName(\"Faker\", LeaguePlatform.NA);\n            // Get the Player's Match History. The Seconds Parameter is a Filter.\n            List\u003cMatchDetails\u003e matchHistory = MatchDetails.getMatchHistory(faker.getId(), LeagueRegion.ASIA, Map.of());\n            MatchDetails latestGame = matchHistory.get(0);\n            int duration = latestGame.getGameDuration();\n            // Get Team-based Info like bans, barons killed, turrets killed, etc.\n            List\u003cTeam\u003e teams = latestGame.getTeams();\n            // Get all the Players. Match Participants have A LOT of data like Items bought, Champion played,\n            // Summoner Spells used, Damage Dealt, Pings used, etc.\n            List\u003cMatchParticipant\u003e participants = latestGame.getParticipants();\n        } \n    } \n    ```\n  The Match History Filter can have the following values:\n\n  | Key       | Description                                                                                                                                                                                                      | Type   |\n  |-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|\n  | startTime | Unix Timestamp in seconds. Only start Times after June 16th 2021 will have an effect. [More](https://developer.riotgames.com/apis#match-v5/GET_getMatchIdsByPUUID)                                               | long   | \n  | endTime   | Unix Timestamp in seconds.                                                                                                                                                                                       | long   |\n  | queue     | Queue ID. Works mutually inclusive with **type**. [QueueTypes](https://github.com/Petersil1998/Thresh-Java/blob/master/src/main/java/net/petersil98/thresh/collection/QueueTypes.java) contains all valid queues | int    |\n  | type      | Type of a Match. Works mutually inclusive with **queue**                                                                                                                                                         | String |\n  | start     | The offset of the first Match entry                                                                                                                                                                              | int    |\n  | count     | The Amount of Matches entries to return. Has to be between 0 and 100                                                                                                                                             | int    |\n\n  **Note**: *All values need to be passed as **Strings** in the filter*\n\n\n- **Collections**\n\n    The package [collection](https://github.com/Petersil1998/Thresh-Java/blob/main/src/main/java/net/petersil98/thresh/collection/) contains a bunch of Collections for static Data including:\n  \n    - Challenges\n    - Champions\n    - Items\n    - Maps\n    - QueueTypes\n    - Runes\n    - RuneStats (The 3 stats you can choose in a Rune Page like adaptive Force, Armor, MR, etc.)\n    - RuneStyles (Precision, Domination, Sorcery, Resolve, Inspiration)\n    - Summoner Spells\n\n### Feel free to give Feedback and add suggestions on how this library can be improved. \u003cbr\u003eThank you for using Thresh, you're awesome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetersil1998%2Fthresh-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetersil1998%2Fthresh-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetersil1998%2Fthresh-java/lists"}