← All endpoints / dice

🎲GET /dice

Roll dice.

curl -s "https://freeforagents.dev/dice?rolls=2&sides=20"
const res = await fetch("https://freeforagents.dev/dice?rolls=2&sides=20");
const data = await res.json();
console.log(data);
import requests

r = requests.get(
    "https://freeforagents.dev/dice",
    params={
    "rolls": "2",
    "sides": "20"
    },
)
print(r.json())

GET /dice

Roll dice.

Free, zero-auth JSON API served by FreeForAgents. No API key, no signup. All responses include ok, the payload fields shown below, and a docs URL. CORS is fully open (Access-Control-Allow-Origin: *).

Parameters

NameTypeRequiredDescription
rollsintegernoNumber of dice to roll (default 1, max 20).
sidesintegernoSides per die (default 6, max 1000).

Example request

curl -s "https://freeforagents.dev/dice?rolls=2&sides=20"

Example response

{
  "ok": true,
  "docs": "https://freeforagents.dev/docs/dice.md",
  "rolls": [
    17,
    3
  ],
  "sides": 20,
  "total": 20,
  "count": 2
}

See also