randstr

API

Copy a curl, ship a secret.

GET /api/randstr is unchanged for current clients. New query params add presets, exports, and an explicit browser-only flag. The API needs a free account and a Sanctum bearer token from the dashboard.

Token

curl -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  'https://randstr.com/api/randstr?type=hex&length=32&symbols_count=0'

Preset

Omit the other fields and the preset fills type, length, charset, and prefix on the server.

curl -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  'https://randstr.com/api/randstr?preset=api_key'

UUID

curl -H 'Authorization: Bearer YOUR_TOKEN' \
  'https://randstr.com/api/randstr?type=uuid&version=7&uppercase=0&no_hyphens=0&braces=0'

Bulk export Pro

format is json (default, Free), csv, sql, or env. Free requests above the plan limit return 402 with upgrade: true and the message Unlock API + bulk. Pro is 1 request per second. Super is 3 requests per second, 100 strings per request, and length up to 1024.

curl -H 'Authorization: Bearer YOUR_TOKEN' \
  'https://randstr.com/api/randstr?preset=jwt&count=10&format=csv'

Browser-only flag

browser_only=1 tells the server not to generate. The response has an empty results array. The home page does this locally with Web Crypto and does not send the secret at all. SSH pairs are not available in that mode.

curl -H 'Authorization: Bearer YOUR_TOKEN' \
  'https://randstr.com/api/randstr?browser_only=1&type=hex&length=32'

Preset catalog

curl 'https://randstr.com/api/presets'

Parameters