RANDOM

Dice Roll API

GET/dice

Roll a six-sided die with a simple HTTP GET request.

No signup or API key required.

Parameters

countintegeroptional · query
Number of rolls, from 1 to 100. Omit for one result. Supplying count, including count=1, returns results and a total.
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. Its structure depends on whether count is supplied, including count=1.

resultinteger
One roll from 1 through 6. Present only without count.
sidesinteger
Always 6. Present only with count.
resultsarray<integer>
Individual rolls, each from 1 through 6. Length equals count. Present only with count.
totalinteger
Sum of results. Present only with count.

Plain text

With format=text: One roll. With count, a comma-separated list without sides or total.

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

Use count=1..100 to roll multiple dice. With count, the response contains sides, results, and total.

Build a board-game prototype or a dice widget. A single roll returns result; requesting a count adds an array of rolls and their total.

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 ↗