UUID Generator API
Generate up to 1,000 UUID v4, time-ordered UUID v7, ULID, Nano ID or random hex IDs per request. Secure randomness, optional uppercase.
The UUID API generates unique identifiers in the formats modern applications use. type=v4 (default) returns random RFC 4122 UUIDs, v7 returns time-ordered UUIDs whose first 48 bits are a millisecond timestamp (great as database primary keys because they sort by creation time), ulid returns 26-character Crockford base32 ULIDs, nanoid returns URL-safe Nano IDs and hex returns random hexadecimal strings.
Use count to get from 1 to 1,000 IDs in one call, size (4–64, default 21) to choose the length of Nano ID and hex IDs, and uppercase=true for upper-case output. All values come from a cryptographically secure random generator.
The response is a small JSON object with the type, the count and the ids array – easy to use from scripts, seeders and CI jobs that need fresh identifiers.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
type | query | string | no | v4 | v4, v7, ulid, nanoid or hex. |
count | query | number | no | 1 | Number of IDs, 1–1000. |
size | query | number | no | 21 | Length of nanoid and hex IDs, 4–64. |
uppercase | query | boolean | no | false | Return upper-case IDs. |
Example
curl "https://apibox.io.vn/v1/uuid?type=v7&count=2" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/uuid?type=v7&count=2', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/uuid?type=v7&count=2",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/uuid?type=v7&count=2');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"type": "v7",
"count": 2,
"ids": [
"01a1c3db-75cb-79dc-9577-3e0e9b396b1c",
"01a1c3db-75cb-7239-a4a1-a944d53b7c02"
]
}
Use cases
- Generate primary keys or idempotency keys outside the database
- Seed test databases and fixtures with realistic IDs
- Create sortable UUID v7 / ULID keys for event logs
- Get short URL-safe Nano IDs for invite codes and share links
FAQ
UUID v4 or UUID v7 – which should I use?
v4 is fully random. v7 starts with a timestamp, so new IDs sort after older ones; that keeps B-tree indexes compact and makes v7 a better choice for database primary keys.
How many UUIDs can I generate at once?
Up to 1,000 per request with count=1000. Each request counts as one call against your quota.
What is the difference between ULID and UUID v7?
Both are time-ordered and 128-bit. ULID is written as 26 base32 characters (e.g. 01J...), UUID v7 uses the standard 36-character hyphenated UUID format that databases have native types for.
Related APIs
Cron Expression Parser
Validate a cron expression and get its next run times in any timezone, with a plain-English description. Supports 5, 6 and 7-field cron syntax.
🕒Time & Timezone Converter
Get the current time in any timezone, convert between timezones and Unix timestamps (seconds or ms), with UTC offset and weekday for up to 30 zones.
🎨Color Converter
Convert colours between HEX, RGB, HSL and CMYK, check WCAG contrast ratios and get complementary, triadic, analogous colours and shades in one call.