Game Importers
Game importers fetch card data from official game APIs and third-party sources, normalize it into our data model, and create products in the CardNexus database. Each supported game has a dedicated importer that extends BaseImporter.
General Import Flow
Every game importer follows the same lifecycle:
- init — Connect to data sources (APIs, TCGCSV, TCGPowertools)
- getExpansions — Fetch and normalize expansion/set data
- getCards — Fetch cards, transform attributes, match marketplace IDs
- generateDiff — Compare with existing DB state, generate add/modify/remove diff
- applyDiff — Apply approved changes to the database
Common Data Sources
| Source | Purpose | Used By |
|---|---|---|
| TCGCSV | TCGPlayer product IDs and pricing data | All TCGPlayer games |
| TCGPowertools | Cardmarket IDs, translations | Pokemon, SWU, FAB |
| Game-specific APIs | Official card data, art, attributes | SWU, Pokemon, MTG (Scryfall) |
Code Locations
| Component | Location |
|---|---|
| Base importer | packages/games/game-importer/src/base-importer.ts |
| TCGCSV service | packages/games/game-importer/src/lib/tcg-csv/tcg-csv.service.ts |
| Game configurations | packages/games/game-configuration/src/lib/games/ |
Last updated on