DEPRECATED. USE https://github.com/mckernant1/lol-openapi
This is a wrapper around esports api calls in Kotlin. It converts response data into Java objects that are much easier to deal with.
Enjoy!
These are the docs That are available for the Esports API.
https://vickz84259.github.io/lolesports-api-docs/
Make sure you add maven central and jcenter Maven Central Link: https://search.maven.org/artifact/com.github.mckernant1/lol-esports-api-wrapper/0.1.19/jar
repositories {
mavenCentral()
jcenter()
}
...
dependencies {
...
implementation("com.github.mckernant1:lol-esports-api-wrapper:+")
}
This provides Clients that get data on various endpoints
val leagueClient = LeagueClient()
val lcs = LeagueClient.getLeagueByName("LCS")
val lcsId = lcs.id
val tournamentClient = TournamentClient()
val tournament = tournamentClient.getTournamentsForLeague(lcsId)
val split = ScheduleClient().getSplit(lcsId, 2020, 1) // Gets spring 2020 split including playoffs
You can also use the general perpose EsportsApiHttpClient to do general queries that return JSON strings
val rawEsportsApiHttpClient = RawEsportsApiHttpClient()
val split = rawEsportsApiHttpClient.get(
"getSchedule",
listOf(
Pair("leagueId", leagueId)
)
)
You can alter the settings of the httpClient via this config object
endpointHost: the host of the API to reach out to. Different clients use different endpoints
languageCode: the language code ENUM of the language you want. Enum is here
logger: Specify a Print function for the config.
data class EsportsApiConfig(
val endpointHost: HostUrl = HostUrl.ESPORTS_API_1,
val languageCode: LanguageCode = LanguageCode.EN_US,
)