RANDOM

Random Playing Card API

GET/card

Draw a random rank and suit from a standard 52-card deck.

No signup or API key required.

Parameters

No endpoint-specific parameters. Use format to choose the response representation.

formatenumoptional ยท query
Response format. Defaults to json.
jsontext

No request body. Unknown or repeated query parameters return HTTP 400.

Returns 200 OK

A JSON object with the following fields.

rankstring
ace, 2 through 10, jack, queen, or king.
suitstring
clubs, diamonds, hearts, or spades. Draws are independent from a 52-card deck without jokers.

Plain text

With format=text: The rank and suit separated by " of ", such as queen of hearts.

Errors

Validation and service errors always return JSON, including when format=text.

errorstring
A machine-readable error code, such as invalid_parameter or rate_limited.
messagestring
A description of the problem.

400 Invalid parameters.

414 Query string exceeds 2048 characters.

429 Rate limit reached. Wait the seconds in Retry-After before retrying.

Usage notes

Standard deck without jokers. Ranks: ace, 2..10, jack, queen, king. Suits: clubs, diamonds, hearts, spades. Independent draws. Text: queen of hearts.

Build a card display or a probability demonstration. Draws are independent and cards are not removed from a shared deck, so consecutive requests can repeat.

Responses are not cached. Browser requests are supported through open CORS.

120 requests per minute per IP, with up to 30 per 10 seconds, shared across APIs. Limits are approximate per Cloudflare location. Full usage limits โ†—