smogon

Dex

Dex is a library for getting information about Pokémon, moves, items, abilities, natures, stats, etc.

By default, Dex gets information about the latest games (currently Pokémon Sword and Shield), but Dex.mod can be used to get information about other games.

const {Dex} = require('pokemon-showdown');

const tackle = Dex.moves.get('Tackle');

console.log(tackle.basePower); // prints 40

Nonstandard information

The Dex API gives access to a lot of nonstandard data (from other games, from CAP, unreleased things, etc). You often want to filter it out before using it.

For details, see sim/NONSTANDARD.md.

Nonstandard things will still have exists: true, but things we don’t have information for at all (for instance, if you typo) will have exists: false.

isNonstandard will be null for normal things.

const {Dex} = require('pokemon-showdown');

const frobnicate = Dex.moves.get('frobnicate');
console.log(frobnicate.exists); // prints false
console.log(frobnicate.isNonstandard); // prints 'Custom'

const tomohawk = Dex.species.get('tomohawk');
console.log(tomohawk.exists); // prints true
console.log(tomohawk.isNonstandard); // prints 'CAP'

const pikachu = Dex.species.get('pikachu');
console.log(pikachu.exists); // prints true
console.log(pikachu.isNonstandard); // prints null

Dex.mod

Dex.mod(modName: string): ModdedDex

Return values

Return values have not been stabilized yet. Use the TypeScript definitions if you’d like, but you should probably pin a specific dependency version.

dex: ModdedDex

Remember: dex refers to either Dex or Dex.mod(modID).

dex.moves.get(moveName: string): Move

dex.moves.all(): Move[]

dex.species.get(speciesName: string): Species

dex.species.all(): Species[]

dex.abilities.get(abilitysName: string): Ability

dex.abilities.all(): Ability[]

dex.items.get(itemName: string): Item

dex.items.all(): Item[]