Automated Programming Interface

You too can use randomdata.sh to generate random numbers for your own application.

Protocol

The current version of randomdata.sh protocol is v1

All queries will receive a JSON answer and use HTTPS for a secure transport layer. All requests must be made by using the GET method (POST isn’t supported yet).

The domain is accessible at api.randomdata.sh/v1

Fair use of our API

Please read this very carefully

To ensure a fair use of our services, you need to respect a few rules. Failure to respect them will result in ban.

Every time you use the generator to generate random data it needs to take random bytes from the entropy pool. By default everyone has a quota of 1 000 000 bytes every days. You can check your quota on the statistic page.

Try to group your requests (it’s better to send one request to download 100 numbers rather than 10 small requests of 10 numbers).

Don’t send multiple parallel requests, if you use a multi-threaded client make sure it serializes the requests.

Object returned by the generator

The generator will return a JSON object with the following values

"RDID":      (mandatory)   string      Contain an unique id used to identify the request
                                       (If you encounter any bugs, please include it in the bug report)
-
"INFO":      (optional)    string      Contain info regarding what happened mainly when an error occurred
-
"STATUS"     (mandatory)   string      ERROR if something went wrong, SUCCESS if everything went well
-
"DATA"       (optional)    array       An array containing your random numbers in the desired format
-
"QUOTA"      (mandatory)   int         By default you can use 1 000 000 random bytes every days.
                                       This value show how many you can use for the current day.
                                       Quotas are reset automatically at midnight UTC.
-
"EXTRA"      (optional)    int         Reserved for future usage
-
"BYTE_USED"  (mandatory)   int         Indicate how many raw bytes where used to process your query

Methods

For readability all methods are written in camelCase. However the generator ignore the case.

Here is a list of all methods provided by the API and their parameters

getQuota

Return your daily quota

Example

query: https://api.randomdata.sh/v1/?method=getquota
json response:
{"QUOTA": 985436, "RDID": "rd.shv1#9uE1PeGreWAY", "STATUS": "success"}

getInt

Return an array of integers in the defined range

n:    amount of number (can't excess 1000)
min:  lower boundary   (can't be upper than -16000)
max:  maximum boundary (can't be lower than -16000 and is not included in the values)

Example

query: https://api.randomdata.sh/v1/?n=5&min=0&max=100&method=getint
json response:
{"DATA": [8, 86, 18, 0, 45], "EXTRA": 0, "RDID": "rd.sh01#umJGXcN2ZHBn", "QUOTA": 20, "STATUS": "success"}

getStr

Return an array of strings with the defined length

n:    amount of strings (can't excess 1000)
l:    amount of characters per string (can't excess 30)

Example

query: https://api.randomdata.sh/v1/?n=5&len=10&method=getStr
json response:
{"BYTE_USED": 200, "DATA": ["bkv2KBzHCr", "fCECcjTHUO", "YmsNyNtXqT", "d46gj8mWor", "XwSx77p8qR"], "EXTRA": 0, "QUOTA": 10000, "RDID": "rd.shv1#zGlrw60lGHUB", "STATUS": "success"}

getByte

Return an array of bytes in hexadecimal format

n:    amount of number (can't excess 1000)

Example

query: https://api.randomdata.sh/v1/?method=getbyte&n=5
json response:
{"DATA": ["c2", "dd", "d4", "6b", "87"], "RDID": "rd.sh01#Uoul2q5gZ8v8", "QUOTA": 5, "STATUS": "success"}

getWords

Return an array of words

n:    amount of number (can't excess 1000)

Example

query: https://api.randomdata.sh/v1/?n=3&method=getwords
json response:
{"BYTE_USED": 20, "DATA": ["painful", "park", "ignore"], "EXTRA": 0, "QUOTA": 10000, "RDID": "rd.shv1#W1vwdNeVhSg7", "STATUS": "success"}

getGUID

Return an array of GUID

n:    amount of number (can't excess 1000)

Example

query: https://api.randomdata.sh/v1/?n=3&method=getguid
json response:
{"BYTE_USED": 48, "DATA": ["F1CC5DB4-7530-EABC-90E6-7FF0B42DB6FA", "9965A348-F089-D50C-1BE8-09CA86716DF3", "EFB2EBA8-2A6B-0D73-5093-AE8AE605BFE1"], "QUOTA": 10000, "RDID": "rd.shv1#ixCetQ3vcGzD", "STATUS": "success"}