# GET /channels/:channel/follows acting weird

**URL:** <https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358>\
**Category:** API\
**Created:** [January 12, 2014, 7:43am UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358 "2014-01-12T07:43:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Encorte](https://avatars.discourse-cdn.com/v4/letter/e/9f8e36/32.png) [@Encorte](https://discuss.dev.twitch.com/u/Encorte)\
**Post date:** [January 12, 2014, 7:43am UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358/1 "2014-01-12T07:43:26Z")

</div>

Hello,

I am trying to use (in PHP) the twitch API to get new (un)followers notifications. I am a PHP beginner. The problem is that

```
json_decode(file_get_contents(https://api.twitch.tv/kraken/channels/<channelname>/follows), true);

```

gives oscillating answers. An example:

1. I go to [https://api.twitch.tv/kraken/channels/channelname/follows](https://api.twitch.tv/kraken/channels/channelname/follows)
2. Someone hits the follow button.
3. After a while I refresh the page – It’s OK, I can see the new follower inside the JSON.
4. I refresh again and now the new follower is GONE (or maybe not, it seems random). It almost looks like it reverted to the previous state before the new follow.
5. Another refresh and he/she might back (or not).
6. etc…
7. After a while it finally stabilizes (at least it seems).

What am I doing wrong? It is annoying because the script is actually sending messages about new followers and unfollowers via IRC to channel’s twitch chat. So it looks like: X followed, X unfollowed, X followed, etc… until it stabilizes.

Thanks.

---

<div class="post-metadata">

**Author:** ![hephaestus](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/hephaestus/32/201_2.png) [@hephaestus](https://discuss.dev.twitch.com/u/hephaestus)\
**Post date:** [January 13, 2014, 4:44am UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358/2 "2014-01-13T04:44:57Z")

</div>

i can’t say for sure, so here’s a guess:

the response to that endpoint is probably cached and served from multiple servers.

the cache server that supplies data for your call could be different each time.

you probably won’t see consistent until all the caches are expired to represent the newest data

---

<div class="post-metadata">

**Author:** ![Encorte](https://avatars.discourse-cdn.com/v4/letter/e/9f8e36/32.png) [@Encorte](https://discuss.dev.twitch.com/u/Encorte)\
**Post date:** [January 13, 2014, 6:09am UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358/3 "2014-01-13T06:09:12Z")

</div>

I thought it’s something like that (if it is). Any way to prevent it? (I suppose I can code in some ‘cooldown time’ for each new (un)follower in which any changes of the follow status will be ignored.) And I’ve got another question: Is there any (API or other) way to track followers list updates? (Apart from catching that from the email notifications.) How does apps like ‘TNotifier’ work?

Thank you for the help.

---

<div class="post-metadata">

**Author:** ![hephaestus](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/hephaestus/32/201_2.png) [@hephaestus](https://discuss.dev.twitch.com/u/hephaestus)\
**Post date:** [January 13, 2014, 6:31am UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358/4 "2014-01-13T06:31:12Z")

</div>

the one you’ve found seems like the only public endpoint

your idea seems like it would work

another one would be to look at the response headers you’re getting and compare (what you know to be) correct responses to wrong ones. Maybe there’s a date or something else you can use to identify data from an old cache.

---

<div class="post-metadata">

**Author:** ![MikBeTK](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/mikbetk/32/181_2.png) [@MikBeTK](https://discuss.dev.twitch.com/u/MikBeTK)\
**Post date:** [May 15, 2014, 8:13am UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358/5 "2014-05-15T08:13:44Z")

</div>

I’m seeing the exact same behavior and I think Hephaestus is correct as well. At least that was my guess too.

What I’m doing to handle this is creating a local cache with an age. Removals are only removed after five minutes. This keeps oscillations from making my bot go crazy.

– edit –

If you want to get an idea of how I did it take a look at the [Followers](https://github.com/mikbe/twacker_client_winform/blob/master/Client/Followers.cs) class in my [Twacker text-to-speech chat client](https://github.com/mikbe/twacker_client_winform).

---

<div class="post-metadata">

**Author:** ![DallasNChains](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dallasnchains/32/1608_2.png) [@DallasNChains](https://discuss.dev.twitch.com/u/DallasNChains)\
**Post date:** [November 3, 2016, 4:10pm UTC](https://discuss.dev.twitch.com/t/get-channels-channel-follows-acting-weird/358/6 "2016-11-03T16:10:18Z")

</div>

Closed on November 3, 2016, 4:10pm UTC


