SWU Importer Technical Overview
Star Wars: Unlimited is a trading card game by Fantasy Flight Games launched in March 2024. It features Standard, Hyperspace, Showcase, and Prestige card variants with Carbonite Edition premium products.
The importer (StarWarsUnlimitedImporter) uses a TCGCSV-first architecture — every product on TCGPlayer is the source of truth for what exists in our system. The SWU API enriches products with attributes, translations, and art fallback. It extends BaseImporter and follows the standard import lifecycle.
Useful Resources
| Resource | URL |
|---|---|
| SWU API | https://admin.starwarsunlimited.com/api/cards |
| TCGCSV (category 79) | https://tcgcsv.com/tcgplayer/79/ |
| TCGPowertools | Via TcgPowerToolsService (category 21) |
| Official variant guide | The Art of Unlimited |
| Importer source | packages/games/game-importer/src/star-wars-unlimited-importer.ts |
| Game config | packages/games/game-configuration/src/lib/games/star-wars-unlimited/ |
| Cardmarket game code | StarWarsUnlimited (in game-code-mapping.ts) |
Data Sources
| Source | Role | Data Provided |
|---|---|---|
| TCGCSV | Primary (source of truth) | All TCGPlayer products, product IDs, product names with variant suffixes, group-level expansion data, images (1000x1000 via toTcgCsvHighResImage) |
| SWU API | Enrichment | Card attributes (cost, power, HP, aspects, traits, keywords), translations (DE, FR, IT, ES), art crops (418x300 fallback) |
| TCGPowertools | Enrichment | Cardmarket product IDs, translation fallbacks |
TCGCSV is the primary source of truth. Every TCGCSV product becomes a CardNexus product with a guaranteed TCGPlayer ID. The SWU API and TCGPowertools are used for enrichment only. See TCGCSV-first architecture ADR.
Product Model
Variants
SWU cards come in different art/frame treatments, modeled as the StarWarsUnlimitedVariant enum:
| Variant | Description | TCGPlayer Suffix |
|---|---|---|
| Standard | Default card art | (none) or (Foil) |
| Hyperspace | Extended art with Hyperspace frame | (Hyperspace) or (Hyperspace Foil) |
| Showcase | Full-art leaders with unique frame and foiling | (Showcase) |
| Prestige | Premium alt-art, Carbonite Edition exclusive | (Prestige), (Prestige Foil), or (Serialized) |
Finishes
Each variant can exist in one or more physical finishes, modeled as the StarWarsUnlimitedFinish enum:
| Finish | Enum Value | Description |
|---|---|---|
| Normal | Standard | Non-foil card |
| Foil | Foil | Holographic foil treatment |
| Serialized | Serialized | Individually numbered (/250), Prestige Tier 3 only |
Each variant + finish combination is a separate product on TCGPlayer with its own unique ID and price. This is why SWU uses nested externalIds by finish.
TCGPlayer Suffix Mapping
The importer parses TCGCSV product names to determine variant and finish:
| TCGPlayer Product Name | Variant | Finish |
|---|---|---|
Card Name | Standard | Normal |
Card Name (Foil) | Standard | Foil |
Card Name (Hyperspace) | Hyperspace | Normal |
Card Name (Hyperspace Foil) | Hyperspace | Foil |
Card Name (Showcase) | Showcase | Foil |
Card Name (Prestige) | Prestige | Normal |
Card Name (Prestige Foil) | Prestige | Foil |
Card Name (Serialized) | Prestige | Serialized |
SWU API Variant Type Mapping
When enriching from the SWU API, the variantTypes relation maps to our model:
SWU API variantType | Variant | Finish |
|---|---|---|
| Standard | Standard | Normal |
| Standard Foil | Standard | Foil |
| Hyperspace | Hyperspace | Normal |
| Hyperspace Foil | Hyperspace | Foil |
| Showcase | Showcase | Foil |
| Standard Prestige | Prestige | Normal |
| Foil Prestige | Prestige | Foil |
| Serialized Prestige | Prestige | Serialized |
Import Flow
Step-by-step
- Load data sources — TCGCSV products (all groups for category 79), SWU API cards (paginated, cached), TCGPowertools data
- Build expansions — TCGCSV groups are the primary source. SWU API set codes enrich with short codes (e.g. “sor” for Spark of Rebellion). Groups with no API match become promo expansions.
- Build SWU API index — Index all API cards by accent-normalized name for O(1) enrichment lookups
- Iterate TCGCSV products — For each product:
- Skip if non-card (no
extNumber— sealed products, CSV artifacts) - Parse product name to extract base name and TCGPlayer suffix
- Resolve variant and finish from the suffix via
TCG_PLAYER_SUFFIX_MAP - Find matching SWU API card by normalized name for enrichment (attributes, translations, art fallback)
- Find Cardmarket ID via TCGPowertools (if API match found)
- Use TCGPlayer 1000x1000 image as primary, SWU API art crop as fallback
- Create
CardDatawith guaranteed TCGPlayer ID
- Skip if non-card (no
- Generate diff — Compare against existing DB state
- Apply diff — Upsert approved changes
Products with no SWU API match get minimal data — TCGPlayer ID, name, rarity from TCGCSV, and TCGPlayer image. No translations, no full attributes. This applies to TCGPlayer-specific products like Capital City // Shield (base + token pairings).
Expansion Mapping
| Source | Creates | Examples |
|---|---|---|
| TCGCSV groups (primary) | All expansions | Spark of Rebellion, Weekly Play Promos, Judge Promos |
| SWU API sets (enrichment) | Short codes for main sets | sor, sog, ttr, jtl, lof, sec, alt |
The tcgGroupSlugToExpansionCode map tracks the relationship between TCGCSV group slugs and expansion codes. For main sets with an API match, the SWU API code is used. For promo-only groups, the slugified group name becomes the code.
Name Normalization
Card names are normalized for matching using normalizeCardName():
- Lowercase
- Trim whitespace
- Strip diacritics (NFD decomposition + remove combining marks)
This handles cases like Chirrut ĂŽmwe (SWU API) matching Chirrut Imwe (TCGCSV).