JSON data files of Pokémon, Games, Pokédexes, Living Dex Box presets, etc., used in https://pokepc.net and https://classic.pokepc.net.
Data has been collected from many public sources including: PokéAPI, Serebii.net and Bulbapedia.
Requirements: Bun 1.3+ and PNPM 10.27+
- Clone this project and install the dependencies with
pnpm install. - Edit the files that you need.
- Run
pnpm testto check if the dataset is still valid. - Before pushing any code, run
pnpm lintandpnpm typecheckto check if there are any circular imports or type errors.
TIP: If you edit a Box preset, you can preview it by running
pnpm run devand visitinghttp://localhost:4011/boxes(you will need to restart the server to see any data changes).
-
data/games/: Individial JSON files for each game.indices/: Keeps the sorting of the individual JSON files.metadata/: Extra metadata files (e.g. Pokémon sprite slice coords, etc.)pokedexes/: Individial JSON files for each Pokédex.pokemon/: Individial JSON files for each Pokémon.boxpresets/: Individial JSON files for each Living Dex Box preset..*.json: Standalone JSON files (types, colors, items, etc.)
-
lib/constants.ts: Constants.enums.ts: Values that are constant (e.g. move categories, item categories, etc.).fs.ts: File system utilities to load the dataset JSON files with the correct types.languages.ts: Languages extra data and utilities.schemas.ts: Zod schemas for the dataset.search.ts: Full-text search utilities. This is what powers the Pokémon searchbox on the PokéPC website.types.ts: All type definitions created from the schemas and the enums. Use thePkds.prefix to access them directly without imports. e.g.Pkds.Pokemon.utils.ts: Utility functions and helpers.validators.ts: Validators for the dataset.
-
tests/*.test.ts: Tests for the whole dataset. -
viewer/: Viewer apps for the dataset. They are built with just Preact and Bun. Runpnpm run devto start them.
The Pokemon search is powered by generatePokemonSearchableText() in lib/utils.ts and the matching helpers in
lib/search.ts.
- Search is case-insensitive.
- Commas are treated like spaces.
- Multiple spaces are collapsed.
- Positive tokens are combined with AND. Example:
pikachu electriconly matches entries containing both terms. - Negated tokens start with
!and must not be present. Example:pikachu !megamatches Pikachu results that do not containmega.
Each Pokemon contributes searchable text from the following data:
- Pokemon names from all available languages
- Form names from all available languages
- National Dex number
- Pokemon
id type:<type-id>for both primary and secondary typesregion:<region-id>color:<color-id>Special case: brown Pokemon also includecolor:orange- Generation tokens for both species dex generation and the Pokemon's own
genfield:gen1,gen:1,gen2,gen:2, etc. - Tags/flags when applicable:
mythical,legendary,female,baby,ultrabeast,ultra beast,regional,fusion,paradox,convergent,cosmetic,gigantamax,gmax,is-form,is-mega,is-battle-only,not-battle-only,is-storable,not-storable
charizard type:firepikachu !is-formtype:water !region:paldeagen:4 !legendarygmax !is-battle-only
import { loadAllPokemon } from '@pokepc/dataset/lib/fs'
import { createSearchablePokemonList, searchPokemon } from '@pokepc/dataset/lib/search'
const pokemon = createSearchablePokemonList(loadAllPokemon())
// all Pokemon or forms in generation 9 that are not mega and are electric and green
const results = searchPokemon(pokemon, {
q: 'gen9 !is-mega electric green', // or 'gen9 !is-mega type:electric color:green'
forms: true,
})
console.log(results.pokemon.map((item) => item.id))We don't offer a built version of this code via npm or similar.
The recommended way to use it in your projects is to add it as a git submodule, e.g.:
git submodule add git@github.com:pokepc/dataset.git packages/datasetThis way, you can directly use the dataset and the lib *.ts files in your project as you wish, e.g. as a monorepo
workspace dependency: "@pokepc/dataset": "workspace:*",
Once you build your own project, make sure you delete any content that is not needed, such as the dataset/tests/
directory, so you can save some space.
A big part of the data in this dataset is made possible thanks to the following projects:
Thanks to everyone for collecting and making the game data available to the public.
