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 Subcriber - Get random subscriber from a Twitch channel
Retrieves one or more random subscribers for the specified Twitch channel.
Requires channel owner to have authorized DecAPI for subscriber access
The channel owner must authorize DecAPI to access their subscriber data in order for this endpoint to return subscriber information.
If the channel owner already uses other DecAPI Twitch endpoints with subscriber data access, such as subcount or subpoints, then no further action is needed.
If you are the channel owner, you can authorize DecAPI via this link: Authorize DecAPI for Twitch Subscriber Access
Endpoint URL
https://decapi.me/twitch/random_sub/CHANNEL_USERNAME_HERE
Required URL parameters
channel- Required - Twitch channel to pick a random subscriber from.
Query parameters
count- Optional - The number of subscribers to retrieve. Default:1. (int)field- Optional - Which field from the subscriber object to return (see Twitch API for available fields)- Default:
user_name, otherwise known as the "Display name" (e.g. username with capitalization, or localized display names). - If you want the actual Twitch username (all lowercase, no special characters), use
user_login.
- Default:
separator- Optional - Characters to separate multiple values with. Default:,
Examples
- Get one random subscriber display name from Ninja's channel: https://decapi.me/twitch/random_sub/ninja
- Get 3 random subscriber display name from Ninja's channel: https://decapi.me/twitch/random_sub/ninja?count=3
- Get 2 random subscriber usernames (not display names), separated by
||, from Ninja's channel: https://decapi.me/twitch/random_sub/ninja?count=2&field=user_login&separator=||
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 subscriber (default: 1 username)
$(urlfetch https://decapi.me/twitch/random_sub/$(channel)) -
Get 3 random subscriber names
$(urlfetch https://decapi.me/twitch/random_sub/$(channel)?count=3) -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
$(urlfetch https://decapi.me/twitch/random_sub/$(channel)?count=2&field=user_login&separator=||)
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 subscriber (default: 1 username)
$(customapi https://decapi.me/twitch/random_sub/$(channel)) -
Get 3 random subscriber names
$(customapi https://decapi.me/twitch/random_sub/$(channel)?count=3) -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
$(customapi https://decapi.me/twitch/random_sub/$(channel)?count=2&field=user_login&separator=||)
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 subscriber (default: 1 username)
${customapi.https://decapi.me/twitch/random_sub/${channel}} -
Get 3 random subscriber names
${customapi.https://decapi.me/twitch/random_sub/${channel}?count=3} -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
${customapi.https://decapi.me/twitch/random_sub/${channel}?count=2&field=user_login&separator=||}
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 subscriber (default: 1 username)
$readapi(https://decapi.me/twitch/random_sub/$mychannel) -
Get 3 random subscriber names
$readapi(https://decapi.me/twitch/random_sub/$mychannel?count=3) -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
$readapi(https://decapi.me/twitch/random_sub/$mychannel?count=2&field=user_login&separator=||)
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 subscriber (default: 1 username)
{readapi.https://decapi.me/twitch/random_sub/{channel.name}} -
Get 3 random subscriber names
{readapi.https://decapi.me/twitch/random_sub/{channel.name}?count=3} -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
{readapi.https://decapi.me/twitch/random_sub/{channel.name}?count=2&field=user_login&separator=||}
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 subscriber (default: 1 username)
@customapi@[https://decapi.me/twitch/random_sub/@stream@] -
Get 3 random subscriber names
@customapi@[https://decapi.me/twitch/random_sub/@stream@?count=3] -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
@customapi@[https://decapi.me/twitch/random_sub/@stream@?count=2&field=user_login&separator=||]
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 subscriber (default: 1 username)
(customapi https://decapi.me/twitch/random_sub/(channelname)) -
Get 3 random subscriber names
(customapi https://decapi.me/twitch/random_sub/(channelname)?count=3) -
Get 2 random subscriber _usernames_ (not display names), separated by `||`
(customapi https://decapi.me/twitch/random_sub/(channelname)?count=2&field=user_login&separator=||)