# Get\_follows doesn't return correct number of follows

**URL:** <https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819>\
**Category:** API\
**Created:** [May 15, 2018, 5:13pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819 "2018-05-15T17:13:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isabella\_sina](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@Isabella\_sina](https://staging-discuss.dev.twitch.com/u/Isabella_sina)\
**Post date:** [May 15, 2018, 5:13pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/1 "2018-05-15T17:13:14Z")

</div>

```
twitch_client = TwitchClient(client_id=client_id, oauth_token=oauth_token)
prova = ['19571641']
seguiti = []
n=0
q=0
for user in prova:
    print(user)

    for x in range(0, 3):
        print('for')
        top_channel_follows = twitch_client.users.get_follows(user, limit=100, offset=q)
        q= q+100

        #pp.pprint(top_channel_follows)

        #print('separatoreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee')
        #print(stringa)

        #pp.pprint(top_channel_follows)

        n=0
        for x in range(0, len(top_channel_follows)):
            seguiti.append(top_channel_follows[n]['channel']['display_name'])
            n=n+1

print(seguiti)
print(len(seguiti))

```

I’m trying to get all the users followed by another user with that code. The problem is that it returns the wrong number of followed user. Checking on the page of the user the number of users followed is different. Anyone knows why or what i’m doing wrong?  
Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Dist](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://staging-discuss.dev.twitch.com/u/Dist)\
**Post date:** [May 15, 2018, 5:18pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/2 "2018-05-15T17:18:50Z")

</div>

How far off is the displayed total, and the list of followers you’re getting? If it’s only off by a small margin then it is likely due to banned/suspended users, as they are still included in the total but wont be returned in the list of followers.

---

<div class="post-metadata">

**Author:** ![Isabella\_sina](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@Isabella\_sina](https://staging-discuss.dev.twitch.com/u/Isabella_sina)\
**Post date:** [May 15, 2018, 5:25pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/3 "2018-05-15T17:25:29Z")

</div>

Ooohh yes! It could totally be. For example it returns just 191 users instead of 223.  
(sorry for my english)  
But how can I do a cicle that tells how many calls I have to do without having a “total” ?

---

<div class="post-metadata">

**Author:** ![Dist](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://staging-discuss.dev.twitch.com/u/Dist)\
**Post date:** [May 15, 2018, 5:44pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/4 "2018-05-15T17:44:38Z")

</div>

The API does return a total value, in the new Helix API it’s the `total` field, and the old API has a `_total` field.

---

<div class="post-metadata">

**Author:** ![Isabella\_sina](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@Isabella\_sina](https://staging-discuss.dev.twitch.com/u/Isabella_sina)\
**Post date:** [May 15, 2018, 5:51pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/5 "2018-05-15T17:51:34Z")

</div>

Yes but that \_total is the correct number while the number returned by the api is different, and smaller.

---

<div class="post-metadata">

**Author:** ![Dist](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://staging-discuss.dev.twitch.com/u/Dist)\
**Post date:** [May 15, 2018, 5:57pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/6 "2018-05-15T17:57:43Z")

</div>

You can either keep looping until your offset is greater than the `_total`, or you can divide the `_total` by your offset increment (in this case, 100) and round up, which will give the number of times you need to loop. Either way will stop the loop once you’ve got all the results the API will give.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [June 14, 2018, 5:57pm UTC](https://staging-discuss.dev.twitch.com/t/get-follows-doesnt-return-correct-number-of-follows/15819/7 "2018-06-14T17:57:55Z")

</div>

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