Random User API
Generate realistic random user data for testing, prototyping, and development. Free, no authentication required.
Introduction
The Random User API is a free RESTful endpoint that returns a randomly generated user object. It is built for developers who need realistic placeholder data for UI mockups, automated testing, and demos.
Each response contains a complete user profile: name, email, username, gender, location, and an avatar image URL — all assembled from a curated data pool.
Base URL
https://random-api-lite.vercel.app/api/usersAuthentication
This API is completely public. No API key, token, or header is required. Just send a GET request and receive a random user.
Endpoints
https://random-api-lite.vercel.app/api/usersQuery Parameters
All parameters are optional. When omitted, the API returns a fully random, unfiltered user.
genderstringoptionalFilter results by gender.
countrystringoptionalFilter results by country name.
Example Requests
https://random-api-lite.vercel.app?gender=MALEhttps://random-api-lite.vercel.app?country=Greecehttps://random-api-lite.vercel.app?gender=FEMALE&country=GermanyResponse Schema
The response body has the following structure:
| Field | Type | Description |
|---|---|---|
message | string | Status message |
status | number | HTTP status code |
randomUser.name | string | Full name (first + last) |
randomUser.email | string | Generated email address |
randomUser.username | string | Unique username |
randomUser.gender | string | "MALE" or "FEMALE" |
randomUser.location.city | string | City name |
randomUser.location.state | string | State or region |
randomUser.location.country | string | Country name |
randomUser.avatar | string | Avatar image URL |
Response Example
A successful request returns a 200 response:
{
"message": "Users fetched successfully",
"status": 200,
"randomUser": {
"name": "Eleanor Wilson",
"email": "eleanor.wilson@example.com",
"username": "eleanor.wilson490",
"gender": "FEMALE",
"location": {
"city": "Athens",
"state": "Prague",
"country": "Greece"
},
"avatar": "https://randomuser.me/api/portraits/women/14.jpg"
}
}Usage Examples
Copy-paste ready code for the most common integration patterns.
Basic Request
const res = await fetch(`${BASE_URL}/api/users`);
const data = await res.json();
console.log(data.randomUser.name);
// "Eleanor Wilson"With Query Parameters
const res = await fetch(`${BASE_URL}/api/users?gender=MALE&country=Greece`);
const data = await res.json();
console.log(data.randomUser);Full Example with Error Handling
async function getRandomUser(gender, country) {
const params = new URLSearchParams();
if (gender) params.set("gender", gender);
if (country) params.set("country", country);
const res = await fetch(`${BASE_URL}/api/users?${params}`);
if (!res.ok) {
throw new Error(`HTTP ${res.status}`);
}
const { randomUser } = await res.json();
return randomUser;
}
// Usage
const user = await getRandomUser("MALE", "Greece");
console.log(user.name, user.email);Error Handling
The API uses standard HTTP status codes. On failure, the response includes an error field.
| Status | Meaning |
|---|---|
| 200 | Success — user returned |
| 400 | Bad request — invalid parameters |
| 500 | Internal server error |
{
"error": "Internal server error"
}FAQ
Is this API free?
Can I use this in production?
How unique are the generated users?
Random Products API
Generate realistic random product data for e-commerce testing, prototyping, and development. Free, no authentication required.
Introduction
The Random Products API is a free RESTful endpoint that returns randomly generated product objects. It is built for developers who need realistic placeholder data for e-commerce UI mockups, automated testing, and demos.
Each response contains a complete product: name, description, price, category, and a photo URL — all assembled from a curated product pool.
Base URL
https://random-api-lite.vercel.app/api/productsAuthentication
This API is completely public. No API key, token, or header is required. Just send a GET request and receive random products.
Endpoints
https://random-api-lite.vercel.app/api/productsQuery Parameters
All parameters are optional. When omitted, the API returns all available products.
limitnumberoptionalLimit the number of products returned.
Example Requests
https://random-api-lite.vercel.app/api/productshttps://random-api-lite.vercel.app/api/products?limit=3https://random-api-lite.vercel.app/api/products?limit=10Response Schema
The response body has the following structure:
| Field | Type | Description |
|---|---|---|
message | string | Status message |
status | number | HTTP status code |
count | number | Number of products returned |
products[].id | number | Unique product identifier |
products[].name | string | Product name |
products[].description | string | Product description |
products[].price | number | Product price |
products[].category | string | Product category |
products[].photo | string | Product photo URL |
products[].createdAt | string | Creation timestamp |
products[].updatedAt | string | Last update timestamp |
Response Example
A successful request returns a 200 response:
{
"message": "Products fetched successfully",
"status": 200,
"count": 1,
"products": [
{
"id": 1,
"name": "Wireless Mouse",
"description": "Ergonomic wireless mouse with adjustable DPI",
"price": 29.99,
"category": "Electronics",
"photo": "https://example.com/mouse.jpg",
"createdAt": "2026-07-12T00:00:00.000Z",
"updatedAt": "2026-07-12T00:00:00.000Z"
}
]
}Usage Examples
Copy-paste ready code for the most common integration patterns.
Basic Request
const res = await fetch(`${BASE_URL}/api/products`);
const data = await res.json();
console.log(data.products[0].name);
// "Wireless Mouse"With Limit Parameter
const res = await fetch(`${BASE_URL}/api/products?limit=5`);
const data = await res.json();
console.log(data.count);
// 5Full Example with Error Handling
async function getProducts(limit) {
const params = new URLSearchParams();
if (limit) params.set("limit", limit);
const res = await fetch(`${BASE_URL}/api/products?${params}`);
if (!res.ok) {
throw new Error(`HTTP ${res.status}`);
}
const { products } = await res.json();
return products;
}
// Usage
const products = await getProducts(3);
console.log(products[0].name, products[0].price);Error Handling
The API uses standard HTTP status codes. On failure, the response includes an error field.
| Status | Meaning |
|---|---|
| 200 | Success — products returned |
| 400 | Bad request — invalid limit parameter |
| 500 | Internal server error |
{
"error": "Invalid limit. Must be a positive integer."
}