Skip to main content

Introduction

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.

Getting Started

1

Import the Dex

Import the Dex module from Pokemon Showdown:
const {Dex} = require('pokemon-showdown');
2

Query data

Access information using the appropriate method:
const tackle = Dex.moves.get('Tackle');
console.log(tackle.basePower); // 40

const pikachu = Dex.species.get('Pikachu');
console.log(pikachu.types); // ['Electric']
3

Use generation-specific data

Access data from previous generations using Dex.mod():
const gen1Tackle = Dex.mod('gen1').moves.get('Tackle');
console.log(gen1Tackle.basePower); // 35

Core Methods

Species Data

Get information about Pokémon species including stats, types, and abilities

Move Data

Access move properties like base power, accuracy, type, and effects

Ability Data

Query ability names, descriptions, and effects

Item Data

Retrieve item information including held item effects

Generation Support

The Dex API supports all Pokémon generations through mods:
// Current generation (Gen 9)
const currentDex = Dex;

// Access previous generations
const gen1Dex = Dex.mod('gen1');
const gen4Dex = Dex.mod('gen4');
const gen8Dex = Dex.mod('gen8');

// Use forGen() as shorthand
const gen7Dex = Dex.forGen(7);

Nonstandard Data

The Dex API includes nonstandard data from CAP, past generations, and unreleased content. Filter by exists and isNonstandard properties.

Filtering Nonstandard Content

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

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

const pikachu = Dex.species.get('pikachu');
console.log(pikachu.exists); // true
console.log(pikachu.isNonstandard); // null
  • exists: false - Data doesn’t exist (e.g., typos or Custom entries)
  • exists: true - Data exists in the database
  • isNonstandard: null - Standard, current generation data
  • isNonstandard: 'CAP' - CAP (Create-A-Pokémon) project data
  • isNonstandard: 'Past' - Available in past generations only

Format-Specific Data

Get data for a specific format using forFormat():
const formatDex = Dex.forFormat('gen8ou');
const move = formatDex.moves.get('Dynamax Cannon');

Listing All Data

Retrieve all entries of a given type:
// Get all moves
const allMoves = Dex.moves.all();

// Get all species
const allSpecies = Dex.species.all();

// Get all abilities  
const allAbilities = Dex.abilities.all();

// Get all items
const allItems = Dex.items.all();
The .all() method returns an array including nonstandard data. Filter the results as needed.

Type Utilities

The Dex provides helper methods for type calculations:

Check Immunity

// Check if target is immune to a type
const isImmune = Dex.getImmunity('Ground', ['Flying']);
console.log(isImmune); // false

// Works with Pokemon objects
const gliscor = Dex.species.get('Gliscor');
const immune = Dex.getImmunity('Ground', gliscor);
console.log(immune); // false (due to Flying type)

Calculate Effectiveness

// Get type effectiveness modifier
const effectiveness = Dex.getEffectiveness('Fire', ['Grass', 'Ice']);
console.log(effectiveness); // 2 (2x super effective)

// Returns: 0 = neutral, 1 = super effective, -1 = not very effective
Search across multiple data types:
const results = Dex.dataSearch('thunder', ['Moves', 'Abilities']);
// Returns matching moves and abilities containing "thunder"

Preloading Data

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();

Next Steps

Species API

Learn how to query Pokémon species data

Moves API

Explore move data and properties

Abilities API

Discover ability information

Items API

Access held items and their effects

Build docs developers (and LLMs) love