OverwolfSpire Codex พร้อมให้บริการบน Overwolf แล้ว เรียนรู้เพิ่มเติม →

Slay the Spire 2 (STS2) นักพัฒนา

สร้างเครื่องมือ บอท และคอนเทนต์ด้วยข้อมูลของ Spire Codex ทุกอย่างฟรีและเปิดกว้าง

วิดเจ็ตทูลทิป

เพิ่มทูลทิปแบบ Wowhead สำหรับการ์ด เรลิก และโพชั่นในเว็บไซต์ใดก็ได้ แท็ก script เดียว ไม่มี dependency

การติดตั้ง

<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 เดียวกัน) และให้การติดตามการใช้งาน เพดานของระดับใช้แยกต่อ endpoint การตอบกลับมี X-RateLimit-Remaining / X-RateLimit-Reset เพื่อให้คุณควบคุมจังหวะคำขอได้

ขีดจำกัดอัตรา

ทราฟฟิกเว็บไซต์300/minuteต่อ IP
ไม่มีคีย์ API15/minute
ผู้ใช้ที่ลงทะเบียน60/minuteสร้างได้ในโปรไฟล์ของคุณ
วิชาการ100/minuteให้เมื่อร้องขอ
แบบชำระเงิน120/minuteผู้สนับสนุน

เพดานทั้งหมดนับแยกต่อ endpoint: ตารางคือโควตาของคุณในแต่ละเส้นทาง ไม่ใช่พูลรวม endpoint หนักบางตัวมีงบของตัวเองที่ใช้กับผู้เรียกทุกคนไม่ว่าจะมีคีย์หรือไม่ (ดูการส่งออกการเล่นด้านล่าง 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 ไม่ได้เก็บค่าเหล่านี้ไว้

endpoint นี้มีงบของตัวเอง 120 เครดิตต่อชั่วโมง ใช้ร่วมกันทั้งผู้เรียกที่มีคีย์และไม่มีคีย์: คำขอแบบแบ่งหน้าใช้ 1 เครดิต การดึงทั้งหมดโดยไม่จำกัดใช้ 60 เครดิต การซิงก์ต่อเนื่องจึงเหมาะกับการดึงแบบแบ่งหน้าห่างกันราว 30 วินาที หากเจอ 429 ให้ทำตาม Retry-After และเริ่มต่อด้วย cursor เดิม

ต้องการข้อมูลทั้งหมด? การเรียกโดยไม่ระบุพารามิเตอร์จะเปลี่ยนเส้นทางไปยังไฟล์สแตติกที่สร้างใหม่วันละครั้ง /exports/runs-latest.jsonl.gz ในรูปแบบบรรทัดเดียวกัน; /api/exports/runs/manifest บอกเวลาที่สร้างและจำนวนรัน แต่ละบรรทัดมี player_token ซึ่งเป็นรหัสนามแฝงคงที่ของบัญชีที่ส่ง เป็น null สำหรับรันแบบไม่ระบุตัวตน

ต้องการแค่แพตช์เดียว? /api/exports/runs?version=v0.111.0 จะเปลี่ยนเส้นทางไปยังไฟล์สแตติกรายเวอร์ชันจากแผนที่ versions ในเมนิเฟสต์ คือ /exports/runs-v0.111.0.jsonl.gz; หากรวมกับ limit และ cursor จะเลื่อนดูเฉพาะแพตช์เดียวเป็นหน้า ๆ แทน

URL พื้นฐาน

https://spire-codex.com

ช่องเบต้า (เนื้อหาที่ยังไม่ปล่อยจากสาขาเบต้าของ Steam): เพิ่มสิ่งนี้ต่อท้าย endpoint เอนทิตีใดก็ได้: ?channel=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.

Endpoint

เอกสารแบบโต้ตอบฉบับเต็ม (สร้างอัตโนมัติจาก backend อัปเดตเสมอ): /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ระดับ ascension ทั้งหมด
GET/api/ascensions/{id}ascension เดียว
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/newsประกาศจาก Steam (สำเนาไว้ในเครื่องเพื่อความถาวร)
GET/api/news/{gid}ข่าวชิ้นเดียวพร้อมเนื้อหาที่ผ่านการกรอง
GET/api/versionsเวอร์ชันข้อมูลเบต้าที่มีสำหรับตัวเลือกเวอร์ชัน
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 ซึ่งเป็นรหัสนามแฝงคงที่ของบัญชีที่ส่ง เป็น 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}การเล่นที่ส่งมาหนึ่งรายการตาม 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รายการชาร์ตสำหรับตัวสำรวจ /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 ทุกอัน
GET/api/beta/versionเวอร์ชันเบต้าปัจจุบัน
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 ของไซต์ (ลงชื่อเข้าใช้เงียบๆ ในเกม) ตอบ 503 จนกว่าเซิร์ฟเวอร์จะมีคีย์ Steam
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รหัสบิลด์เกมที่ไม่ซ้ำกันซึ่งมีการเล่นที่ส่งมา
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}ZIP ของ JSON เอนทิตีทั้งหมดสำหรับหนึ่งภาษา (10 ครั้ง/ชั่วโมง)
GET/api/imagesหมวดหมู่แกลเลอรีรูปภาพ
GET/api/images/searchค้นหารูปภาพตามชื่อไฟล์
GET/api/images/game/{version}/{category}/browseเรียกดูโฟลเดอร์ของดัมป์แอสเซ็ตทั้งหมดแบบแบ่งหน้า (path, offset, limit)
GET/api/images/game/{version}/{category}/downloadZIP ของไฟล์ในโฟลเดอร์ดัมป์หนึ่งโฟลเดอร์ (path จำกัด 2000 ไฟล์)

หลายภาษา

เพิ่มพารามิเตอร์คิวรีนี้ต่อท้าย endpoint ใดก็ได้: ?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));

สไปรต์การ์ดขนาดจิ๋ว

สร้างภาพย่อการ์ดในเกม (ใช้ในหน้าประวัติการเล่น / Game Over) ในโปรเจกต์เว็บใดก็ได้ ใช้เลเยอร์ 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

ไฟล์สไปรต์

PNG ทั้ง 10 ไฟล์ให้บริการโดยเปิด 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. จับคู่กับฟิลด์ color ที่ /api/cards ส่งกลับมา

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 — การ์ดพื้นฐาน เป็น null สำหรับการ์ดใบเดียวที่ไม่มีการเรนเดอร์ (mad_science) ให้ใช้ 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}: id ตัวพิมพ์เล็กจาก /api/enchantments และ /api/cards (เช่น sharp, corrupted, sown)
  • มีเฉพาะการจับคู่การ์ดกับเอนแชนต์ที่ถูกต้องเท่านั้น (การส่งออกใช้กฎการใช้งานของเกมเอง) การจับคู่ที่ไม่ถูกต้องจึงได้ 404 ฟิลด์ card_type / applicable_to ใน /api/enchantments อธิบายว่าการ์ดใบไหนเข้าเกณฑ์
  • ทุกการจับคู่มีทั้งเวอร์ชันพื้นฐานและอัปเกรด ครบทั้ง 14 ภาษา พร้อมข้อความเอนแชนต์ที่แปลครบถ้วน

ส่งออกข้อมูล

ดาวน์โหลดข้อมูลเกมทั้งหมดเป็นไฟล์ ZIP เดียว แต่ละไฟล์มี JSON ของเอนทิตีทุกประเภท (การ์ด เรลิก มอนสเตอร์ พาวเวอร์ และอื่นๆ)

เอกสาร API แบบโต้ตอบ

เอกสาร Swagger/OpenAPI ฉบับเต็มพร้อมฟังก์ชันทดลองใช้

เปิดเอกสาร API →

โอเพนซอร์ส

Spire Codex เป็นโอเพนซอร์ส ไปป์ไลน์ดึงข้อมูล API และ frontend ทั้งหมดอยู่บน GitHub

ดูบน GitHub →