: Draw cards from a pile

API: deckofcardsapi.com:deck-of-cards
Endpoint: /deck/{deck_id}/pile/{pile_name}/draw/
Response format: application/json
Auth: unknown
Method: GET
Last Status: 404
Latency: 498ms

Description

Returns cards drawn from a specific pile along with the pile's remaining count. Use this to deal from a subset of cards that were set aside into a pile.

From spec: Draws cards from a specific pile by count or specific cards

Usage Tips

- Optional query parameter `count` specifies how many cards to draw (default: 1) - Returns empty cards array if pile is empty - Use `cards` query param to draw specific cards by code (e.g., cards=AS,KH)

Parameters (4)

cards (string, query, optional)

Specific card codes to draw (e.g., AS,2S)

count (integer, query, optional)

Number of cards to draw from pile

Constraints: {'minimum': 1}

deck_id (string, path, required)

The deck ID

pile_name (string, path, required)

Name of the pile

Examples (1)

Draw 1 card from the player1 pile probe-gate

Demonstrates drawing a specific number of cards from a named pile rather than the main deck

curl 'https://deckofcardsapi.com/api/deck/wa025949x0ez/pile/player1/draw/?count=1'
import requests

resp = requests.get(
    "https://deckofcardsapi.com/api/deck/wa025949x0ez/pile/player1/draw/",
    params={
        'count': '1',
    },
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("deckofcardsapi")
result = api.fetch("deck/{deck_id}/pile/{pile_name}/draw/", count=1)

for item in result:
    print(item)
const resp = await fetch("https://deckofcardsapi.com/api/deck/wa025949x0ez/pile/player1/draw/?count=1");
const data = await resp.json();

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-04-16 02:06:11.239940 404 498ms
2026-04-15 00:19:02.700397 404 272ms
2026-04-14 01:08:32.281538 404 249ms
2026-04-12 13:30:13.671864 404 483ms
2026-04-10 01:53:10.759937 404 277ms
2026-04-09 03:08:19.737121 404 504ms