Skip to content
v3.0.0

Berry

No. 002 Berry 3 endpoints

Suspending calls

Every PokeApi.get() snippet below is suspend — see Suspending calls for what that means and the getBlocking alternative.

The Berry entities is used to map data from https://pokeapi.co/api/v2/berry/....

Berry

Berry

The Berry class can be used to get data from /berry/{id or name}.

val berry = PokeApi.get<Berry>(id = 1)

BerryFirmness

The BerryFirmness class can be used to et data from /berry-firmness/{id or name}.

val berryFirmness = PokeApi.get<BerryFirmness>(id = 1)

BerryFlavor

The BerryFlavor class can be used to get data from /berry-flavor/{id or name}.

val berryFlavor = PokeApi.get<BerryFlavor>(id = 1)