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
lengthinteger, default 16. The longest string is 1024 characters (Super). Pro stops at 256. Free stops at 64.countinteger, default 1. The most strings in one request is 100 (Super). Pro stops at 50. Free stops at 5.typealpha, numeric, alnum, hex, base64, symbols, password, custom, uuid, app_key, totp, ssh, passphrase.presetuuid, api_key, app_key, postgres, jwt, ssh, totp, passphrase.symbols_countoptional. Omitted, it still defaults to 1 so older clients keep their behavior. Send 0 for a pure charset.prefix,suffix,charsetas before. Prefix and suffix are ignored for SSH and TOTP so the key and otpauth URI stay valid.version4 or 7, plus uppercase, no_hyphens, and braces for UUID.words,separatorfor passphrases. The word list is the EFF short list.formatjson, csv, sql, env.browser_only1 or 0.