How can I check if a user is subscribed?

How can I check if a user is subscribed, without having to check among all subscribers, with the new api?

If there is a method with the new api, do you recommend using one of the v5?

If you look at the docs for the Helix Get Broadcaster Subscriptions endpoint you will see that there is an optional user_id param, where you can specify up to 100 users at a time to see if they are subscribed to that broadcaster.

1 Like

Thanks, I did not understand the parameter with the translator :sonrisa_sudor:

Hi i read from the docs

broadcaster_id -> User ID of the broadcaster. Must match the User ID in the Bearer token.

but in order to obtain the User OAuth Token, we usually must create a link to with parameters client_id, redirect_uri, response_type, state.

After authorize it, we receive a json with access_token (that we use as Bearer token).

So, please me more regarding this broadcaster_id to insert into Bearer Token.

Thank you in advance

The step by step instructions on getting OAuth tokens are here:

You need to use either the Implicit flow, or the Auth Code flow, as that requires you to send the broadcaster to the Twitch page to choose if they wish to grant your app permission to viewer their list of subscribers.

Mmm, so i suppose i can’t use it to check if a certain user_id has an active subscription on a certain channel, right?

You can if the channel has granted your app permission to access their subscribers list.

My app should be used by users: after the login, i would to check if the user is subscribed to a specific channel id, isn’t possible?

That’s only possible using the deprecated Get User Subscriptions endpoint but being deprecated it’s not something that should be relied on as it will be removed in the future.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.