Deck of Cards API
Server-side playing-card deck: shuffle, draw, and manage piles with persistent deck IDs. Removes the need to model card state yourself when building a card game demo.
🟢 Online · 97 ms
100%
Unlimited, no key, no credit card
No key required
Is Deck of Cards API down right now?
No — Deck of Cards API was up at our last check (Sun, 06 Dec 2026 00:41 UTC): HTTP 200 in 97 ms. It answered 100% of our hourly checks over the last 30 days.
We check every tracked API hourly from Cloudflare's network; this page is rebuilt every few hours. For the value right now, query the public JSON API or the MCP server.
Free alternatives (live ranking)
- PokéAPI — 🟢 Online · Unlimited, no key, no credit card
- FreeToGame — 🟢 Online · Unlimited, no key, no credit card
- Scryfall — 🟢 Online · No key; courtesy limit of 10 requests/second, no credit card
Frequently Asked Questions
Does Deck of Cards API require an API key?
No, Deck of Cards API is freely accessible without registration or an API key.
What is Deck of Cards API's free tier?
Unlimited, no key, no credit card
Is Deck of Cards API down right now?
At our last check (Sun, 06 Dec 2026 00:41 UTC) Deck of Cards API was up, with HTTP 200 in 97 ms. We check it every hour, and it answered 100% of checks over the last 30 days.
Implementation notes
When to use Deck of Cards API
Deck of Cards API keeps a shuffled deck on the server and hands you a deck_id: draw from it, reshuffle it, move cards into named piles, and the server tracks what has been dealt. Each card comes back with a two-character code, a value, a suit and hosted PNG and SVG images, so a working blackjack or war prototype needs no card-modelling code and no image assets. deck_count combines several decks into a shoe, jokers are opt-in, and a partial deck can be built from an explicit card list for puzzles and teaching scenarios. No key, and CORS is open. Use it for card-game prototypes, for teaching stateful APIs and resource identifiers, and for chat bots that deal hands into a channel. Do not make it the authority in anything with stakes: the deck_id is the only credential, the service is a free community project, and decks are not kept forever. For a real game, shuffle and deal on your own server.
Common pitfalls
- Tens are coded 0, not 10. The ten of spades is 0S while its value field reads 10, so code that builds card codes from values, or looks up images by value, breaks on exactly four cards. Worse, an invalid code such as 10H passed to a pile call does not error — in our test the call returned success true and silently skipped that card.
- Overdrawing is not an HTTP error. Asking for more cards than remain returns HTTP 200 with success false, an empty cards array and an error message, so check success on every draw rather than relying on status codes. An unknown deck_id, by contrast, is a 404.
- /deck/new/ does not shuffle. The response says shuffled false and cards come off in factory order. Use /deck/new/shuffle/ or call /shuffle/ on the deck; adding remaining=true reshuffles only the undealt cards and leaves piles untouched.
- The deck_id works like a bearer token. Anyone holding it can draw from the deck, list piles or reshuffle, so in a multiplayer game a client that knows the id can peek at or take cards. Keep the id server-side and send each player only the cards they are allowed to see.
Quick start (bash)
DECK=$(curl -s 'https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1' | jq -r '.deck_id')
CARDS=$(curl -s "https://deckofcardsapi.com/api/deck/$DECK/draw/?count=2" | jq -r '[.cards[].code] | join(",")')
echo "$CARDS" # tens come back as 0S, 0H, 0D, 0C
# piles track dealt cards server-side
curl -s "https://deckofcardsapi.com/api/deck/$DECK/pile/player1/add/?cards=$CARDS" | jq '{success, remaining, piles}' Embed this badge
Add a live status badge to your README, docs, or website.
Markdown
[](https://freeapi.watch/deck-of-cards) HTML
<a href="https://freeapi.watch/deck-of-cards"><img src="https://api.freeapi.watch/badge/deck-of-cards.svg" alt="Deck of Cards API Status"/></a>