freeapis

Deck of Cards

Deck of Cards

Authentication
No auth
HTTPS
No
CORS
Unknown
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).
  • remaining in 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

APIAuthHTTPSCORS
AmiiboAPI

Nintendo Amiibo Information

No authYesYes
Animal Crossing: New Horizons

API for critters, fossils, art, music, furniture and villagers

No authYesUnknown
Astroworld

Free Minecraft data: mobs, biomes, items, enchantments, structures, commands, versions, achievements, trades

No authYesYes
Autochess VNG

Rest Api for Autochess VNG

No authYesYes
Barter.VG

Provides information about Game, DLC, Bundles, Giveaways, Trading

No authYesYes