dummyapi
👤

Users

9 endpoints

200 realistic user profiles — including address, company info, bank details, and more — great for testing user-driven UIs.

Base URLhttps://dummyapi.codesmash.in/api
GET

Get all users. Supports ?limit=30&skip=0&sortBy=age&order=desc.

🔗

GET https://dummyapi.codesmash.in/api/users

?limit?skip?sortBy?order?delay
fetch('https://dummyapi.codesmash.in/api/users')
.then(res => res.json())
.then(console.log);
ℹ️
Pagination — By default you will get 30 items. Use ?limit and ?skip to paginate through all items. Max limit is 200.
?limit=10Number of items to return (default: 30, max: 200)
?skip=10Number of items to skip (default: 0)
// By default you get 30 items
fetch('https://dummyapi.codesmash.in/api/users?limit=10&skip=0')
.then(res => res.json())
.then(console.log);
// Get next page (items 11–20)
fetch('https://dummyapi.codesmash.in/api/users?limit=10&skip=10')
.then(res => res.json())
.then(console.log);
// Get ALL 200 at once
fetch('https://dummyapi.codesmash.in/api/users?limit=200')
.then(res => res.json())
.then(console.log);
GET

Get a single user by ID.

🔗

GET https://dummyapi.codesmash.in/api/users/:id

fetch('https://dummyapi.codesmash.in/api/users/:id')
.then(res => res.json())
.then(console.log);
GET

Get all posts by a user.

🔗

GET https://dummyapi.codesmash.in/api/users/:id/posts

fetch('https://dummyapi.codesmash.in/api/users/:id/posts')
.then(res => res.json())
.then(console.log);
GET

Get all carts of a user.

🔗

GET https://dummyapi.codesmash.in/api/users/:id/carts

fetch('https://dummyapi.codesmash.in/api/users/:id/carts')
.then(res => res.json())
.then(console.log);
GET

Get all todos by a user.

🔗

GET https://dummyapi.codesmash.in/api/users/:id/todos

fetch('https://dummyapi.codesmash.in/api/users/:id/todos')
.then(res => res.json())
.then(console.log);
POST

Create a new user (demo).

🔗

POST https://dummyapi.codesmash.in/api/users

fetch('https://dummyapi.codesmash.in/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"firstName":"John","lastName":"Doe","email":"john@example.com"})
})
.then(res => res.json())
.then(console.log);
PUT

Update a user.

🔗

PUT https://dummyapi.codesmash.in/api/users/:id

fetch('https://dummyapi.codesmash.in/api/users/:id', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
DELETE

Delete a user (soft delete).

🔗

DELETE https://dummyapi.codesmash.in/api/users/:id

fetch('https://dummyapi.codesmash.in/api/users/:id', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
Buy me a coffee