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

In the JSON object the generator return a QUOTA value, while this value is positive you can continue to send request, however as soon as this value become negative you should immediately respect a mandatory cool down time of 1h before sending more requests.

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 serialize 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         Usually positive, only used when the generator is overloaded.
                                       If this number ever become negative the client should stop any requests for a cooldown time of 1h
                                       failure of doing so might result in getting banned
-
"EXTRA"      (optional)    int         Reserved for future usage
-
"BYTE_USED"  (mandatory)   int         Indicate how many raw bytes where used to process your query

Methods

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

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"}