Facets

GET /v2/facets[?locale=en]

A single payload mapping every enum-typed column across all DarkerDB tables to its localized display labels. Designed to be fetched once per session and cached client-side.

Why a separate endpoint

Item/monster/etc. responses carry raw slugs only ("rarity": "rare"). The display label ("Rare") is shared by hundreds of items, so inlining it on every row is waste. Instead, render-time UIs fetch /facets once at boot and look up labels from a tiny dictionary.

Response shape

{
   "rarity":     { "common": "Common", "rare": "Rare", "epic": "Epic", "legend": "Legendary" },
   "armor_type": { "cloth": "Cloth", "leather": "Leather", "plate": "Plate" },
   "slot_type":  { "chest": "Chest", "head": "Head", "hands": "Hands", ... },
   "class_type": { "common": "Common", "sub_boss": "Sub-Boss", "boss": "Boss" },
   "grade_type": { "common": "Common", "elite": "Elite", "nightmare": "Nightmare" },
   ...
}

Locale override

curl 'https://api.darkerdb.com/v2/facets?locale=fr'

Falls back to English when a tag has no French translation. Default is en.

Discovering valid values for a filter

SELECT DISTINCT rarity FROM darkerdb.items

— but you don't need to query the DB. The set of valid rarities is always exactly the keys in body.rarity from /facets. The dictionary is rebuilt from the live tables on every refresh, so new values in future patches appear automatically.