This is a simple API wrapper that allows you to get information about Pokemon cards. It is built using Pokemon TCG API to get the data.
This is not an official API wrapper made by Pokemon TCG API.
Install the package using npm:
npm install @bosstop/pokemontcgapi
Install the package using pnpm:
pnpm install @bosstop/pokemontcgapi
import { PokemonTCG } from '@bosstop/pokemontcgapi';
const api = new PokemonTCG("<API_KEY>"); // Get your API key from https://pokemontcg.io/
const types = await api.getTypes();
console.log(types);
const supertypes = await api.getSupertypes();
console.log(supertypes);
const subtypes = await api.getSubtypes();
console.log(subtypes);
const rarities = await api.getRarities();
console.log(rarities);
Usage: all(): Promise<Set[]>
const sets = await api.sets.all();
console.log(sets);
Usage: getSetByID(id: string): Promise<Set>
const set = await api.sets.getSetByID('base1');
console.log(set);
Usage: getSetByName(name: string): Promise<Set>
const set = await api.sets.getSetByName('base');
console.log(set);
Usage: getCard(id: filters: ReturnData[]|string[] = []_)
const card = await api.cards.getCard('base1-4');
console.log(card);
Usage: searchByName(name: string, subtype: string, type: string, filters: ReturnData[]|string[] = [])
const cards = await api.cards.getCardByName('Charizard');
console.log(cards);
enum ReturnData {
NAME = 'name',
ID = 'id',
HP = 'hp',
SUPERTYPE = 'supertype',
SUBTYPES = 'subtypes',
TYPES = 'types',
EVOLVESTO = 'evolvesTo',
RULES = 'rules',
ATTACKS = 'attacks',
WEAKNESSES = 'weaknesses',
RETREATCOST = 'retreatCost',
SET = 'set',
NUMBER = 'number',
ARTIST = 'artist',
RARITY = 'rarity',
NATIONALPOKEDEXNUMBERS = 'nationalPokedexNumbers',
LEGALITIES = 'legalities',
IMAGES = 'images',
TCGPLAYER = 'tcgplayer',
}
If you like this package, consider donating to me. It will help me to maintain this package and make more packages like this.