All Projects → taycaldwell → Riot Api Java

taycaldwell / Riot Api Java

Licence: apache-2.0
Riot Games API Java Library

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Riot Api Java

Discord.jl
The Julia Discord API Wrapper
Stars: ✭ 93 (-49.46%)
Mutual labels:  api, api-wrapper, library
Kayn
superagent-inspired Node.js lib (w/ **some** TypeScript support) for accessing Riot's League of Legend's API (discord: cnguy#3614)
Stars: ✭ 122 (-33.7%)
Mutual labels:  api, riot
Stripe Sdk
A simple and flexible Stripe library for Flutter with complete support for SCA and PSD2.
Stars: ✭ 120 (-34.78%)
Mutual labels:  api, library
Bittrex.net
A C# .Net wrapper for the Bittrex web API including all features easily accessible and usable
Stars: ✭ 131 (-28.8%)
Mutual labels:  api, api-wrapper
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-1.63%)
Mutual labels:  api, api-wrapper
Typescript Hapi Starter
🚀 Starter for building APIs with Hapi + Typescript!
Stars: ✭ 117 (-36.41%)
Mutual labels:  api, library
Anyapi
AnyAPI is a library that helps you to write any API wrappers with ease and in pythonic way.
Stars: ✭ 126 (-31.52%)
Mutual labels:  api, api-wrapper
Bluelinky
An unofficial nodejs API wrapper for Hyundai bluelink
Stars: ✭ 94 (-48.91%)
Mutual labels:  api, api-wrapper
Rcrossref
R client for various CrossRef APIs
Stars: ✭ 137 (-25.54%)
Mutual labels:  api, api-wrapper
Coinbasepro Csharp
The unofficial .NET/C# client library for the Coinbase Pro/GDAX API
Stars: ✭ 143 (-22.28%)
Mutual labels:  api, library
Deeply
PHP client for the DeepL.com translation API (unofficial)
Stars: ✭ 152 (-17.39%)
Mutual labels:  api, library
Tlaw
The Last API Wrapper: Pragmatic API wrapper framework
Stars: ✭ 112 (-39.13%)
Mutual labels:  api, api-wrapper
Grammers
(tele)gramme.rs - use Telegram's API from Rust
Stars: ✭ 109 (-40.76%)
Mutual labels:  api, library
Tik4net
Manage mikrotik routers with .NET C# code via ADO.NET like API or enjoy O/R mapper like highlevel api.
Stars: ✭ 118 (-35.87%)
Mutual labels:  api, library
Xseries
Library for cross-version Minecraft Bukkit support and various efficient API methods.
Stars: ✭ 109 (-40.76%)
Mutual labels:  api, library
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (-34.24%)
Mutual labels:  api, library
Item Nbt Api
Add custom NBT tags to Items/Tiles/Entities without NMS!
Stars: ✭ 163 (-11.41%)
Mutual labels:  api, library
Soundcloud
Soundcloud.com API wrapper written in PHP with OAuth2 support.
Stars: ✭ 94 (-48.91%)
Mutual labels:  api, library
Mlb Statsapi
Python wrapper for MLB Stats API
Stars: ✭ 135 (-26.63%)
Mutual labels:  api, api-wrapper
Jda
Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Stars: ✭ 2,598 (+1311.96%)
Mutual labels:  api, api-wrapper

RIOT-API-JAVA


JitPack

A simple to use Riot Games API wrapper for Java. This library makes it easy to gather and use League of Legends data in your apps.

Disclaimer

This product is not endorsed, certified or otherwise approved in any way by Riot Games, Inc. or any of its affiliates.

Requirements

riot-api-java requires Java 7 and the following libraries:

Setup

Download the .jar file, and add it as an external library to your project.

If you are using Eclipse, this can be done by right clicking your project, and selecting:

Build Path -> Configure Build Path -> Libraries -> Add External Jars

and selecting the jar under the Order and Export tab.

This project is also available on Jitpack

Gradle

Add Jitpack to your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add the project as a dependency:

dependencies {
	compile 'com.github.taycaldwell:riot-api-java:4.3.0'
}

Maven

Add Jitpack as a repository:

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

Add the project as a dependency:

<dependency>
    <groupId>com.github.taycaldwell</groupId>
    <artifactId>riot-api-java</artifactId>
    <version>4.2.0</version>
</dependency>

Usage

This library can be used strictly according to the Riot API Documentation like so:

import net.rithms.riot.api.ApiConfig;
import net.rithms.riot.api.RiotApi;
import net.rithms.riot.api.RiotApiException;
import net.rithms.riot.api.endpoints.summoner.dto.Summoner;
import net.rithms.riot.constant.Platform;

/**
 * This example demonstrates using the RiotApi to request summoner information for a given summoner name
 */
public class SummonerExample {

	public static void main(String[] args) throws RiotApiException {
		ApiConfig config = new ApiConfig().setKey("YOUR-API-KEY-HERE");
		RiotApi api = new RiotApi(config);

		Summoner summoner = api.getSummonerByName(Platform.NA, "tryndamere");
		System.out.println("Name: " + summoner.getName());
		System.out.println("Summoner ID: " + summoner.getId());
		System.out.println("Account ID: " + summoner.getAccountId());
		System.out.println("PUUID: " + summoner.getPuuid());
		System.out.println("Summoner Level: " + summoner.getSummonerLevel());
		System.out.println("Profile Icon ID: " + summoner.getProfileIconId());
	}
}

It is important to be aware of your personal rate limit. Any method call from the Riot API is a request that counts towards your rate limit, except requests regarding static data which count toward a method rate limit but not toward your app rate limit. The below code makes 2 requests; one request for a summoner, and another for the match list of a summoner.

import net.rithms.riot.api.ApiConfig;
import net.rithms.riot.api.RiotApi;
import net.rithms.riot.api.RiotApiException;
import net.rithms.riot.api.endpoints.match.dto.MatchList;
import net.rithms.riot.api.endpoints.match.dto.MatchReference;
import net.rithms.riot.api.endpoints.summoner.dto.Summoner;
import net.rithms.riot.constant.Platform;

/**
 * This example demonstrates using the RiotApi to request the match list for a given summoner name and iterating over the match list
 */
public class MatchListExample {

	public static void main(String[] args) throws RiotApiException {
		ApiConfig config = new ApiConfig().setKey("YOUR-API-KEY-HERE");
		RiotApi api = new RiotApi(config);

		// First we need to request the summoner because we will need it's account ID
		Summoner summoner = api.getSummonerByName(Platform.NA, "tryndamere");

		// Then we can use the account ID to request the summoner's match list
		MatchList matchList = api.getMatchListByAccountId(Platform.NA, summoner.getAccountId());

		System.out.println("Total Games in requested match list: " + matchList.getTotalGames());

		// We can now iterate over the match list to access the data
		if (matchList.getMatches() != null) {
			for (MatchReference match : matchList.getMatches()) {
				System.out.println("GameID: " + match.getGameId());
			}
		}
	}
}

You can find these and more examples in the repository's directory "examples".

Documentation

The documentation for this library can be found here.

API Versions

The current version of this library supports the following Riot Games API versions:

  • CHAMPION-MASTERY-V4
  • CHAMPION-V3
  • LEAGUE-V4
  • LOL-STATUS-V3
  • MATCH-V4
  • SPECTATOR-V4
  • STATIC-DATA-V3 (deprecated)
  • SUMMONER-V4
  • THIRD-PARTY-CODE-V4
  • TOURNAMENT-V3
  • TOURNAMENT-STUB-V4

Contributing

All contributions are appreciated. If you would like to contribute to this project, please send a pull request.

Contact

Have a suggestion, complaint, or question? Open an issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].