# Getting recent followers/hosts/viewers/subs

**URL:** <https://discuss.dev.twitch.com/t/getting-recent-followers-hosts-viewers-subs/6124>\
**Category:** API\
**Created:** [May 13, 2016, 2:32am UTC](https://discuss.dev.twitch.com/t/getting-recent-followers-hosts-viewers-subs/6124 "2016-05-13T02:32:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pingpong1109](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@pingpong1109](https://discuss.dev.twitch.com/u/pingpong1109)\
**Post date:** [May 13, 2016, 2:32am UTC](https://discuss.dev.twitch.com/t/getting-recent-followers-hosts-viewers-subs/6124/1 "2016-05-13T02:32:37Z")

</div>

for a personal project I have been working on a bot. The docs for the API has helped me alot but is there a good way to get the most recent follows/hosts/subs and current viewers. I know bots do this because I see it all the time.

EDIT:I am doing chat through IRC, is there a way this might help?

---

<div class="post-metadata">

**Author:** ![Dev](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dev/32/1691_2.png) [@Dev](https://discuss.dev.twitch.com/u/Dev)\
**Post date:** [May 13, 2016, 5:06am UTC](https://discuss.dev.twitch.com/t/getting-recent-followers-hosts-viewers-subs/6124/2 "2016-05-13T05:06:13Z")

</div>

Hi there,

There is no endpoint that will serve this to you unless you work for it. I’ll give you some more info:

**Followers and Subscribers**  
To get the recent followers you will need to pull the [Follows](https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#get-channelschannelfollows) from the API and look for new entries The same goes for [Subscribers](https://github.com/justintv/Twitch-API/blob/master/v3_resources/subscriptions.md).

**Hosting**  
Host messages is sent through the HOSTTARGET if you require

> CAP REQ :twitch.tv/commands

Starting of a host would show like

> :tmi.twitch.tv HOSTTARGET #hosting\_channel :target\_channel [number]

while ending a host would be

> :tmi.twitch.tv HOSTTARGET #hosting\_channel :- [number]

for more info about this, please look at the [IRC documentation](https://github.com/justintv/Twitch-API/blob/master/IRC.md)

This is undocumented in the official documentation, but hosts can also be retrived here:

> [http://tmi.twitch.tv/hosts?include\_logins=1&target={id}](http://tmi.twitch.tv/hosts?include_logins=1&target=%7Bid%7D) for users hosting your channel

> [http://tmi.twitch.tv/hosts?include\_logins=1&host={id}](http://tmi.twitch.tv/hosts?include_logins=1&host=%7Bid%7D) for what channel you are hosting

> {id} is of course the `_id` field from /users/ or /channels/.

as posted about [here](https://discuss.dev.twitch.com/t/host-mode-in-kraken-api/1014/6)

**Viewers**  
Chatters joining and leaving the chat is sent as `JOIN` and `PART` if you require

> CAP REQ :twitch.tv/membership

users joining the channel will be shown as

> :twitch\_username!twitch\_username@twitch\_username.tmi.twitch.tv JOIN #channel

while leaving the channel is shown as

> :twitch\_username!twitch\_username@twitch\_username.tmi.twitch.tv PART #channel

There is also an undocumented call for this under

> [http://tmi.twitch.tv/group/user/{CHANNEL}/chatters](http://tmi.twitch.tv/group/user/%7BCHANNEL%7D/chatters)

where {CHANNEL} is your target channel.

Hope this helped you out some.

---

<div class="post-metadata">

**Author:** ![pingpong1109](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@pingpong1109](https://discuss.dev.twitch.com/u/pingpong1109)\
**Post date:** [May 13, 2016, 5:28am UTC](https://discuss.dev.twitch.com/t/getting-recent-followers-hosts-viewers-subs/6124/3 "2016-05-13T05:28:54Z")

</div>

Thank you I really do appreciate it! I think this will help. I will post any questions if I have any.

EDIT: This all worked and I have no questions.

---

<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:** [June 12, 2016, 5:28am UTC](https://discuss.dev.twitch.com/t/getting-recent-followers-hosts-viewers-subs/6124/4 "2016-06-12T05:28:59Z")

</div>

Closed on June 12, 2016, 5:28am UTC

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