cardshowdata
v2.3.0
Published
Official TypeScript/JavaScript SDK for the CardShowData TCG pricing API
Downloads
763
Maintainers
Readme
CardShowData JavaScript/TypeScript SDK
Official TypeScript client for the CardShowData TCG pricing API. Zero runtime dependencies.
Install
npm install cardshowdataQuick Start
import { CardShowData } from "cardshowdata";
const client = new CardShowData({ apiKey: "csd_live_..." });
// Get a card by pretty ID
const card = await client.cards.get("pk_bs_004");
console.log(card.name); // "Charizard"
console.log(card.image); // "https://images.cardshowdata.com/..."
// Search cards
const page = await client.cards.search({ tcg: "pk", q: "name:charizard" });
for (const card of page.data) {
console.log(`${card.name} — ${card.expansion?.name}`);
}
// Get pricing (all values in cents)
const price = await client.pricing.get("aaaa-bbbb-cccc-dddd");
console.log(price.marketPriceCents); // 12500
// Bulk pricing
const prices = await client.pricing.bulk(["uuid1", "uuid2", "uuid3"]);
// Browse the catalog
const tcgs = await client.catalog.listTcgs();
const sets = await client.catalog.listSets("pk");Auto-Pagination
Endpoints with pagination have *All() methods that return async iterables:
// Offset-paginated (cards)
for await (const card of client.cards.searchAll({ tcg: "pk", q: "name:pikachu" })) {
console.log(card.name);
}
// Cursor-paginated (catalog products, pricing changes)
for await (const product of client.catalog.listProductsAll("pk")) {
console.log(product.prettyId);
}
for await (const change of client.pricing.changesAll({ since: "2026-04-01T00:00:00Z" })) {
console.log(`${change.prettyId}: ${change.pctChange}%`);
}Resources
| Resource | Methods |
|----------|---------|
| client.cards | get(), search(), searchAll(), listByExpansion(), getEbaySales() |
| client.pricing | get(), bulk(), history(), changes(), changesAll() |
| client.catalog | listTcgs(), listSets(), getTaxonomy(), listProducts(), listProductsAll(), exportCsv(), resolve(), search() |
| client.grading | get(), history(), changes(), changesAll() |
| client.lifecycle | get() |
| client.usage | get() |
| client.sales | submit(), submitBatch(), submitCsv() |
| client.feedback | submit() |
| client.onboarding | quickstart() |
Error Handling
import { CardShowData, NotFoundError, RateLimitError } from "cardshowdata";
try {
await client.cards.get("nonexistent");
} catch (e) {
if (e instanceof NotFoundError) {
console.log("Card not found");
}
if (e instanceof RateLimitError) {
console.log(`Rate limited — retry after ${e.retryAfter}s`);
}
}Errors: AuthenticationError (401), PermissionError (403), NotFoundError (404), RateLimitError (429), ApiError (5xx).
Configuration
const client = new CardShowData({
apiKey: "csd_live_...", // or set CSD_API_KEY env var
baseUrl: "https://api.cardshowdata.com", // default
timeout: 30_000, // milliseconds
maxRetries: 3, // auto-retry on 429/5xx
});Rate limit info is available after any request:
console.log(client.rateLimit.remaining); // requests left this minuteRequirements
- Node.js 18+ (uses native
fetch) - Also works in Deno, Bun, and modern browsers
- Dual ESM + CJS build
- Full TypeScript types included
