Random Data Generator
REST API


Random Data Generator REST API produces fictional - yet realistic - personal data on demand. Returned data is always random within its class. The API supports a variety of services: locations, names, dates, numbers, social security numbers, credit card numbers. The API can be used as a personal data generator in application development. Please consult the Roadmap page for planned release dates of new services.

Example POST request to the Random Data API's Location endpoint:

{
 "headers": {
  "auth": "51349d7defd9351ac",
  "Content-Type": "application/json"
 },
 "body": {
  "region": "uk",
  "records": 1
 }
}

(Click Send again for a different response)
Example response:

SUPPORTED API MANAGERS

POSTMAN
Import the collection from the Postman client or read the documentation and run the API in Postman.

GENERAL API DOCUMENTATION

Authentication & Quota
To start using the app, you need to register with your email and get your unique authorization token. The token has to be included in all your REST requests. For a start every registered user gets 10,000 free requests.

Headers
Make sure to include the content type and the authentication token it in your request headers:

{
 "headers": {
  "auth": "[your token]" ,
  "Content-Type": "application/json"
 }
}

Methods Reference
GET METHODS:
Quota

POST METHODS:
Integer, Double, Number, First Name, Last Name, Location, National Insurance Number, Social Security Number, Numéro de Sécurité Sociale, Internal Russian Passport - Паспорт гражданина Российской Федерации, Credit Card Number, Date, Date & Time, Time

SUPPORTED REGIONS

About Regions
Some methoods, such as Names and Locations support localized responses. The region has to be specified in the request body.
AVAILABLE REGIONS:
United Kingdom, United States, France, Germany, Russia

UK
Country code: "uk"
The British dataset contains information from England, Scotland, Wales, and Nothern Ireland. The dataset includes more than 80,000 British names and over 50,000 last names. The National Insurance Numbers are generated based on the HMRC specification for the NIN numbers. The location dataset comprises of 1,257,440 individual addresses (a single address carries city, country, postcode), including ~1470 unique towns/cities.

US
Country code: "us"
The US dataset covers 160,000 surnames used across United States which correspond to 90% of the country's population. First names include 100,000 variations. The US location database includes ~20,000 unique incorporated locations as per census.gov (over 30,000 places if counting the postcodes). SSN numbers follow the SSA specification for Social Security Numbers.

FR
Country code: "fr"
The French dataset consists of ~20,0000 first names of each gender, and a selection of over 30,000 French surnames. The location dataset includes 35,000 places in France (mainland), represented as city and post code pairs. The Numéro de Sécurité Sociale numbers have been generated by following the INSEE specification for a valid NSS format.

DE
Country code: "de"
The German dataset is composed of ~20,000 first names (female and male together) and over 35,000 surnames. The location database hosts ~20,000 addresses, returned as postcode, city, and state.

RU
Country code: "ru"
The Russian dataset includes over 30,000 names of both genders, and more than 300,000 surnames, differentiated by gender. There are ~10,000 unique locations, each location identified by city, region, and postcode. You can retrieve internal passport numbers for the region. The IDs are generated following the MIA of Russia's specification for valid passport numbers.

GET METHODS

Quota
Endpoint: https://random.api.randomkey.io/v1/quota
A GET method for checking the request quota.

POST METHODS

Integer
Endpoint: https://random.api.randomkey.io/v1/int
Requires: min (int), max (int), records (int)
Returns: number (int)
A POST method for producing a random integer within the given range. Generates up to 10,000 records per request.

This is how an example request will look like:

{
 "min": 28,
 "max": 378,
 "records": 1
}


You will receive data in the following format:

{
 "number": [
  [
   223
  ]
 ]
}

Double
Endpoint: https://random.api.randomkey.io/v1/double
Requires: min (double), max (double), records (int)
Returns: number (int)
A POST method for producing a random double within the given range.

This is how an example request will look like:

{
 "min": -89.00,
 "max": 12.99,
 "records": 1
}


You will receive data in the following format:

{
 "number": [
  [
   5.07
  ]
 ]
}

Number
Endpoint: https://random.api.randomkey.io/v1/number
Requires: digits (int), records (int)
Returns: number (string)
A POST method for producing a random number of the specified length. Generates up to 10,000 records per request. The function produces leading zeros.

This is how an example request will look like:

{
 "digits": 9,
 "records": 1
}


You will receive data in the following format:

{
 "number": [
  [
   "005261992
  ]
 ]
}

First Name
Endpoint: https://random.api.randomkey.io/v1/name/first
Requires: gender (string), region (string), records (int)
Returns: name (string)
A POST method for producing a first name of the specified gender. Generates up to 10,000 records per request. The method is regional, i.e. the region has to be specified in the request's body. Consult the Supported Regions section for valid country codes.

Specify gender in the request as:
For female, use: "f"
For male, use: "m"

This is how an example request will look like:

{
 "region": "us",
 "gender": "f",
 "records": 1
}


You will receive data in the following format:

{
 "name": [
  [
   "Muriel"
  ]
 ]
}

Last Name
Endpoint: https://random.api.randomkey.io/v1/name/last
Requires: gender (string), region (string), records (int)
Returns: name (string)
A POST method for producing a last name. Generates up to 10,000 records per request. The method is regional, i.e. the region has to be specified in the request's body. Consult the Supported Regions section for valid country codes.

Specify gender in the request as:
For N/A, use: "0"
For female, use: "f"
For male, use: "m"

This is how an example request will look like:

{
 "region": "uk",
 "gender": "0",
 "records": 1
}


You will receive data in the following format:

{
 "name": [
  [
   "O'Brien"
  ]
 ]
}

Location
Endpoint: https://random.api.randomkey.io/v1/location
Requires: region (string), records (int)
Returns: city (string), admin (string), zip (string)
A POST method for producing an address. Generates up to 10,000 records per request. The method is regional, i.e. the region has to be specified in the request's body. Consult the Supported Regions section for valid country codes.

This is how an example request will look like:

{
 "region": "us",
 "records": 1
}


You will receive data in the following format:

{
 "location": [
  [
   "Santa Fe",
   "Texas",
   "77517"
  ]
 ]
}

National Insurance Number
Endpoint: https://random.api.randomkey.io/v1/id/nin
Requires: records (int)/a>
Returns: id (string)
A POST method for producing random British National Insurance Numbers. Generates up to 10,000 records per request. The NIN numbers have been generated by following the HMRC specification for a valid NIN format.

This is how an example request will look like:

{
 "records": 1
}


You will receive data in the following format:

{
 "id": [
  [
   "JA908605C"
  ]
 ]
}

Social Security Number
Endpoint: https://random.api.randomkey.io/v1/id/ssn
Requires: records (int)
Returns: id (string)
A POST method for producing random Social Security Numbers. Generates up to 10,000 records per request. The SSN numbers have been generated by following the SSA specification for a valid SSN format.

This is how an example request will look like:

{
 "records": 1
}


You will receive data in the following format:

{
 "id": [
  [
   "541856759"
  ]
 ]
}

Numéro de Sécurité Sociale
Endpoint: https://random.api.randomkey.io/v1/id/nss
Requires: gender (string), records (int)
Returns: id (string), dob (string)
A POST method for producing random French social security number, i.e. numéro de sécurité sociale. Generates up to 10,000 records per request. The method returns a Date of Birth based on the information derived from the NSS. The NSS numbers have been generated by following the INSEE specification for a valid NSS format. You can specify the gender in the request:
For a female NSS, use: "f"
For a male NSS, use: "m"
For a random NSS, use: "0"

This is how an example request will look like:

{
 "gender": "f",
 "records": 1
}


You will receive data in the following format:

{
 "id": [
  [
   "287093138175228",
   "10/09/87"
  ]
 ]
}

Internal Russian Passport
Endpoint: https://random.api.randomkey.io/v1/id/irp
Requires: records (int)
Returns: id (string)
A POST method for producing random internal Russian passport number, i.e. Паспорт гражданина Российской Федерации. The numbers have been generated by following the MIA of Russia's specification for valid passport numbers.

This is how an example request will look like:

{
 "records": 1
}


You will receive data in the following format:

{
 "id": [
  [
   "2460274745"
  ]
 ]
}

Credit Card Number
Endpoint: https://random.api.randomkey.io/v1/ccn
Requires: records (int)
Returns: ccn (int), brand (string), digits (int)
A POST method for producing random Payment Card Numbers. Generates up to 10,000 records per request. The pool of supported IIN's includes the biggest financial institutions issuing credit and debit cards: American Express, Diners Club, China UnionPay, VISA, MasterCard, Maestro, and Discover. The PANs generated follow the structure supported by their vendor, e.g. American Express have exactly 15 digits. The number passes the Luhn check and carries the Luhn digit.

This is how an example request will look like:

{
 "records": 1
}


You will receive data in the following format:

{
 "ccn": [
  [
   "3905960920701157418",
   "Discover",
   19
  ]
 ]
}

Date
Endpoint: https://random.api.randomkey.io/v1/date
Requires: min (string), max (string), format (string), records (int)
Returns: date (string)
A POST method for producing a random date within the given range and in the format specified. Generates up to 10,000 records per request. The format has to match that of the provided range. The function accepts strftime() and strptime() format codes. The full list of available date format codes can be found in the Python documentation.

This is how an example request will look like:

{
 "min": "10-Jul-2010",
 "max": "10-Aug-2012",
 "format": "%d-%b-%Y",
 "records": 1
}


You will receive data in the following format:

{
 "date": [
  [
   "04-May-2011"
  ]
 ]
}

Datetime
Endpoint: https://random.api.randomkey.io/v1/datetime
Requires: min (string), max (string), format (string), records (int)
Returns: datetime (string)
A POST method for producing a random date and time within the given range and in the format specified. Generates up to 10,000 records per request. The format has to match that of the provided range. The function accepts strftime() and strptime() format codes. The format has to match that of the provided range. The full list of available date format codes can be found in the Python documentation.

This is how an example request will look like:

{
 "min": "10/Jul/2010 10:00",
 "max": "10/Aug/2012 12:00",
 "format": "%d/%b/%Y %I:%M",
 "records": 1
}


You will receive data in the following format:

{
 "datetime": [
  [
   "12/Aug/2010 04:30"
  ]
 ]
}

Time
Endpoint: https://random.api.randomkey.io/v1/time
Requires: min (string), max (string), format (string), records (int)
Returns: time (string)
A POST method for producing random time within the given range and in the format specified. Generates up to 10,000 records per request. The format has to match that of the provided range. The function accepts strftime() and strptime() format codes. The format has to match that of the provided range. The full list of available date format codes can be found in the Python documentation.

This is how an example request will look like:

{
 "min": "10:00",
 "max": "12:00",
 "format": "%I:%M"
}


You will receive data in the following format:

{
 "time": [
  [
   "11:21"
  ]
 ]
}