Skip to content
v2.0.0

Getting started

Install

The library is published on Maven Central as fr.tykok:pokeapi. Pick your build system:

build.gradle.kts
dependencies {
    implementation("fr.tykok:pokeapi:2.0.0")
}
build.gradle
dependencies {
    implementation 'fr.tykok:pokeapi:2.0.0'
}
pom.xml
<dependencies>
    <dependency>
        <groupId>fr.tykok</groupId>
        <artifactId>pokeapi</artifactId>
        <version>2.0.0</version>
    </dependency>
</dependencies>

Version

The snippets above are filled in at build time from the version this site was published for, so they always match the chip in the top-right corner. The Maven Central listing is the authoritative index of every published release.

Requirements

JVM 17 or later
Kotlin 2.1 or later
Transitive dependencies OkHttp, Jackson (jackson-module-kotlin)

First request

import fr.tykok.pokeapi.PokeApi
import fr.tykok.pokeapi.entities.pokemon.Pokemon

fun main() {
    val pikachu = PokeApi.get<Pokemon>(name = "pikachu")
    println(pikachu.name)   // pikachu
    println(pikachu.weight) // 60
}

Head to Methods for the full set of get() overloads, or browse the API Reference for every entity you can ask for.