Skip to content

Extensions Reference

PokeLance groups PokéAPI's ~60 resource categories into 11 extensions, attached to the client as attributes (client.berry, client.pokemon, ...).

Extensions are loaded dynamically during client initialization, you never construct them manually.

How to read the tables

  • Category is the API resource name (hyphenated, matching PokéAPI's own naming).
  • Methods are always get_<category> / fetch_<category> with hyphens turned into underscores.
  • Key is what you pass in: a name (str), an id (int), or both interchangeably.

client.berry, Berry

Category Key Returns
berry name or id models.Berry
berry-firmness name or id models.BerryFirmness
berry-flavor name or id models.BerryFlavor

client.contest, Contest

Category Key Returns
contest-type name or id models.ContestType
contest-effect id only models.ContestEffect
super-contest-effect id only models.SuperContestEffect

client.encounter, Encounter

Category Key Returns
encounter-method name or id models.EncounterMethod
encounter-condition name or id models.EncounterCondition
encounter-condition-value name or id models.EncounterConditionValue

client.evolution, Evolution

Category Key Returns
evolution-chain id only models.EvolutionChain
evolution-trigger name or id models.EvolutionTrigger

client.game, Game

Category Key Returns
generation name or id models.Generation
pokedex name or id models.Pokedex
version name or id models.Version
version-group name or id models.VersionGroup

client.item, Item

Category Key Returns
currency name or id models.Currency
item name or id models.Item
item-attribute name or id models.ItemAttribute
item-category name or id models.ItemCategory
item-fling-effect name or id models.ItemFlingEffect
item-pocket name or id models.ItemPocket

client.location, Location

Category Key Returns
location name or id models.Location
location-area name or id models.LocationArea
pal-park-area name or id models.PalParkArea
region name or id models.Region

client.machine, Machine

Category Key Returns
machine id only models.Machine

client.move, Move

Category Key Returns
move name or id models.Move
move-ailment name or id models.MoveAilment
move-battle-style name or id models.MoveBattleStyle
move-category name or id models.MoveCategory
move-damage-class name or id models.MoveDamageClass
move-learn-method name or id models.MoveLearnMethod
move-target name or id models.MoveTarget

client.pokemon, Pokemon

Category Key Returns
ability name or id models.Ability
characteristic id only models.Characteristic
egg-group name or id models.EggGroup
gender name or id models.Gender
growth-rate name or id models.GrowthRate
location-area-encounter name or id list[models.LocationAreaEncounter], a list, not a single model
nature name or id models.Nature
pokeathlon-stat name or id models.PokeathlonStat
pokemon name or id models.Pokemon
pokemon-color name or id models.PokemonColor
pokemon-form name or id models.PokemonForm
pokemon-habitat name or id models.PokemonHabitats
pokemon-shape name or id models.PokemonShape
pokemon-species name or id models.PokemonSpecies
stat name or id models.Stat
type name or id models.Type

client.utility, Utility

Category Key Returns
language name or id models.Language
api-metadata none models.APIMetadata, singleton, no list endpoint

Inspecting valid names and IDs

Once endpoint registries are cached (either on initial client connection or after await client.wait_until_ready()), all valid names and IDs for any category across all 11 extensions can be inspected directly:

  • client.<ext>.cache_group.<category>.identifiers: A set[str] containing every valid name and ID for the category (e.g. client.pokemon.cache_group.pokemon.identifiers).
  • client.<ext>.cache_group.<category>.endpoints: A dict[str, CacheEndpoint] mapping each resource identifier to its CacheEndpoint metadata (id, url).
import asyncio
from pokelance import PokeLanceAsyncClient


async def main() -> None:
    async with PokeLanceAsyncClient() as client:
        await client.wait_until_ready()
        berries = client.berry.cache_group.berry.endpoints
        print(f"Registered {len(berries)} berries (e.g. 'cheri' -> id {berries['cheri'].id})")


asyncio.run(main())
Registered 68 berries (e.g. 'cheri' -> id 1)

Programmatic access via ExtensionEnum

Categories are also available programmatically through pokelance.constants.ExtensionEnum:

from pokelance.constants import ExtensionEnum

for ext in ExtensionEnum:
    print(f"{ext.name:<10} -> {', '.join(ext.value.categories)}")
Berry      -> berry, berry-firmness, berry-flavor
Contest    -> contest-type, contest-effect, super-contest-effect
Encounter  -> encounter-method, encounter-condition, encounter-condition-value
Evolution  -> evolution-chain, evolution-trigger
Game       -> generation, pokedex, version, version-group
Item       -> currency, item, item-attribute, item-category, item-fling-effect, item-pocket
Location   -> location, location-area, pal-park-area, region
Machine    -> machine
Move       -> move, move-ailment, move-battle-style, move-category, move-damage-class, move-learn-method, move-target
Pokemon    -> ability, characteristic, egg-group, gender, growth-rate, location-area-encounter, nature, pokeathlon-stat, pokemon, pokemon-color, pokemon-form, pokemon-habitat, pokemon-shape, pokemon-species, stat, type
Utility    -> language, api-metadata

Comments