Skip to content
v3.0.0

Locations

No. 008 Location 4 endpoints

Suspending calls

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

Location

The Location class can be used to make request on /location/{id or name} endpoint.

val location = PokeApi.get<Location>(id = 1)

LocationArea

The LocationArea class can be used to make request on /location-area{id or name} endpoint.

val locationArea = PokeApi.get<LocationArea>(id = 1)

PalParkArea

The PalParkArea class can be used to make request on /pal-park-area{id or name} endpoint.

val palParkArea = PokeApi.get<PalParkArea>(id = 1)

Region

The Region class can be used to make request on /region{id or name} endpoint.

val region = PokeApi.get<Region>(id = 1)