Useful Custom APIs

Staff Edit: These APIs are broken. If the author comes back they can restore the thread.

12 Likes

Can you create a API which shows how many followers the channel has?

How you use this command with Nightbot?

https://apis.rtainc.co/twitchbot/created?user=USER

1 Like

This should work:
!addcom !created $(customapi https://apis.rtainc.co/twitchbot/created?user=$(touser))
Then you can do “!created kdwolf77”

Added follower count, check original post.

3 Likes

Maybe a API which shows how long user has been a subscriber.

1 Like

Alright, done - check the original post. Keep in mind that it requires an API token with the “channel_subscribers” permission. You can get a token at https://apis.rtainc.co/twitchbot/token. I’m working on lowering the amount of time it takes to get the subscription length; all tokens from that page will be faster than if you generated it on the previous link.

3 Likes

I wish there was easier way to retrieve playing song from Spotify, at the moment you can link your Spotify account to Last.fm account and then make a Nightbot command for it. But time to time it doesn’t work at all.

2 Likes

Yeah. Unfortunately Spotify has not yet added ‘current track’ into their web API. I’m going to try and work with them to get that added as it would be very helpful for a lot of things.

2 Likes

Can you clarify what you mean by this statement? Is the failure on Spotify’s end, or is Nightbot not retrieving properly?

1 Like

@rtainc While I appreciate your efforts to create custom APIs that consequently support Nightbot, asking people to sign up at a competing bot service isn’t really user friendly and, to be frank, seems a bit like bad intentions towards Nightbot. An appropriate solution here would have been to make a simple html + js page that uses Twitch’s implicit authentication flow to let users get their own access token, and then accept the access token directly via your API.

1 Like

I agree – it was just the most convenient thing to give at the time. I’ve created a separate page and updated the post.

I believe what he meant was on LastFM’s API end, though I’ve never used it myself so I’m not sure how reliable it is.

2 Likes

This doesn’t seam to work for me! Thanks anyways!

1 Like

Thanks for telling me – should be fixed now.

1 Like

Can we get Nightbot uptime command to show seconds also like Moobot does?

Where I get the TOKEN for sub commands?

1 Like

Tokens can be gotten from https://apis.rtainc.co/twitchbot/token – the person with subscribers must be the one who connects there.

As for seconds in the uptime, just add &units=3 to the end of the URL. (Example: /uptime?user=kdwolf77&units=3)

2 Likes

User is not following <- I got that message when I tried the Token command.

1 Like

I fixed the message to say “not subscribed.” Otherwise, the API should work fine. Make sure you’re correctly supplying the user name.

On a side note, I sped up the API.

2 Likes

Honestly though why do you need to know how many seconds a stream has been up? Also note you can’t check subscribers for other channels, only your own channel, provided you have subscribers.

the one for Gets how long USER has been following CHANNEL.

what do i put in the USER part of https://apis.rtainc.co/twitchbot/following?channel=CHANNEL&user=USER to make it that itll tell the time for whoever uses the command?

1 Like

$(customapi https://apis.rtainc.co/twitchbot/following?channel=CHANNEL&user=$(user))

1 Like

How would i do the entire https://apis.rtainc.co/twitchbot/following?channel=CHANNEL&user=USER correctly for my channel like how wizebot is?

1 Like