Documentation for the Random User Generator API

Follow us @randomapi


In August 2013, we set out with a goal to create a free and easy to use service to generate random user data for application testing.

How to use

You can use AJAX to call the Random User Generator API and will receive a randomly generated user in return. If you are using jQuery, you can use the $.ajax() function in the code snippet below to get started.

  url: '',
  dataType: 'json',
  success: function(data) {


The API will provide you with a formatted object of your choice that you can parse and apply to your application.

JSON is the default format. You can request a different format using the format parameter.

  "results": [
      "gender": "male",
      "name": {
        "title": "mr",
        "first": "brad",
        "last": "gibson"
      "location": {
        "street": "9278 new road",
        "city": "kilcoole",
        "state": "waterford",
        "postcode": "93027",
        "coordinates": {
          "latitude": "20.9267",
          "longitude": "-7.9310"
        "timezone": {
          "offset": "-3:30",
          "description": "Newfoundland"
      "email": "[email protected]",
      "login": {
        "uuid": "155e77ee-ba6d-486f-95ce-0e0c0fb4b919",
        "username": "silverswan131",
        "password": "firewall",
        "salt": "TQA1Gz7x",
        "md5": "dc523cb313b63dfe5be2140b0c05b3bc",
        "sha1": "7a4aa07d1bedcc6bcf4b7f8856643492c191540d",
        "sha256": "74364e96174afa7d17ee52dd2c9c7a4651fe1254f471a78bda0190135dcd3480"
      "dob": {
        "date": "1993-07-20T09:44:18.674Z",
        "age": 26
      "registered": {
        "date": "2002-05-21T10:59:49.966Z",
        "age": 17
      "phone": "011-962-7516",
      "cell": "081-454-0666",
      "id": {
        "name": "PPS",
        "value": "0390511T"
      "picture": {
        "large": "",
        "medium": "",
        "thumbnail": ""
      "nat": "IE"
  "info": {
    "seed": "fea8be3e64777240",
    "results": 1,
    "page": 1,
    "version": "1.3"

API Errors

If our API service is offline or if we are experiencing server issues, we'll return a simple JSON object with an error.

  error: "Uh oh, something has gone wrong. Please tweet us @randomapi about the issue. Thank you."

Requesting Multiple Users

Random User Generator allows you to fetch up to 5,000 generated users in one request using the results parameter.

Specifying a gender

You can specify whether you would like to have only male or only female users generated by adding the gender parameter to your request. Valid values for the gender parameter are "male" or "female", or you may leave the parameter blank. Any other value will cause the service to return both male and female users.


By default, passwords are chosen randomly from a list of ~10k top used passwords. Starting with version 1.1, you can have more control over how passwords are generated using the password option.,lower,1-16

The example above would generate a password consisting of uppercase and lowercase characters ranging between 1 to 16 characters long.

You can specify options for the passwords using this format:,MIN_LENGTH-MAX_LENGTH

You can mix and match the charsets below for the CHARSETS option above:

lower      abcdefghijklmnopqrstuvwxyz
number     0123456789

MIN_LENGTH and MAX_LENGTH are the min/max length of the passwords that you want to generate.
By default, passwords will be between 8 - 64 characters long.

Here are some more examples of password option combinations:

// Special chars exactly 32 characters long,32

// Uppercase chars between 1 to 8 characters long,1-8

// Special, uppercase, lowercase, and numeric chars between the default 8 to 64 characters long,upper,lower,number


Seeds allow you to always generate the same set of users. For example, the seed "foobar" will always return results for Becky Sims (for version 1.0). Seeds can be any string or sequence of characters.


We currently offer the following data formats:

Just specify the format you would like returned by using the format parameter.

Using previous versions

When we release a new version the API, it could possibly break your application. By accessing the API via:

The result that is returned automatically uses the latest version of the API.
If you want to access a specific version of the API that won't be affected by updates, do this:


You can request a different nationality of a randomuser.

Pictures won't be affected by this, but data such as location, cell/home phone, id, etc. will be more appropriate.

Currently, randomuser offers these nationalities:

You can specify a nationality like so:

Randomuser will return random nats by default. You can have some control with the nats that you'd like to have generated by specifying a comma seperated list:,dk,fr,gb


You can request multiple pages of a seed with the page parameter.
Make sure that you use the same seed and page number (1 based index) in order to get back the same results

Including/Excluding fields

Sometimes, maybe you want some random names and not extraneous data such as location, phone, etc.
Using the inc and exc parameters, you can specify which fields to include or exclude respectively.

By specifying only the fields you want, the generator can save time by skipping CPU intensive fields like "login" for example.

These parameters accept the following values in a comma delimited list

If you only wanted the names,genders,and nats of users:,name,nat

If you want everything except for login data:


Some extra parameters that you can add to a request.

If you find a mistake with an API or would like to contribute to our database, feel free to visit our Github Repo. We'd really appreciate it :)