Skip to content
twitch.apiv2.0

Reference / API groups

twitch.subscriptions

Subscriptions: the subscribers of a channel, and whether a user is one.

Every method of twitch.subscriptions, with its parameters, what it returns and the token it needs.

twitch.subscriptions.get(params?, options?): Paginator<BroadcasterSubscription, BroadcasterSubscriptionsBody>

Lists the subscribers of a channel. Each page also carries the subscriber points of the channel, in page.raw.points.

Token: user, scope channel:read:subscriptions.

NameTypeDescription
broadcaster_idstringBroadcaster whose subscribers to list. Defaults to the user making the call.
user_idstring | readonly string[]Only these subscribers. Up to 100 IDs. Cannot be combined with a cursor.
firstnumberItems per page, 1 to 100. Twitch defaults to 20.
afterstringCursor of the next page.
beforestringCursor of the previous page.

options: Request options for this call: as, token, signal, timeout, retries.

Paginator<BroadcasterSubscription, BroadcasterSubscriptionsBody>

Fields of BroadcasterSubscription
NameTypeDescription
broadcaster_idstringID of the broadcaster.
broadcaster_loginstringLogin name of the broadcaster.
broadcaster_namestringDisplay name of the broadcaster.
gifter_idstringID of the user who offered the subscription. An empty string when it is not a gift.
gifter_loginstringLogin name of that user. An empty string when it is not a gift.
gifter_namestringDisplay name of that user. An empty string when it is not a gift.
is_giftbooleanWhether the subscription was offered by someone else.
plan_namestringName of the subscription plan.
tierSubscriptionTierLevel of the subscription.
user_idstringID of the subscriber.
user_namestringDisplay name of the subscriber.
user_loginstringLogin name of the subscriber.
const page = await twitch.subscriptions.get();
console.log(page.total, page.raw.points);
for await (const sub of twitch.subscriptions.get()) console.log(sub.user_name, sub.tier);

Twitch reference

twitch.subscriptions.check(params, options?): Promise<UserSubscription | null>

Gets the subscription of a user to a channel, or null when the user is not subscribed.

Token: user, scope user:read:subscriptions.

NameTypeDescription
broadcaster_id requiredstringBroadcaster the user may be subscribed to. Must be a partner or an affiliate.
user_idstringUser to check. Defaults to the user making the call.

options: Request options for this call: as, token, signal, timeout, retries.

Promise<UserSubscription \| null>

Fields of UserSubscription
NameTypeDescription
broadcaster_idstringID of the broadcaster.
broadcaster_loginstringLogin name of the broadcaster.
broadcaster_namestringDisplay name of the broadcaster.
gifter_idstringID of the user who offered the subscription. Only present on a gift.
gifter_loginstringLogin name of that user. Only present on a gift.
gifter_namestringDisplay name of that user. Only present on a gift.
is_giftbooleanWhether the subscription was offered by someone else.
tierSubscriptionTierLevel of the subscription.
const sub = await twitch.subscriptions.check({ broadcaster_id: "141981764" });
if (sub) console.log(`Subscribed at tier ${sub.tier}`);

Twitch reference