How to get broadcaster_id or iCal-schedule of an arbitrary channel based on channel URL

Hello,

I am trying to use the api to collect iCal-files for the streaming schedules of various channels to get a proper overview. I understand in principle how to do that step itself. I am a viewer of all, and do not have access to either - obviously.

However, I do not understand how to get the required app/user access token. As I understand it, the user access token should be private to the channel, and I obviously don’t have access to it. Reg. the App-token, no clue how that would work. Furthermore, wouldn’t an app still have to be green-lit by the channel initially anyways?

The streaming schedules are public, thus I am a bit confused why I would need either token for retrieving public information.

Just for information, I am intending to issue the respective api-calls via AHK. No clue if relevant :¯\_(ツ)_/¯.


As a dumb example, given a twitch channel’s url (https://www.twitch.tv/CriticalRole), how can I retrieve:

  1. broadcaster_id of the channel
  2. iCal-schedule of the channel

via the API? How to do that for an arbitrary channel, under the assumption that I have no means of getting a user token approved (as the channels obviously don’t belong to me.)

Any help is welcome


Thank you.
Sincerely,
~Gw

To get the User ID of a channel

You can use the API Reference | Twitch Developers

Alternatively a tool such as Channel Information | Twitch API Example

This example tool
Lets you auth in as you then you can lookup someone else

There is also my calendar example here: Calendar Stuff | Twitch API Example which lets you auth in lookup someone and get a nice QR code to scane instead.

The API whilst containing public information still uses “access control” to prevent abuse

Which is why you need to generate a token to use in order to call the API

A server based solution would use an app access token to make calls for public data.
Or with a “simple thing” like github pages, you need to get a token from the user to use to make calls.

This helps Twitch understand API usage and spot/prevent an abuse being performed by bad actors.

Plumbing this into my Calendar tool, which will do the needed calls for you.

You can use your own User Token to get the information you have specified. Since it’s “public data”

Basically for public data, (no scopes) such as the a user/channel userID/channelID any token works.
And the iCal API takes no token or clientID at all.

1 Like

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