POST /api/v1/generate
Send a JSON body with Content-Type: application/json. This example generates integers.
| Parameter | Description |
|---|---|
tool | Generator name. Use integers for whole numbers. |
input.min / input.max | Inclusive bounds from −10¹² to 10¹². Defaults: 1 and 100. |
input.count | 1–10,000. Default: 1. |
input.unique | Set true to sample without replacement. Default: false. |
input.sort | Set true for ascending order. Default: generation order. |
locale | Optional. With a locale, the response includes formatted. en, ru, zh-TW, zh-CN, hi, ja, ko, es |
curl
curl -X POST "https://randomkit.tech/api/v1/generate" -H "Content-Type: application/json" -d '{"tool":"integers","locale":"en","input":{"min":1,"max":100,"count":5,"unique":true,"sort":true}}'fetch
const response = await fetch('/api/v1/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"tool":"integers","locale":"en","input":{"min":1,"max":100,"count":5,"unique":true,"sort":true}})
})
const data = await response.json()
if (!response.ok) throw new Error(data.error)
console.log(data.values, data.formatted)
console.log(response.headers.get('RateLimit-Remaining'))Response and quota
Successful responses contain tool and values. With locale, they also include locale, label and formatted. Formatted integers have number and text fields.
RateLimit-Limit— daily limitRateLimit-Remaining— requests remaining after this callRateLimit-Reset— Unix timestamp of the reset, in seconds
400: invalid request. 429: quota exhausted, with Retry-After in seconds. 503: quota service unavailable. Requests rejected with 400 also count toward the quota.
Verifiable draws and Seed
Use the browser tools for Seed and drand. On the draw page you can select a winner and download a JSON proof. Open verifiable draw