Skip to main content

Cards

Card endpoints live under /api/v1/cards.


Endpoints at a glance

MethodPathDescription
GET/api/v1/cardsSearch / browse — see Search
GET/api/v1/cards/randomRandom card
GET/api/v1/cards/:idSingle card by card ID
GET/api/v1/cards/:id/textPlain-text card summary
POST/api/v1/cards/resolveBatch resolve card name strings

Card object

Every card endpoint returns the same card shape. Key fields:

FieldTypeNotes
idstringStable identifier (RiftCodex ObjectId) — safe to store
namestringDisplay name
name_normalizedstringLowercased, punctuation-stripped — used for search
collector_numberstringe.g. OGN-001
set.set_codestringShort code, e.g. OGN
set.card_countnumber | undefinedTotal cards in this set
attributesobjectenergy, might, power
classificationobjecttype, supertype, rarity, tags, domains
text.plainstringRules text, punctuation intact
text.richstringRules text with inline symbol tokens
pricesobject | undefinedOpt-in — omitted by default; see Prices section
purchase_urisobjectMarketplace purchase URLs (tcgplayer, cardmarket) when available
is_tokenbooleantrue for token cards
all_partsarrayRelated tokens or meld parts
related_championsarrayChampions linked to this legend
related_legendsarrayLegends linked to this champion
related_printingsarrayArray of RelatedCard objects — other printings/editions (alternate art, promos, etc.) of the same card

GET /api/v1/cards/random

Returns one card chosen at random from the full index.

ParameterTypeNotes
includestring (optional)Pass prices to include price data; omitted by default (no prices returned)
GET /api/v1/cards/random
GET /api/v1/cards/random?include=prices

GET /api/v1/cards/:id

Fetch a single card by its stable card ID.

ParameterTypeNotes
includestring (optional)Pass prices to include price data; omitted by default (no prices returned)
GET /api/v1/cards/67f4064886be8495f7165dd7
GET /api/v1/cards/67f4064886be8495f7165dd7?include=prices

Returns 404 if no card with that ID exists.


GET /api/v1/cards/:id/text

Returns a plain-text text/plain summary — name, type line, then rules text — suitable for copy-pasting into chat or a deck note.

GET /api/v1/cards/67f4064886be8495f7165dd7/text

Example output:

Sun Disc
Gear

Equipped Champion gains +2 Power and +2 Might.

POST /api/v1/cards/resolve

Batch-resolves up to 20 card name strings. Used by the Discord and Reddit bots for [[Card Name]] triggers; also useful for any client that needs to go from human-readable names to card objects in one round-trip.

POST /api/v1/cards/resolve
{
"requests": ["Sun Disc", "Stalwart Poro", "[[Bard|OGN-001]]"],
"include": "prices"
}

Pass "include": "prices" in the request body to include price data on resolved cards. Omit it (or pass any other value) to exclude prices.

Each entry in results has:

FieldTypeNotes
requestobjectThe parsed request (name, set, collector)
cardCard | nullMatched card, or null if not found
matchTypestring"exact", "fuzzy", or "not-found"

Requests accept plain names or [[Name|SET-###]] format — the same syntax the bots parse from messages.


Prices

Prices are opt-in — the prices field is omitted by default. Pass ?include=prices (or "include": "prices" for the resolve endpoint) to receive price data. purchase_uris is always included when available.

Price data is populated by the ingest pipeline from TCGPlayer via tcgcsv.com and stored in Supabase.

{
"prices": {
"tcgplayer": {
"normal": 1.25,
"foil": 4.99,
"low_normal": 1.1,
"low_foil": null
},
"cardmarket": {
"normal": null,
"foil": null,
"low_normal": null,
"low_foil": null
}
},
"purchase_uris": {
"tcgplayer": "https://www.tcgplayer.com/...",
"cardmarket": "https://www.cardmarket.com/..."
}
}

All nested price fields are nullable. If a card has no listing for a given provider, those provider fields remain null.