DeckSense API
REST API for card data, tournament info, decklists, and deck analysis. No auth required for read endpoints.
App integration (types / resolve contract): API_INTEGRATION_GUIDE.md
Base URL: https://decksense.app/api
Quick reference for app flows
| Use case | Endpoint | Notes |
|---|---|---|
| Tournament deck view | POST /api/deck/resolve?detail=1 |
Body: {"decklist": {pokemon, trainer, energy}}. Returns full card data (attacks, abilities, copy_stats). |
| Card search (list) | GET /api/cards/search?name=... |
Returns card_id, name, image_url, is_legal_now, legality_status, supertype. |
| Card detail (on tap) | GET /api/cards/detail/{card_id} |
Full info: attacks, abilities, hp, copy_stats, tags, etc. |
| Batch card fetch | GET /api/cards/query?ids=id1,id2,... |
Up to 500 IDs. Returns full card data with copy_stats. |
| Deck synergy check | POST /api/deck/analyze |
Body: {"ids": ["card_id", ...]}. Returns synergy_warnings. |
| Deck suggestions | POST /api/deck/suggest |
Body: {"ids": [...], "limit": 10}. Returns synergy_score, synergy_partners. |
| Meta decks + skeleton | GET /api/meta/analysis?range=30d |
Skeleton cards include image_url. No legacy format. |
| Popular cards (home) | GET /api/cards/hot |
Top 150 cards with full data + copy_stats. |
Services
Cards
/api/cards/ — Search, detail, batch query, hot cache. Copy stats (pct_1–pct_4) on detail, query, hot.
Deck
/api/deck/ — Resolve tournament decklist, analyze synergies, suggest cards.
Meta
/api/meta/ — Top meta decks with win rate, usage %, top 8s, skeleton (60 cards with image_url).
Tournaments
/api/tournaments/ — Tournament list, standings, decklists. Use deck/resolve for display.
Staple / Hot
/api/staple/ — Top 150 most used cards from tournament decklists.
Health
/api/health/ — Health check.
Copy stats (1–4 only)
Cards include copy_stats when built (weekly). Percentages are among decks that use the card. pct_1 + pct_2 + pct_3 + pct_4 = 100. decks_with_card is omitted from SQL on older DBs and returned as 0 until migration 008 is applied.
{
"copy_stats": {
"pct_1": 5.2,
"pct_2": 82.3,
"pct_3": 0,
"pct_4": 0,
"total_decks": 491959,
"decks_with_card": 1247
}
}