The Dex API is Pokemon Showdown’s library for accessing information about Pokémon species, moves, items, abilities, natures, stats, and more. It provides a consistent interface for querying game data across all generations.
By default, Dex returns information about the latest generation. Use Dex.mod() to access data from previous generations.
// Get all movesconst allMoves = Dex.moves.all();// Get all speciesconst allSpecies = Dex.species.all();// Get all abilities const allAbilities = Dex.abilities.all();// Get all itemsconst allItems = Dex.items.all();
The .all() method returns an array including nonstandard data. Filter the results as needed.
// Check if target is immune to a typeconst isImmune = Dex.getImmunity('Ground', ['Flying']);console.log(isImmune); // false// Works with Pokemon objectsconst gliscor = Dex.species.get('Gliscor');const immune = Dex.getImmunity('Ground', gliscor);console.log(immune); // false (due to Flying type)
// Get type effectiveness modifierconst effectiveness = Dex.getEffectiveness('Fire', ['Grass', 'Ice']);console.log(effectiveness); // 2 (2x super effective)// Returns: 0 = neutral, 1 = super effective, -1 = not very effective
Preloading is optional. Data will be loaded automatically when needed.
// Preload mod list (~10ms)Dex.includeMods();// Preload formats (~30ms)Dex.includeFormats();// Preload all Gen 8 data (~500ms)Dex.includeData();// Preload all mod data (~1500ms)Dex.includeModData();