Useful Custom APIs

Could someone please type the full command for the !howlong thingie? I just can’t get it to work :frowning: THanks in advance

@Aaron128l @MrMagic
I fixed that endpoint, extremely sorry for the trouble.

@trilani
Here’s a simple example:

!addcom !howlong $(customapi https://api.rtainc.co/twitch/channels/$(channel)/followers/$(user)?format=You've+been+following+for+[2])

thank you

i am sry to disturb further

is there any way to get the latest follow name? or do i miss something`?

Also from the original post,

!addcom !latestfollower $(customapi https://api.rtainc.co/twitch/channels/$(channel)/followers?format=The+last+follower+was:+[2]&count=1)

Thank you man :slight_smile:

i am totaly missed that sry

So, this is what I put in : $(customapi https://api.rtainc.co/twitch/channels/$(G_E_M_S)/followers/$(user)?format=You’ve+been+following+for+[2])

and this is the response: Trilani_ isn’t following [invalid%20variable] I am doing something wrong but I don’t know what :confused:

It’s actually supposed to be:

!addcom !howlong $(customapi https://api.rtainc.co/twitch/channels/insertyourchannelofchoicehere/followers/$(user)?format=You’ve+been+following+for+[2])

@rtainc @theowest Thank you very much it worked! I see what I did wrong now :slight_smile:

@rtainc Is it possible to still get the game even when the user in question is offline?

how can i make !howlong ap do months weeks and days?
i like the stylistic formating of $(customapi https://api.rtainc.co/twitch/channels/$(channel)/followers/$(touser)?format=[1]+has+been+following+[0]+for+[2])but i want more precision for example
https://api.rtainc.co/twitch/channels/EoMGames/followers/CurtimusPrime2545 returns CurtimusPrime2545 has been following EoMGames for 1 month, 3 weeks and i want CurtimusPrime2545 has been following EoMGames for 1 month, 3 weeks, and [x] days

The “any API that returns a duration” rule in the post applies here - add &units=3 for 3 units. If you want days even when the account is a year+ old, use &units=4.

[quote=“rtainc, post:1, topic:4102”]https://api.rtainc.co/twitch/channels/CHANNEL/status?format=[0]+is+playing+[1]+for+[2]+viewers
Returns the game being played and the stream’s viewer count.[/quote]

Is there a way to retrieve the last game played instead, in case the target of the command is currently offline?

You can use the Twitch variable -> $(twitch $(channel) "{{game}}")

Hi! Sorry if someone has already asked this but does anyone have an API for Dead by Daylight stats? Is it even possible? Much appreciated!

As the game developers have not provided a stat API, it is unfortunately not possible at this time. Sorry!

1 Like

Thanks for the quick reply!

Other question I have is regarding the new follow length api… Is there a way to have it respond with the date and time the user followed instead of the countup?

@rtainc Twitch seems to be forcing a space to be added before ‘$’ recently. So trying to add a command using:

$(urlfetch https://api.rtainc.co/twitch/channels/CHANNELNAME/followers/$(user))

results in it becoming (notice the extra space):

$(urlfetch https://api.rtainc.co/twitch/channels/CHANNELNAME/followers/ $(user))

which won’t work:

%20exampleuser isn't following examplechannel

How do I overcome this? Can you change the API to weed out leading spaces in usernames?

Hi, i am not getting it to work. i did have it working but it advised me to update the API, i am struggling a bit.

Code:
$(touser) has been following channel $(customapi https://api.rtainc.co/twitch/channels/SNOWxCROSS/followers/$(user)?format=You’ve+been+following+for+[2])

Thanks!

Copy and paste this.

!commands add !howlong $(customapi https://api.rtainc.co/twitch/channels/$(channel)/followers/$(touser)?format=[1]+has+been+following+[0]+for+[2])

You do not need to change anything.

https://api.rtainc.co/twitch/channels/CHANNEL/viewers/random?format=I+choose…+[0]33
Returns a random viewer who’s watching the stream.

How can I random a viewer which is not a MOD / admin? or can I make a list of exceptions? I don’t want nightbot or me to be the result. Thank you.