TL;DR
The Short Id API generates compact, unique, URL-safe identifiers on demand. Perfect for creating short IDs for URLs, database keys, order numbers, referral codes, and any use case requiring a collision-resistant identifier. Supports configurable ID length and character set. Returns JSON with the generated ID. No API key required.
Quick start: https://idgen.example.com/api/generate
No API key needed — free ID generation!
How to Use This API
1. Generate a Short ID
Returns a unique 8-character URL-safe ID:
https://idgen.example.com/api/generate
2. Specify ID Length
https://idgen.example.com/api/generate?length=12
3. Custom Character Set
https://idgen.example.com/api/generate?length=6&charset=alphanumeric
4. JavaScript — Batch ID Generation
async function generateMany(count) {
const ids = [];
for (let i = 0; i < count; i++) {
const resp = await fetch('https://idgen.example.com/api/generate');
const data = await resp.json();
ids.push(data.id);
}
return ids;
}
generateMany(5).then(ids => {
console.log('Generated IDs:', ids);
});
5. Python — Create IDs for Database
import requests
# Generate IDs for new records
new_users = ['Alice', 'Bob', 'Charlie']
for user in new_users:
r = requests.get(
'https://idgen.example.com/api/generate',
params={'length': 10}
).json()
print(f"User: {user}, ID: {r['id']}")
Generate an ID:
https://idgen.example.com/api/generate
Frequently Asked Questions
- What characters are used in generated IDs?
- Default IDs use URL-safe characters (A-Z, a-z, 0-9, plus underscore and hyphen). No ambiguous characters like 'l', '1', 'O', or '0' by default to avoid confusion.
- How unique are the generated IDs?
- IDs are generated using cryptographically random sources. With 8-character alphanumeric IDs, there are 62^8 (over 218 trillion) possible combinations — collision risk is negligible.
- Can I specify the character set?
- Yes — most ID generation APIs support parameters for
charset(e.g.,alpha,alphanumeric,numeric,hex) andlength. - What's the typical use case for short IDs?
- URL shortener codes, referral codes, order numbers, database primary keys, session tokens, shareable links, and any context where you want human-readable unique identifiers.
- Is there a rate limit?
- The API is free for reasonable usage. If you need high-volume ID generation (millions), consider using a client-side library like
nanoidoruuidinstead. - Are the IDs time-sorted or random?
- IDs are randomly generated. They do not encode timestamps or sequential numbers. If you need time-sortable IDs, consider ULID or Snowflake-style ID generators.
API Details
- API URL
https://idgen.example.com/api/generate- Documentation
- github.com/aguedo/idgen
- Category
- Development
- Authentication
- Not Required
- Parameters
length(int),charset(string)
What You Can Build
- URL shortener generating compact, unique codes for each link
- Order ID system for e-commerce with human-readable references
- Referral code generator for user invite and marketing programs
- Session token generator for lightweight authentication
- Shareable link creator with user-friendly identifiers