Public APIs
Deck of Cards favicon

Deck of Cards

Games & Comics

Deck of Cards.

Deck of Cards's website screenshot

About Deck of Cards

Deck of Cards API is a web API for creating and manipulating standard 52-card decks programmatically. It supports creating new or shuffled decks (with an optional deck_count parameter for multi-deck use, and an optional jokers_enabled parameter to include jokers), drawing a specified number of cards, reshuffling remaining cards, and building partial decks from a specified list of card codes. Each deck is tracked by a deck_id, and decks are discarded if unused for two weeks.

The API also supports piles: named groupings of cards that can be created on the fly for purposes such as discards or player hands. Cards can be added to piles, listed, shuffled, drawn from the top, bottom, or at random, and returned to the main deck or between piles. Responses are returned in JSON and include card data such as code, value, suit, and image URLs (PNG and SVG) for each card, plus a back-of-card image endpoint.

This API is suited for developers building card game applications or simulations, such as blackjack or other games requiring deck and hand management, who need a backend to handle deck state, shuffling, and card draws without implementing that logic themselves.

Key features

  • Shuffle and draw from single or multiple decks (deck_count parameter)
  • Draw cards by count directly from a new or existing deck
  • Reshuffle full or remaining cards in a deck
  • Create partial decks with specific card codes
  • Manage named piles for hands, discards, or other groupings with add, shuffle, list, and draw (top, bottom, or random)
  • Return drawn cards or pile cards back to the main deck

Frequently asked questions

Is this API free to use?

The page does not mention any pricing or paid tiers, and all documented endpoints are presented as free, open API calls.

What data formats does the API return?

All responses are JSON, including card images available as both PNG and SVG.

How long are decks stored before they expire?

A deck's ID is discarded after two weeks if no actions have been performed on it.

Does the API support multiple decks at once?

Yes, the deck_count parameter lets you combine multiple decks, though pile operations do not work with multiple decks.

Who is this API for?

It is aimed at developers building card games such as blackjack who need shuffling, drawing, and pile management functionality.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product