I am trying to write a Python script to get the top 20 streams using the API. However, I could not find a guide online. I am going off of the python-twitch-client docs but so far I couldn’t find something helpful. I’ll admit, its my first time ever working with this API.
For what you describe the code would be running on a server (for caching purposes) and you’d probably use a client_credentials access token for server to server requests
For this python lib under Kraken looks like you need
from twitch import TwitchClient
client = TwitchClient(‘’)
streams = client.streams.get_live_streams()
Which would return 25 streams
But you really should be using Helix since kraken is deprecated
Server to Server requests can use an App Access Token
If you have a logged in user to your app you can use a user access token generated one of two ways
User data may require a specific users user access token