

set_user_authentication ( token, target_scope, refresh_token ) authenticate () # add User authentication twitch.

from twitchAPI.twitch import Twitch from twitchAPI.oauth import UserAuthenticator from twitchAPI.types import AuthScope twitch = Twitch ( 'my_app_id', 'my_app_secret' ) target_scope = auth = UserAuthenticator ( twitch, target_scope, force_verify = False ) # this will open your default browser and prompt you with the twitch verification website token, refresh_token = auth. You can use various online services to generate a token or use my build in Authenticator.įor my Authenticator you have to add the following URL as a "OAuth Redirect URL": You can set that here in your twitch dev dashboard. To get a user auth token, the user has to explicitly click "Authorize" on the twitch website.
Twitch uuid generator how to#
Please read the docs for more details and examples on how to set and use Authentication! App AuthenticationĪpp authentication is super simple, just do the following: from twitchAPI.twitch import Twitch twitch = Twitch ( 'my_app_id', 'my_app_secret' ) User Authentication It's always good to get at least App authentication even for calls where you don't need it since the rate limits are way better for authenticated calls. Which one you need (or if one at all) depends on what calls you want to use. The Twitch API knows 2 different authentications. get_users ( logins = ) user_id = user_info Authentication Setting up an Instance of the Twitch API and get your User ID: from twitchAPI.twitch import Twitch # create instance of twitch API and create app authentication twitch = Twitch ( 'my_app_id', 'my_app_secret' ) # get ID of user user_info = twitch.
Twitch uuid generator install#
Pip install twitchAPI Documentation and SupportĪ full API documentation can be found on .įor support please join the Twitch API discord server Usage Basic API calls This is a full implementation of the Twitch API, its Webhook and PubSub in python 3.7.
