Reviewed-on: #10
riot-clojure
Riot Games provides a lot of nice endpoints with a lot of data for all their games. This projects provides a library to access those data from Clojure and a small application to quick get some relevant data.
The library and the CLI application are separated, you can use the library independently.
The API and the tokens
Accessing the API requires one or more API tokens. Each videogame has their own group of endpoints, secured with an API. Development APIs can access to all andpoints, but they must be refreshed every 24 hours.
You can obtain a token for free in the official developer web.
The library and the application will take the API token from environment. CLI application has optional parameters that override the environment variables.
| Game | Environment variable | CLI parameter |
|---|---|---|
| all | RIOT_DEV_KEY |
--dev-key |
| LOL | RIOT_LOL_KEY |
--lol-key |
| TFT | RIOT_TFT_KEY |
--tft-key |
| more to came |
Usage
CLI
Installation
Download release from https://git.rcorral.es/ruben/riot-clojure/releases.
Example
Using the Java uberjar
$ java -jar target/riot-clojure-2.0.141-standalone.jar [args]
Using the linux native image: $ ./riot [args]
Both are equivalent. In the examples we will use the native image, because is shorter.
Options
Run the application without params or wich -? param to show all options:
$ ./riot -?
Tipycal usages
Show all matches from a march the 1st (in ISO format):
$ ./riot matches <username> <tag> -s "2025-03-01"
Get te same data in CSV and store it in a file:
$ ./riot matches <username> <tag> -s "2025-03-01" -o csv > results.csv
Get matches between two dates:
$ ./riot matches <username> <tag> -s "2025-03-01" -u "2025-03-03"
Show statistics about mathes from a march the 1st (in ISO format):
$ ./riot stats <username> <tag> -s "2025-03-01"
Show if a player is playing just now:
$ ./riot playing <username> <tag>
Library
Version
Notes about v2.0: This is complete rewriting of the project, with all I have learn in the last months. The objetive for this version is to implement all functionality provided by v1.1.
Status
General
- Reestructure all project to use
deps.edn,tools.cljand subprojects - Distribute CLI as self executable (jlink or graal)
- Data for League of Legends (LoL)
- Teamfight Tactics (TFT)
- Legends of Runeterra (LoR)
- Valorant (VAL)
Library
- Read tokens from environment and a function to override them manually
- Fuctions for calling Riot API and read result as clojure data structures (EDN format)
- Get PUUID for a player
- Get basic player info
- Format raw data
CLI
- Rich and easy to use CLI
- Basic parameters for log level and override API tokens
- Obtain basic player info
- Last games for player (LOL, TFT and others)
- Is the player playing just now?
- Contiuosly check if the player es playing
- Format output as fancy table
- Format output as CSV
- Format output as JSON
- Calculte basic statistics
- [-] Calculate advanced statistics: win strike, adversaries, etc.
License
MIT License
Copyright (c) 2026 ruben
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.