npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beastmaster23/pokemon-tcg-yajs-sdk

v1.1.0

Published

A modern JavaScript SDK for interacting with the Pokemon Trading Card Game API, providing an intuitive interface for accessing Pokemon TCG card data, set information, and market prices.

Downloads

14

Readme

YA Pokemon TCG SDK (Yet Another Pokemon TCG SDK)

npm version npm downloads

A modern JavaScript SDK for interacting with the Pokemon Trading Card Game API. This is "Yet Another" implementation of the Pokemon TCG SDK, providing a more intuitive interface and additional features for accessing Pokemon TCG card data, set information, and market prices.

Why Another SDK?

While there are existing Pokemon TCG SDKs (like the original pokemon-tcg-sdk-javascript), this implementation aims to provide:

  • 🚀 Modern JavaScript features and async/await syntax
  • 📦 ES Modules support
  • 🔄 Improved error handling
  • 💡 Enhanced documentation
  • 🛠️ Additional utility methods
  • 🔍 Improved search capabilities
  • 💰 Enhanced market data integration

Features

  • 🔍 Search and retrieve Pokemon TCG cards
  • 📦 Access set information and details
  • 💰 Get card prices from TCGPlayer and CardMarket
  • 🎮 Check card legality in different formats
  • 🖼️ Access card and set images
  • 📊 Comprehensive card data including:
    • Card types and evolution stages
    • Abilities and attacks
    • Weaknesses and resistances
    • Ancient traits
    • Pokedex numbers
    • Artist information
    • Rarity and flavor text

Installation

# Using npm
npm install @beastmaster23/pokemon-tcg-yajs-sdk

# Using yarn
yarn add @beastmaster23/pokemon-tcg-yajs-sdk

# Using pnpm
pnpm add @beastmaster23/pokemon-tcg-yajs-sdk

NPM

Usage

Configuration

First, you need to configure the SDK with your API key:

import pokemon from 'pokemon-tcg-yajs-sdk';

// Configure with your API key
pokemon.configure('your-api-key-here');

Finding Cards

// Find a specific card by ID
const card = await pokemon.cards.find('xy7-54');

// Search for cards
const cards = await pokemon.cards.where('name:charizard');

// Get all cards (with optional filters)
const allCards = await pokemon.cards.all({
  q: 'set.id:base1',
  orderBy: 'name'
});

Working with Card Data

// Check card type
if (card.isPokemon()) {
  // Check evolution stage
  if (card.isBasic()) {
    console.log('This is a Basic Pokemon');
  }
}

// Get card details
const cardName = card.getName();
const cardType = card.getTypes();
const cardHP = card.hp;
const cardRarity = card.getRarity();

// Check card legality
if (card.isLegal('standard')) {
  console.log('This card is legal in Standard format');
}

// Get card prices
const tcgplayerPrice = card.getPrice('tcgplayer', 'market');
const cardmarketPrice = card.getPrice('cardmarket');

// Get card images
const cardImage = card.getImageUrl('large');
const setSymbol = card.getSetSymbol();

Working with Sets

// Find a specific set
const set = await pokemon.types.card.Set.find('base1');

// Get set information
const setName = set.getName();
const setSeries = set.getSeries();
const releaseDate = set.getReleaseDate();
const totalCards = set.getTotal();

// Get set images
const setSymbol = set.getSymbolUrl();
const setLogo = set.getLogoUrl();

API Reference

Card Methods

Type Checking

  • isPokemon() - Check if card is a Pokemon
  • isTrainer() - Check if card is a Trainer
  • isEnergy() - Check if card is an Energy

Evolution Stage

  • isBasic() - Check if card is a Basic Pokemon
  • isStage1() - Check if card is a Stage 1 Pokemon
  • isStage2() - Check if card is a Stage 2 Pokemon
  • isV() - Check if card is a V Pokemon
  • isVMAX() - Check if card is a VMAX Pokemon
  • isVSTAR() - Check if card is a VSTAR Pokemon

Card Properties

  • hasLevel() - Check if card has a level
  • hasAncientTrait() - Check if card has an ancient trait
  • hasRules() - Check if card has rules text
  • hasAbility() - Check if card has abilities
  • hasAttack() - Check if card has attacks
  • hasWeakness() - Check if card has weaknesses
  • hasResistance() - Check if card has resistances

Game Mechanics

  • isLegal(format) - Check card legality in a format
  • getWeakness(type) - Get weakness value for a type
  • getResistance(type) - Get resistance value for a type
  • getAttackCost(attackIndex) - Get attack cost
  • getAttackDamage(attackIndex) - Get attack damage
  • getAttackText(attackIndex) - Get attack text

Market Data

  • getPrice(source, type) - Get card price from TCGPlayer or CardMarket

Images

  • getImageUrl(size) - Get card image URL
  • getSetSymbol() - Get set symbol image URL
  • getSetLogo() - Get set logo image URL

Set Methods

Information

  • getName() - Get set name
  • getSeries() - Get set series
  • getReleaseDate() - Get release date
  • getUpdatedAt() - Get last update timestamp
  • getPtcgoCode() - Get PTCGO code

Card Counts

  • getPrintedTotal() - Get total printed cards
  • getTotal() - Get total cards

Images

  • getSymbolUrl() - Get set symbol URL
  • getLogoUrl() - Get set logo URL

Legality

  • isLegal(format) - Check set legality in a format
  • getLegalities() - Get all legality information

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. This project aims to provide a modern, well-maintained alternative to existing Pokemon TCG SDKs.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments