# Preferred way of detecting a new follower

**URL:** <https://discuss.dev.twitch.com/t/preferred-way-of-detecting-a-new-follower/27792>\
**Category:** Chat and IRC\
**Created:** [August 19, 2020, 8:13pm UTC](https://discuss.dev.twitch.com/t/preferred-way-of-detecting-a-new-follower/27792 "2020-08-19T20:13:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zorael](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/zorael/32/6828_2.png) [@zorael](https://discuss.dev.twitch.com/u/zorael)\
**Post date:** [August 19, 2020, 8:13pm UTC](https://discuss.dev.twitch.com/t/preferred-way-of-detecting-a-new-follower/27792/1 "2020-08-19T20:13:32Z")

</div>

I’m writing an IRC bot, and I was surprised to see there were no “new\_follower” msg-id. What then is the preferred way of detecting a new follow?

I can preemptively hammer `https://api.twitch.tv/helix/users/follows?to_id=` and look at the “totals” field, monitoring it for changes, but even with a few seconds in between that’s a lot of requests.

Is there a better way?

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [August 19, 2020, 8:54pm UTC](https://discuss.dev.twitch.com/t/preferred-way-of-detecting-a-new-follower/27792/2 "2020-08-19T20:54:52Z")

</div>

> [@zorael](#):
>
> I was surprised to see there were no “new\_follower” msg-id.

Twitch chat doesn’t show new follows, so there’s no reason for Twitch to send those events over TMI.

> [@zorael](#):
>
> but even with a few seconds in between that’s a lot of requests

The API is cached, requesting the same endpoint with the same params more frequently than once a minute is excessive, and can actually lead to bad responses.

As for the best way to handle this, you could use webhooks [https://dev.twitch.tv/docs/api/webhooks-guide](https://dev.twitch.tv/docs/api/webhooks-guide) and subscribe to the follows topic and get a notification each new follow (it’ll send a notification regardless of if the user had previously followed, so it’s still up to you to detect and handle a user spamming follow/unfollow)

---

<div class="post-metadata">

**Author:** ![abskmj](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/abskmj/32/9769_2.png) [@abskmj](https://discuss.dev.twitch.com/u/abskmj)\
**Post date:** [August 20, 2020, 6:42am UTC](https://discuss.dev.twitch.com/t/preferred-way-of-detecting-a-new-follower/27792/3 "2020-08-20T06:42:23Z")

</div>

Yes, as @Dist suggested the webhook would be the best way to listen for new followers. Specifically, the below topic. There is a sample implementation at [github.com](https://github.com/abskmj/gulel/blob/master/examples/tunnel.js)

```
https://api.twitch.tv/helix/users/follows?first=1&to_id=1337
```

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [September 19, 2020, 6:42am UTC](https://discuss.dev.twitch.com/t/preferred-way-of-detecting-a-new-follower/27792/4 "2020-09-19T06:42:28Z")

</div>

Closed on September 19, 2020, 6:42am UTC

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