Deck of Cards
Deck of Cards
- Authentication
- No auth
- HTTPS
- No
- CORS
- Unknown
- Category
- Games & Comics
- Documentation / URL
- http://deckofcardsapi.com/
Overview
The Deck of Cards API simulates a real deck of playing cards over HTTP: create a deck, shuffle it, draw cards, and manage piles — all keyless and stateless (deck state lives server-side under a deck_id). A classic for card-game prototypes, blackjack tutorials, and teaching HTTP state.
Quick Start
Create and shuffle a deck (verified live):
curl "https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1"
{"success": true, "deck_id": "7rl58j5kyh3e", "remaining": 52, "shuffled": true}
Draw 2 cards:
curl "https://deckofcardsapi.com/api/deck/7rl58j5kyh3e/draw/?count=2"
Draw from a partial deck (e.g. blackjack: two 10s + an ace):
curl "https://deckofcardsapi.com/api/deck/new/draw/?count=2&cards=AS,KD"
Reshuffle and keep the same deck:
curl "https://deckofcardsapi.com/api/deck/7rl58j5kyh3e/shuffle/"
Piles (deal into named hands):
curl "https://deckofcardsapi.com/api/deck/7rl58j5kyh3e/pile/player1/add/?cards=AS,KD"
curl "https://deckofcardsapi.com/api/deck/7rl58j5kyh3e/pile/player1/list/"
Card format
Each card looks like:
{
"code": "AS",
"image": "https://deckofcardsapi.com/static/img/AS.png",
"images": { "svg": "...", "png": "..." },
"value": "ACE",
"suit": "SPADES"
}
Codes: rank (A, 2-10, J, Q, K) + suit (S, H, D, C).
Authentication
None — keyless.
Rate Limits & Notes
- Free, no documented hard limit; deck state is held server-side for a while — don’t rely on it forever (create fresh decks for long-running games).
remainingin responses tracks undealt cards — use it for game logic.- Card images are hotlink-friendly (static PNG/SVG).
- HTTPS is supported — use it (the listing URL is http).
FAQ
Is Deck of Cards free? Yes — free, keyless.
Where is the deck state stored?
Server-side, keyed by deck_id. Keep the id and pass it in subsequent calls.
Can I build a card game with it? Yes — draw, piles, partial decks and reshuffle cover most card-game mechanics.
More in Games & Comics
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| AmiiboAPI Nintendo Amiibo Information | No auth | Yes | Yes | ↗ |
| Animal Crossing: New Horizons API for critters, fossils, art, music, furniture and villagers | No auth | Yes | Unknown | ↗ |
| Astroworld Free Minecraft data: mobs, biomes, items, enchantments, structures, commands, versions, achievements, trades | No auth | Yes | Yes | ↗ |
| Autochess VNG Rest Api for Autochess VNG | No auth | Yes | Yes | ↗ |
| Barter.VG Provides information about Game, DLC, Bundles, Giveaways, Trading | No auth | Yes | Yes | ↗ |