justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 379 forks source link

Notification of stream changes via webhooks #211

Closed lwansbrough closed 10 years ago

lwansbrough commented 10 years ago

Knowing when a user goes online is a big deal, and it doesn't look like the API has this ability yet. It would be great to have an endpoint that we could POST a webhook URL to, which would return us the current state of whatever we're requesting as well as a promise to post updates to the webhook URL for X amount of time (say... 30 days).

For example, if we could

POST https://api.twitch.tv/kraken/streams/test_channel
{ "webhook": "http://example.com/twitch/stream/test_channel", "interval": 60 }

Twitch would then respond something like this:

{
    "data": { [stream data here] },
    "promise": {
        "webhook": "http://example.com/twitch/stream/test_channel",
        "interval": 60,
        "expires": 2592000
    }
}

T'would be nice.

FugiTech commented 10 years ago

Current recommended practice is to poll the API to check if streams are online. Webhooks are complex, and unlikely to be supported any time in the near future.

lwansbrough commented 10 years ago

Is there a batch endpoint? If not then should I be concerned about rate limiting?

FugiTech commented 10 years ago

You can provide multiple channels like so https://api.twitch.tv/kraken/streams?channel=riotgames,dota2ti,machinima,esltv_hearthstone. We don't rate limit, but if we notice excessive usage we'll contact you and ask you to stop.

lwansbrough commented 10 years ago

Great, thanks!

fcarentz commented 8 years ago

Is there a limit to number of channels you can provide via this method? What if we had 1000 channels to batch, would that be a problem?

jwmalara commented 8 years ago

Looks like its paged based on 'limit', chunks of 100 being the max.

cryptiklemur commented 7 years ago

Are webhooks still not planned? They tend to be more efficient on the server and less of a headache for users.

Services like Curse (who now OWN you guys), Slack, and Discord could all benefit from Webhook support.

StefanJanssen95 commented 7 years ago

Webhooks would make everything a lot easier indeed.

4c74356b41 commented 7 years ago

man, no webhooks, is this 2009?

ivandardi commented 7 years ago

Even Picarto has webhooks!

l3d00m commented 7 years ago

Is there any update as the issue is now over 3 years old and webhooks are still highly relevant?

neolectron commented 7 years ago

up

3ventic commented 7 years ago

This repository isn't used anymore. Should use the dev forums instead.

l3d00m commented 7 years ago

And here is a relevant thread from Februrary '15. There are still no plans to implement it.

4c74356b41 commented 7 years ago

i stopped using twitch altogether because of this ;)

neolectron commented 7 years ago

Nvm its stupid, we'll keep spamming api calls just to test a truthy value. Gj twitch. Scaling at his finest.