Work in progress
This documentation page is currently work in progress.
Not all existing DecAPI endpoints are documented here yet - mostly Twitch and YouTube endpoints. The rest of the endpoints should have accurate documentation :)
For the currently active documentation, please visit docs.decapi.me.
Random number between a minimum and maximum value
A random number generator between a specified minimum and maximum value.
Supports both positive and negative numbers. Only integer values (no decimal numbers).
Endpoint URL
https://decapi.me/random/number/-420/1337
Query parameters
format
- Optional - If this parameter is specified, it will be formatted using the default values ofnumber_format()
Examples
- Get a random number between 1 and 100: https://decapi.me/random/number/1/100
- Get a random number between -3125 and 7101: https://decapi.me/random/number/-3125/7101
Examples for bots
Nightbot
Note: Nightbot will automatically convert variables, such as$(channel)
or $(touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
$(urlfetch https://decapi.me/random/number/1/100)
-
Get a random number between -3125 and 7101
$(urlfetch https://decapi.me/random/number/-3125/7101)
Fossabot
Note: Fossabot will automatically convert variables, such as$(channel)
or $(user.login)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
$(customapi https://decapi.me/random/number/1/100)
-
Get a random number between -3125 and 7101
$(customapi https://decapi.me/random/number/-3125/7101)
StreamElements
Note: StreamElements will automatically convert variables, such as${channel}
or ${touser}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
${customapi.https://decapi.me/random/number/1/100}
-
Get a random number between -3125 and 7101
${customapi.https://decapi.me/random/number/-3125/7101}
Streamlabs Chat Bot
Note: Streamlabs Chat Bot will automatically convert variables, such as$mychannel
or $touserid
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
$readapi(https://decapi.me/random/number/1/100)
-
Get a random number between -3125 and 7101
$readapi(https://decapi.me/random/number/-3125/7101)
Streamlabs Cloudbot
Note: Streamlabs Cloudbot will automatically convert variables, such as{channel.name}
or {touser.name}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
{readapi.https://decapi.me/random/number/1/100}
-
Get a random number between -3125 and 7101
{readapi.https://decapi.me/random/number/-3125/7101}
Deepbot
Note: Deepbot will automatically convert variables, such as@stream@
or @user@
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
@customapi@[https://decapi.me/random/number/1/100]
-
Get a random number between -3125 and 7101
@customapi@[https://decapi.me/random/number/-3125/7101]
PhantomBot
Note: PhantomBot will automatically convert variables, such as(channelname)
or (touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Get a random number between 1 and 100
(customapi https://decapi.me/random/number/1/100)
-
Get a random number between -3125 and 7101
(customapi https://decapi.me/random/number/-3125/7101)