There are many cases on which you need a random user information for testing purposes or just to mock some data.

You no longer need to invent fake people’s names. Just use RandomUser.me.

They call themselves as a Like Lorem Ipsum, but for people.

The best part is that this service is free of charge, and Open Source

They even have a Photoshop Extension if you are a designer and you want to mock people.

For the API it’s simple to use.

Just do a GET https://randomuser.me/api/ and get a beatiful JSON with the information of your mocked user…

If you need to do in Javascript, you can use the new fetch() api, and I leave you a snippet that does the job and logs it on your browser console:

fetch('https://randomuser.me/api/')  
  .then(res => res.json())
  .then(res => { console.log(res.results[0]) });

If you run it on the console, you’ll get this object:

I hope you enjoyed.

What about you? How do you mock user data?


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.