Getting Current Subs List


I am using Pircbot in Java for a chat bot and am having trouble getting a list of current subs for a particular channel. This is how I am currently attempting it. Any advice?

URL subs = new URL(“”);
HttpURLConnection conn = (HttpURLConnection) subs.openConnection();
// Set Headers
conn.setRequestProperty(“authorization”, “OAuth -token-”);
conn.setRequestProperty(“accept”, “application/vnd.twitchtv.v5+json”);
conn.setRequestProperty(“client-id”, “client_id”);


Under v5 you should send channel_id not channel_name

URL subs = new URL(“”);

I have tried both and neither has worked. Sorry, should have said that.

I get a 401 error code.

A 401 indicates that you don’t have permission to access the requested channel_id’s subscribers. You can check the body response for more information

You need a token with the relevant oAuth scope applied to it

The scope for this subscriber end point is channel_subscriptions

Scopes are noted here:
Authentication here:
Channel Subscribers here:

Required scope: channel_subscriptions

GET<channel ID>/subscriptions

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