Skip to Content

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

ResourceURL
SWU APIhttps://admin.starwarsunlimited.com/api/cards
TCGCSV (category 79)https://tcgcsv.com/tcgplayer/79/
TCGPowertoolsVia TcgPowerToolsService (category 21)
Official variant guideThe Art of Unlimited 
Importer sourcepackages/games/game-importer/src/star-wars-unlimited-importer.ts
Game configpackages/games/game-configuration/src/lib/games/star-wars-unlimited/
Cardmarket game codeStarWarsUnlimited (in game-code-mapping.ts)

Data Sources

SourceRoleData Provided
TCGCSVPrimary (source of truth)All TCGPlayer products, product IDs, product names with variant suffixes, group-level expansion data, images (1000x1000 via toTcgCsvHighResImage)
SWU APIEnrichmentCard attributes (cost, power, HP, aspects, traits, keywords), translations (DE, FR, IT, ES), art crops (418x300 fallback)
TCGPowertoolsEnrichmentCardmarket 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:

VariantDescriptionTCGPlayer Suffix
StandardDefault card art(none) or (Foil)
HyperspaceExtended art with Hyperspace frame(Hyperspace) or (Hyperspace Foil)
ShowcaseFull-art leaders with unique frame and foiling(Showcase)
PrestigePremium 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:

FinishEnum ValueDescription
NormalStandardNon-foil card
FoilFoilHolographic foil treatment
SerializedSerializedIndividually 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 NameVariantFinish
Card NameStandardNormal
Card Name (Foil)StandardFoil
Card Name (Hyperspace)HyperspaceNormal
Card Name (Hyperspace Foil)HyperspaceFoil
Card Name (Showcase)ShowcaseFoil
Card Name (Prestige)PrestigeNormal
Card Name (Prestige Foil)PrestigeFoil
Card Name (Serialized)PrestigeSerialized

SWU API Variant Type Mapping

When enriching from the SWU API, the variantTypes relation maps to our model:

SWU API variantTypeVariantFinish
StandardStandardNormal
Standard FoilStandardFoil
HyperspaceHyperspaceNormal
Hyperspace FoilHyperspaceFoil
ShowcaseShowcaseFoil
Standard PrestigePrestigeNormal
Foil PrestigePrestigeFoil
Serialized PrestigePrestigeSerialized

Import Flow

Step-by-step

  1. Load data sources — TCGCSV products (all groups for category 79), SWU API cards (paginated, cached), TCGPowertools data
  2. 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.
  3. Build SWU API index — Index all API cards by accent-normalized name for O(1) enrichment lookups
  4. 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 CardData with guaranteed TCGPlayer ID
  5. Generate diff — Compare against existing DB state
  6. 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

SourceCreatesExamples
TCGCSV groups (primary)All expansionsSpark of Rebellion, Weekly Play Promos, Judge Promos
SWU API sets (enrichment)Short codes for main setssor, 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).

Code Locations

ComponentLocation
Importerpackages/games/game-importer/src/star-wars-unlimited-importer.ts
Game typespackages/games/game-configuration/src/lib/games/star-wars-unlimited/star-wars-unlimited.types.ts
Game configpackages/games/game-configuration/src/lib/games/star-wars-unlimited/star-wars-unlimited.game.ts
TCGCSV image utilspackages/games/game-importer/src/lib/tcg-csv/tcg-csv-image.ts
Cardmarket mappingpackages/games/marketplace-scraper/src/game-code-mapping.ts
Price importer configpackages/games/price-importer/src/tcgplayer-importer.ts
Last updated on