OverwolfSpire Codex 現已登陸 Overwolf。 瞭解更多 →

殺戮尖塔2 (STS2) 開發者

用 Spire Codex 的資料打造工具、機器人和內容。一切免費開放。

提示框元件

為任何網站加入 Wowhead 風格的卡牌、遺物和藥水懸停提示。一個 script 標籤,零依賴。

安裝

<script src="https://spire-codex.com/widget/spire-codex-tooltip.js"></script>

語法

[[Strike]]卡牌提示(預設類型)
[[card:Bash]]卡牌(顯式)
[[relic:Burning Blood]]遺物
[[potion:Fire Potion]]藥水
[[character:Ironclad]]角色
[[monster:Jaw Worm]]怪物
[[power:Strength]]能力
[[event:Neow]]事件
[[encounter:Lagavulin]]遭遇
[[enchantment:Sharp]]附魔
[[keyword:Exhaust]]關鍵詞
[[orb:Lightning]]能量球
[[affliction:Bound]]狀態
[[achievement:Minimalist]]成就

JavaScript API

SpireCodex.scan()重新掃描頁面中的新 [[...]] 模式(用於 SPA)
SpireCodex.scan(element)掃描指定的 DOM 元素

更新日誌元件

嵌入一個精簡的互動式更新日誌檢視器,展示 Spire Codex 的更新歷史並支援切換版本。

安裝

<div id="scx-changelog"></div>
<script src="https://spire-codex.com/widget/spire-codex-changelog.js"></script>
data-version="1.0.4"顯示指定版本(預設:最新)

REST API

完整遊戲資料庫可透過公開 REST API 存取。無需認證:按 IP 的網站配額足以涵蓋瀏覽和零散呼叫,無金鑰的 API 使用適用下方的基礎速率。 腳本和工具請建立 API 金鑰,並透過 X-API-Key 請求標頭傳送。 在個人資料頁建立一個。 金鑰按身分而非 IP 歸集你的請求(跨網路穩定,絕不與同一 NAT 下的其他用戶共享),並提供用量追蹤;其等級上限按端點計算。回應攜帶 X-RateLimit-Remaining / X-RateLimit-Reset,便於你控制請求節奏。

速率限制

網站流量300/minute每個 IP
無 API 金鑰15/minute
註冊用戶60/minute在個人資料中建立
學術100/minute按申請授予
付費120/minute贊助者

所有上限按端點計算:表格是你在每條路由上的配額,而不是全域池。少數重型端點有自己的預算,無論是否使用金鑰都對所有呼叫者生效(見下方的對局匯出;語言 ZIP 為每小時 10 次)。關注 X-RateLimit-Remaining,遇到 429 時退避(會設定 Retry-After)。

批次匯出對局

GET /api/exports/runs?limit=1000&start=2026-06-01T00:00:00Z

以 JSONL 串流輸出官方對局,每行一局。

limit 限制頁面大小;滿頁會回傳指向下一頁的 cursor。
start / end 限制為半開區間的提交時間視窗。分頁時保持不變;cursor 不包含它們。

該端點有自己的預算,每小時 120 點,帶金鑰和匿名呼叫者共享:分頁請求消耗 1 點,無限制拉取(不帶 limit)消耗 60 點。因此持續同步最好用間隔約 30 秒的分頁拉取;遇到 429 時遵守 Retry-After,並用同一個 cursor 繼續。

需要完整資料?不帶參數的呼叫會重新導向到每天重建一次的靜態檔案 /exports/runs-latest.jsonl.gz,行格式相同;/api/exports/runs/manifest 給出產生時間和對局數量。每行包含 player_token,即提交帳戶的穩定化名 ID,匿名對局為 null。

只要某個補丁?/api/exports/runs?version=v0.111.0 會重新導向到 manifest 的 versions 表中對應版本的靜態檔案 /exports/runs-v0.111.0.jsonl.gz;搭配 limit 和 cursor 則改為對單一補丁分頁拉取。

基礎 URL

https://spire-codex.com

Beta 頻道(來自 Steam beta 分支的未發布內容):在任意實體端點上加上: ?channel=beta. 目前 beta 版本: /api/beta/version. 與 main 的完整差異: /api/beta/diff.

The community stats pages were reorganized: /community-stats, /leaderboards/metrics, /charts, and the /meta page now live under /stats, /leaderboards/elo is /top-players, and run submission moved to /runs/submit. Old URLs redirect.

端點

完整互動式文件(由後端自動產生,始終最新): /docs

實體

GET/api/cards所有卡牌(篩選:color、type、rarity、keyword、tag、spawns、search)
GET/api/cards/{id}單張卡牌
GET/api/characters所有角色
GET/api/characters/{id}單個角色
GET/api/relics所有遺物(篩選:rarity、pool、ancient、search)
GET/api/relics/{id}單個遺物
GET/api/potions所有藥水(篩選:rarity、pool、search)
GET/api/potions/{id}單個藥水
GET/api/monsters所有怪物(篩選:type、search)
GET/api/monsters/{id}單個怪物
GET/api/powers所有能力(篩選:type、stack_type、search)
GET/api/powers/{id}單個能力
GET/api/events所有事件(篩選:type、act、search)
GET/api/events/{id}單個事件
GET/api/encounters所有遭遇(篩選:room_type、act、search)
GET/api/encounters/{id}單個遭遇
GET/api/enchantments所有附魔
GET/api/enchantments/{id}單個附魔
GET/api/keywords卡牌關鍵字
GET/api/keywords/{id}單個關鍵字
GET/api/intents所有意圖類型
GET/api/intents/{id}單個意圖
GET/api/orbs所有充能球類型
GET/api/orbs/{id}單個充能球
GET/api/afflictions苦難類型
GET/api/afflictions/{id}單個苦難
GET/api/modifiers自訂模式修正
GET/api/modifiers/{id}單個修正
GET/api/achievements所有成就
GET/api/achievements/{id}單個成就
GET/api/badges所有徽章
GET/api/badges/{id}單個徽章
GET/api/epochs所有紀元
GET/api/epochs/{id}單個紀元
GET/api/stories所有故事
GET/api/stories/{id}單個故事
GET/api/acts全部章節
GET/api/acts/{id}單個章節
GET/api/ascensions所有登塔等級
GET/api/ascensions/{id}單個登塔等級
GET/api/glossary所有術語
GET/api/glossary/{id}單個術語

彙總與查詢

GET/api/stats實體數量
GET/api/ancient-pools所有遠古者遺物池及其條件
GET/api/ancient-pools/{id}單個遠古者的池
GET/api/unlocks按類型分組、附帶紀元資訊的可解鎖實體
GET/api/history/{entity_type}/{entity_id}來自更新日誌的單個實體版本歷史
GET/api/update-history/{entity_type}/{entity_id}單個實體的遊戲補丁更新歷史
GET/api/names/{entity_type}/{entity_id}跨語言查詢實體名稱
GET/api/search涵蓋實體、參考條目、機制、攻略、新聞、網站頁面與圖片檔案的統一站內搜尋,支援容錯拼寫(q, lang)
GET/api/search/semanticMeaning-based entity search, same item shape as /api/search (q, limit); empty when the feature is off
GET/api/merchant/configMerchant pricing config extracted from the game
GET/api/mechanics/constantsMechanics constants: room odds, gold ranges, ascension tuning
GET/api/mechanics/sectionsIndex of the mechanics pages
GET/api/mechanics/sections/{slug}One mechanics page as markdown with template tokens resolved
GET/api/changelogs所有更新日誌
GET/api/changelogs/recent-additions首頁橫幅展示的最新實體
GET/api/changelogs/{tag}按標籤取得單個更新日誌(如 v1.0.20)
GET/api/newsSteam 公告(本地鏡像以便長期保存)
GET/api/news/{gid}單篇新聞,內文已淨化
GET/api/versions版本選擇器可用的 beta 資料版本
GET/api/news/codexSpire Codex site news, newest first
GET/api/news/codex/{slug}One site news entry
GET/api/announcementsActive site banner messages

Languages

GET/api/languagesAvailable languages with display names
GET/api/translationsTranslation maps for filter values and UI strings (lang)
GET/api/localizationsThe game's own localization tables as ICU MessageFormat, all of them or the ones named in ?tables= (max 50; unknown names are 404)
GET/api/localizations/tablesNames of the available localization tables
GET/api/localizations/{table}One localization table

社群與提交

GET/api/guides所有攻略(篩選:category、difficulty、tag、search)
GET/api/guides/{slug}單篇攻略,Markdown 已渲染
POST/api/guides提交攻略(Discord webhook,有速率限制)
POST/api/runsSubmit a run for community stats and leaderboards. The run is attached to an account only with Authorization: Bearer <jwt>; a bare steam_id is kept as a hint
POST/api/runs/claimAttach the signed-in account to previously-submitted anonymous runs by hash
GET/api/runs/list帶篩選和分頁瀏覽已提交的對局(包括按提交者勝率的 ascension_min/ascension_max 和 winrate_min/winrate_max,即內容分段) 每行包含 player_token,即提交帳戶的穩定化名 ID,匿名對局為 null。 total_is_lower_bound is true when the exact count ran out of time and total is a capped lower bound.
GET/api/runs/leaderboardRun leaderboards (fastest, highest_ascension); filter by character, players, game_mode, ascension_min, winrate_min (the content brackets), build_id
GET/api/runs/shared/{run_hash}按雜湊取得單個已提交對局(有速率限制)
GET/api/runs/stats社群統計彙總(可按 character、ascension、username 篩選)
GET/api/runs/community-statsThe /stats hub dataset: event decision splits, deadliest encounters, win rates by ascension/character, records. Takes the same bracket keys as the metrics tables; an unknown bracket returns HTTP 400
GET/api/charts/meta/stats/charts 瀏覽器的圖表註冊表:可用圖表、篩選、拆分和對局統計
GET/api/charts/{chart}One pre-aggregated chart (filter: players, ascension, game_mode, username, split, bracket=a10|wr30|wr50|wr75, build_id, plus per-chart params). A saved chart id from the chart builder returns that saved chart instead
POST/api/chartsSave a chart spec to your profile (bearer token, 100 per account)
PATCH/api/charts/{id}Update the title, visibility or spec of your own saved chart; DELETE removes it
GET/api/charts/mineYour saved charts, newest first (bearer token)
GET/api/charts/publicNewest public saved charts (limit)
GET/api/tierlists/shared/{share_id}Public read-only view of a shared tier list
GET/api/beta/diff目前 beta 按實體類型新增、修改和移除的內容;所有 BETA 標籤的資料來源
GET/api/beta/version目前 beta 版本
GET/api/runs/scores/{type}Codex Score + Codex Elo per entity (cards/relics/potions); ?bracket= grades within a run bracket (a10|wr30|wr50|wr75, a game version, or any metrics bracket; unknown is HTTP 400) (the in-game mod sends the same via ?stat_filter=a10|a10_wr30|a10_wr50|a10_wr75); relics accept ?act=1|2|3 to rank by acquisition act; ?character= switches to that character's slice (entries gain a scope field)
GET/api/runs/leaderboard/seed-rank某個種子的種子排名 + 全域排名(?seed=&steam_id=);沒有獲勝對局時排名欄位為 null
POST/api/auth/steam/ticket用 Steamworks 網頁認證票據換取站點 JWT(遊戲內靜默登入);伺服器沒有 Steam 金鑰前回傳 503
GET/api/runs/metrics/{type}Dense metrics table for cards/relics/potions, one row per entity: Codex Score, win_rate with a Wilson 95% win_rate_ci, hold_rate, lift and lift_n over the floor-adjusted expectation (null under 20 seats), Codex Elo and pick_rate from free choice screens for cards and relics, a wax block on relics (Toy Box copies split out), and used/use_rate on potions. Counts are per seat, so a 4P run is four seats; the response carries total_runs, total_seats, total_wins and data_through. ?bracket=all|solo|2p|3p|4p|a10|daily|custom|wr30|wr50|wr75 or a composite like solo:standard; ?character= switches to that character's slice (rows gain per-character Elo and Pick%). An unknown bracket returns HTTP 400
GET/api/runs/metrics/shopsShop shelf table, one row per card, relic or potion: seen, bought, buy_rate, and the buyers' win_rate, win_rate_ci and lift. Same bracket keys as the other metrics tables
GET/api/runs/metrics/eventsEvent option table: chosen, share of that event's choices, win_rate, win_rate_ci and lift. Same bracket keys as the other metrics tables
GET/api/runs/metrics/campfiresRest-site choice table (rest, smith, and the rest) with a localized name per ?lang=: chosen, share, low_hp_share, win_rate, win_rate_ci and lift. Same bracket keys as the other metrics tables
GET/api/runs/versions有已提交對局的遊戲版本 ID 列表
GET/api/runs/leaderboard/rank/{run_hash}Rank of one winning run within its ladder (category)
GET/api/leaderboards/eloTop players by Codex Elo over solo A10 standard runs, refreshed nightly; powers /top-players (limit, min_runs)
GET/api/runs/stats/{type}/{id}Community stats for one card, relic or potion, with per-bracket and per-character splits
GET/api/runs/stats/{type}/{id}/historyDaily Codex Score and Elo history for one entity (bracket=all|a10|wr30|wr50|wr75)
GET/api/runs/top/{type}/{character}Most-picked entities of a type for one character (limit)
GET/api/runs/encounter-statsPer-encounter appearances, fatal rate, avg damage and turns, per character too (act, room_type, multiplayer, bracket, build_id, encounter, page, limit)
GET/api/runs/encounter-seriesThe given encounters (max 20) rolled up per bracket and per recent game version
GET/api/runs/pulseCommunity run and win totals plus data_through
GET/api/runs/snapshot-statusWhether the stats are loaded or rebuilding
GET/api/runs/{run_hash}/similarNearest winning solo decks to a run and what they took that it didn't
GET/api/runs/archetypesCommunity deck archetypes, clustered nightly
GET/api/runs/encounter-buildsWhich archetypes die to an encounter and which walk past it (encounter)
GET/api/runs/deck-advisorWhat the winning decks nearest a partial deck carry that it doesn't yet (character, cards, relics)
GET/api/runs/pick-coachNearest archetypes for a partial deck and a score per offered card (character, cards, relics, offer, target)
GET/api/pairings/{item_type}/{item_id}Cards, relics and potions that show up in the same runs as this item
GET/api/draft-recs/{item_type}/{item_id}Cards players most often draft when they already hold this item
POST/api/draft-adviceRank the offered cards for the current deck
GET/api/replaysRuns with a replay to watch; same filters and row shape as /api/runs/list plus replay_url
GET/api/replays/summaryHow many replays are watchable, overall and per character
GET/api/runs/{run_hash}/replayThe stored replay journal as gzip; POST uploads one for a run you own, DELETE removes it
GET/api/players/{username}/insightsOne player's public insights with community comparison; 404 for unknown or private profiles
GET/api/players/{username}/stats玩家自己的卡牌、遺物、藥水、事件、商店和篝火統計及個人 Lift;篩選和隱私規則與 insights 相同
GET/api/presence/activeLive runs from the in-game mod, deepest first
GET/api/presence/{steam_id}One player's live run; 404 when they aren't in one
GET/api/thanksGitHub contributors, special thanks, and public supporters
GET/api/mod/latestLatest mod build and the game version it was verified against
GET/api/rate-limitsThe public rate-limit tiers
POST/api/feedback提交回饋(Discord webhook)

批次下載

GET/api/exports/runs官方對局的 JSONL 串流(limit/start/end/cursor 分頁;獨立的每小時 120 點預算,見上方批次匯出對局)
GET/api/exports/runs/manifestWhen the daily full run dump was generated and how many runs it holds
GET/api/exports/{lang}某一語言全部實體 JSON 的 ZIP(每小時 10 次)
GET/api/images圖庫分類
GET/api/images/search按檔名搜尋圖片
GET/api/images/game/{version}/{category}/browse分頁瀏覽完整資源轉儲的資料夾(path、offset、limit)
GET/api/images/game/{version}/{category}/download某個轉儲資料夾內檔案的 ZIP(path;上限 2000 個檔案)

多語言

在任意端點上加上此查詢參數: ?lang=jpn. 支援 15 種語言:

eng, deu, esp, fra, ita, jpn, kor, pol, ptb, rus, spa, tha, tur, zhs, zht

快速開始

cURL

curl https://spire-codex.com/api/cards?color=ironclad&rarity=Rare

Python

import requests
cards = requests.get("https://spire-codex.com/api/cards", params={"color": "ironclad"}).json()
for card in cards:
    print(f"{card['name']} - {card['type']} ({card['rarity']})")

JavaScript

const res = await fetch("https://spire-codex.com/api/relics?pool=ironclad");
const relics = await res.json();
console.log(relics.map(r => r.name));

迷你卡牌精靈圖

在任何網頁專案中重現遊戲內的卡牌縮圖(用於對局歷史 / 遊戲結束介面)。六層 PNG 透過 CSS mask-image 合成,不用 canvas,不用 WebGL,只是上色的精靈圖。 顏色直接取自反編譯的遊戲程式碼: NTinyCard, CardPoolModel.DeckEntryCardColor.

預覽

Ironclad / Attack / Common
Silent / Skill / Uncommon
Defect / Power / Rare
Necrobinder / Skill / Rare
Regent / Attack / Uncommon
Curse
Event
Quest

精靈圖資源

全部 10 個 PNG 均啟用 CORS,把基礎 URL 放在每個檔名前即可。每個精靈圖為 128×128、RGBA、透明底白色(用於透過 CSS 上色)。

https://spire-codex.com/static/images/ui/run_history_card/
  card_back.png           ← tinted by pool
  desc_box.png            ← dark description area (render at 25% opacity)
  attack_portrait.png     ← portrait per card type
  attack_portrait_shadow.png
  skill_portrait.png
  skill_portrait_shadow.png
  power_portrait.png
  power_portrait_shadow.png
  banner_shadow.png       ← render at 60% opacity
  banner.png              ← tinted by rarity

卡池(卡背)顏色

來源: CardPoolModel.DeckEntryCardColor. 將它們與 /api/cards 回傳的 color 欄位對應。

ironclad#D62000
silent#5EBD00
defect#3EB3ED
necrobinder#CD4EED
regent#E36600
colorless#A3A3A3
event#A3A3A3
curse#585B61
quest#24476A
status#FFFFFF
token#FFFFFF

稀有度(橫幅)顏色

來源: NTinyCard.GetBannerColor. 與 rarity 欄位對應。

Basic#9C9C9C
Starter#9C9C9C
Common#9C9C9C
Uncommon#64FFFF
Rare#FFDA36
Curse#E669FF
Event#13BE1A
Ancient#13BE1A
Quest#F46836
Status#9C9C9C
Token#9C9C9C

最簡 HTML + CSS 範例

肖像檔名: attack = 攻擊牌, power = 能力牌, skill = 其餘所有(技能、狀態、詛咒……)

<div class="tiny-card" style="
  --back: #D62000;   /* pool color, Ironclad */
  --banner: #FFDA36; /* rarity color, Rare */
  position: relative;
  width: 64px;
  height: 64px;
">
  <!-- 1. card back, tinted by pool -->
  <div class="layer" style="
    background-color: var(--back);
    mask: url(https://spire-codex.com/static/images/ui/run_history_card/card_back.png) center/contain no-repeat;
    -webkit-mask: url(https://spire-codex.com/static/images/ui/run_history_card/card_back.png) center/contain no-repeat;
  "></div>

  <!-- 2. description box -->
  <img class="layer" src="https://spire-codex.com/static/images/ui/run_history_card/desc_box.png" style="opacity:.25">

  <!-- 3. portrait shadow + portrait (attack/skill/power) -->
  <img class="layer" src="https://spire-codex.com/static/images/ui/run_history_card/attack_portrait_shadow.png">
  <img class="layer" src="https://spire-codex.com/static/images/ui/run_history_card/attack_portrait.png"
       style="filter: brightness(.95) sepia(.15)">

  <!-- 4. banner shadow + banner tinted by rarity -->
  <img class="layer" src="https://spire-codex.com/static/images/ui/run_history_card/banner_shadow.png" style="opacity:.6">
  <div class="layer" style="
    background-color: var(--banner);
    mask: url(https://spire-codex.com/static/images/ui/run_history_card/banner.png) center/contain no-repeat;
    -webkit-mask: url(https://spire-codex.com/static/images/ui/run_history_card/banner.png) center/contain no-repeat;
  "></div>
</div>

<style>
  .tiny-card .layer {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
  }
</style>

React 元件

開箱即用的 React 版本。原始碼: TinyCard.tsx

import TinyCard from "./TinyCard";

// Feed in the three fields from /api/cards:
<TinyCard color="ironclad" type="Attack" rarity="Rare" className="w-16 h-16" />

完整卡牌圖片

/api/cards 回傳的每張卡牌都包含兩個可直接使用的 URL,指向遊戲渲染的完整卡牌(邊框、插畫、橫幅和文字,與遊戲內完全一致)。遠古者卡牌為動態 webp。

  • image_url_card — 基礎卡。唯一一張沒有渲染圖的卡(mad_science)為 null;此時請回退到 image_url(肖像插畫)。
  • image_url_card_upg — 升級卡。卡牌沒有升級時為 null。
// e.g. /api/cards/bash
{
  "id": "BASH",
  "image_url":          "/static/images/cards/bash.webp",  // portrait art
  "image_url_card":     "https://cdn.spire-codex.com/cards-full/stable/bash.webp",
  "image_url_card_upg": "https://cdn.spire-codex.com/cards-full/stable/bash_upg.webp"
}

本地化渲染圖位於語言子資料夾下,例如: cards-full/stable/jpn/bash.webp. 全部 15 種語言均可用。

附魔卡牌渲染圖

每張卡牌還會與它可合法獲得的每種附魔一起渲染,與遊戲內附魔預覽的繪製完全一致(徽章、數值和新增的卡牌文字)。URL 遵循同一模式:

https://cdn.spire-codex.com/cards-full/stable/ench/{enchantment}/{card}.webp        // English, base
https://cdn.spire-codex.com/cards-full/stable/ench/{enchantment}/{card}_upg.webp    // English, upgraded
https://cdn.spire-codex.com/cards-full/stable/{lang}/ench/{enchantment}/{card}.webp // localized

// e.g. Anger with Corrupted, in Japanese:
https://cdn.spire-codex.com/cards-full/stable/jpn/ench/corrupted/anger.webp
  • {enchantment} / {card}: 來自 /api/enchantments 和 /api/cards 的小寫 id(如 sharp、corrupted、sown)。
  • 只存在合法的卡牌與附魔組合(匯出使用遊戲自身的適用規則),因此無效組合會回傳 404。/api/enchantments 中的 card_type / applicable_to 欄位說明哪些卡牌符合條件。
  • 每個組合都有基礎版和升級版,涵蓋全部 14 種語言,附魔文字完全本地化。

資料匯出

將全部遊戲資料下載為單個 ZIP 壓縮檔。每個壓縮檔包含所有實體類型(卡牌、遺物、怪物、能力等)的 JSON 檔案。

下載英文資料(ZIP)

提供 15 種語言。下載範例: 日語, 韓語, 中文, 法語, 德語

互動式 API 文件

完整的 Swagger/OpenAPI 文件,支援線上試用。

打開 API 文件 →

開源

Spire Codex 是開源的。資料擷取流水線、API 和前端都可以在 GitHub 上取得。

在 GitHub 上查看 →