Users
Last updated 2026-05-20
Copy-ready user JSON with name, address, company, bank, and more. Search, filter, paginate, fetch the authenticated user, plus user carts, posts, and todos. Live REST endpoint at /users.
Users
fetch('https://jsonexamples.com/users')
.then(res => res.json())
.then(console.log);Response
{
"users": [
{
"id": 1,
"firstName": "Terry",
"lastName": "Medhurst",
"age": 50,
"email": "[email protected]",
"username": "atuny0",
"address": { "city": "Washington", "state": "DC" },
"company": { "name": "Blanda-O'Keefe", "department": "Marketing" }
// ...more fields
}
// 30 items
],
"total": 100,
"skip": 0,
"limit": 30
}/* providing token in bearer */
fetch('https://jsonexamples.com/user/me', {
method: 'GET',
headers: { 'Authorization': 'Bearer /* YOUR_TOKEN_HERE */' },
})
.then(res => res.json())
.then(console.log);Response
{
"id": 15,
"username": "kminchelle",
"email": "[email protected]",
"firstName": "Jeanne",
"lastName": "Halvorson"
// ...other user fields
}fetch('https://jsonexamples.com/users/1')
.then(res => res.json())
.then(console.log);Response
{
"id": 1,
"firstName": "Terry",
"lastName": "Medhurst",
"email": "[email protected]"
// ...complete user payload
}GET
Search users
fetch('https://jsonexamples.com/users/search?q=John')
.then(res => res.json())
.then(console.log);Response
{
"users": [
{ "id": 50, "firstName": "Johnathon", "lastName": "Predovic" }
],
"total": 1,
"skip": 0,
"limit": 1
}GET
Filter users
- Pass
key(nested keys via.) andvalueas query params. Both are case-sensitive. limit,skip, andselectalso work.
fetch('https://jsonexamples.com/users/filter?key=hair.color&value=Brown')
.then(res => res.json())
.then(console.log);Response
{
"users": [
{ "id": 9, "firstName": "Demetrius", "hair": { "color": "Brown" } }
],
"total": 26,
"skip": 0,
"limit": 26
}- Use
limitandskipfor pagination.limit=0returns all items. - Pass
selectwith comma-separated keys to trim the payload.
fetch('https://jsonexamples.com/users?limit=5&skip=10&select=firstName,age')
.then(res => res.json())
.then(console.log);Response
{
"users": [
{ "id": 11, "firstName": "Marcel", "age": 39 },
{ "id": 12, "firstName": "Assunta", "age": 42 }
],
"total": 100,
"skip": 10,
"limit": 5
}/* getting carts of user with id 5 */
fetch('https://jsonexamples.com/users/5/carts')
.then(res => res.json())
.then(console.log);Response
{
"carts": [
{ "id": 19, "userId": 5, "totalProducts": 5, "totalQuantity": 14 }
],
"total": 1,
"skip": 0,
"limit": 1
}/* getting posts of user with id 5 */
fetch('https://jsonexamples.com/users/5/posts')
.then(res => res.json())
.then(console.log);Response
{
"posts": [
{ "id": 17, "title": "She was in a hurry.", "userId": 5, "tags": ["french", "magical"] }
],
"total": 3,
"skip": 0,
"limit": 3
}/* getting todos of user with id 5 */
fetch('https://jsonexamples.com/users/5/todos')
.then(res => res.json())
.then(console.log);Response
{
"todos": [
{ "id": 19, "todo": "Create a compost pile", "completed": true, "userId": 5 }
],
"total": 3,
"skip": 0,
"limit": 3
}POST
Add a new user
- Adding a new user will not persist on the server.
- It simulates a POST and returns the newly created user with a fresh id.
fetch('https://jsonexamples.com/users/add', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
firstName: 'Muhammad',
lastName: 'Ovi',
age: 250,
/* other user data */
})
})
.then(res => res.json())
.then(console.log);Response
{
"id": 101,
"firstName": "Muhammad",
"lastName": "Ovi",
"age": 250
}- Updating a user will not persist on the server.
/* updating lastName of user with id 1 */
fetch('https://jsonexamples.com/users/1', {
method: 'PUT', /* or PATCH */
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ lastName: 'Owais' })
})
.then(res => res.json())
.then(console.log);Response
{
"id": "1",
"firstName": "Terry",
"lastName": "Owais"
}DELETE
Delete a user
- Deleting a user will not persist on the server.
fetch('https://jsonexamples.com/users/1', { method: 'DELETE' })
.then(res => res.json())
.then(console.log);Response
{
"id": 1,
"firstName": "Terry",
"isDeleted": true,
"deletedOn": /* ISOTime */
}