Welcome to the Docs!
About
- Create dynamic user profiles on the fly with realistic personal details such as names, email addresses, usernames, and profile pictures, etc.., with Dummy User API.
- By leveraging the Dummy User API, you can streamline your development process, enhance user testing, and create more realistic and engaging experiences within your applications.
- Empower your team to iterate quickly and efficiently, all while delivering exceptional user experiences that reflect real-world scenarios.
- Base URL: https://dummyuser.vercel.app/
Data types for Typescript
{
id: number,
first_name: string,
last_name: string,
avatar: string,
date_of_birth: string,
age: number,
gender: string,
email: string,
Phone: string,
location: {
country: string,
city: string,
postal_code: number
},
user: {
username: string,
password: string,
userid: string
},
}
All Users
fetch('https://dummyuser.vercel.app/users')
.then((response) => response.json())
.then((json) => console.log(json));
view outputSingle User
fetch('https://dummyuser.vercel.app/users/1')
.then((response) => response.json())
.then((json) => console.log(json));
view outputFilter Users with single prop
fetch('https://dummyuser.vercel.app/users/q?first_name=Vanni')
.then((response) => response.json())
.then((json) => console.log(json));
view outputFilter Users with multiple props
fetch('https://dummyuser.vercel.app/users/q?ageGT=30&ageLT=40')
.then((response) => response.json())
.then((json) => console.log(json));
view outputAvailable Filters
Query Endpoint : 'https://dummyuser.vercel.app/users/q'
- first_name, last_name = q?first_name=name&last_name=name
- first_name = q?first_name=name
- last_name = q?last_name=name
- ageGT, ageLT = q?ageGT=age&ageLT=age
- ageGT = q?ageGT=age
- ageLT = q?ageLT=age
- country, city = q?country=name&city=name
- country = q?country=name
- city = q?city=name
Add user POST Method
fetch('https://dummyuser.vercel.app/users', {
method: 'POST',
body: JSON.stringify({
first_name: 'sam',
last_name: 'leo',
avatar:'avatar url',
data_of_birth: '01/01/2000',
age: 23,
gender: 'male',
email: 'samleo@me.com',
phone: '123456789',
location:{
country: 'india',
city: 'chennai',
postal_code: 123456
}
}),
headers: {
'Content-type': 'application/json',
},
})
.then((response) => response.json())
.then((json) => console.log(json));
Note: The resource will appear to be changed on the server but it won't be changed.
Update user PUT Method
fetch('https://dummyuser.vercel.app/users/1', {
method: 'PUT',
body: JSON.stringify({
first_name: 'sam',
last_name: 'leo',
avatar:'avatar url',
data_of_birth: '01/01/2000',
age: 23,
gender: 'male',
email: 'samleo@me.com',
phone: '123456789',
location:{
country: 'india',
city: 'chennai',
postal_code: 123456
}
}),
headers: {
'Content-type': 'application/json',
},
})
.then((response) => response.json())
.then((json) => console.log(json));
Note: The resource will appear to be changed on the server but it won't be changed.
Modify user PATCH Method
fetch('https://dummyuser.vercel.app/users/1', {
method: 'PATCH',
body: JSON.stringify({
data_of_birth: '01/01/1999',
age: 25,
phone: '1234512345'
}),
headers: {
'Content-type': 'application/json',
},
})
.then((response) => response.json())
.then((json) => console.log(json));
Note: The resource will appear to be changed on the server but it won't be changed.
Delete user DELETE Method
fetch('https://dummyuser.vercel.app/users/1', {
method: 'DELETE',
});
Note: The resource will appear to be changed on the server but it won't be changed.