I am hitting the [GET followers/ids] End point … the same request multiple times …

  • i set the count to 5000

The problem … ex: if the user has 300 followers some times the api response contains 300 ids other times it contains 295 id for example.
on my own account i have 260 follower currently some times the api returns only 256 ids

The code i am using (PHP with Guzzle http client)

$res = $client->request(
            'GET',
            'https://api.twitter.com/1.1/followers/ids.json',
            ['headers' =>
                [
                    'Authorization' => "Bearer " . env('TWITTER_TOKEN')
                ],
                'query' => [
                    'cursor' => $next_cursor,
                    'screen_name' => $this->twuname,
                    'stringify_ids' => 'true',
                    'count' => '5000',
                ]
            ]
        )->getBody()->getContents();

Any help please !

I think it filters out suspended / deleted users so the counts may be off.

1 Like

I don’t think so as i checked the difference between the two lists and the accounts was for my friends and they are using them.
Also the count changes … if i tried 3 times for example the result may be 260 256 260 in less than 1 minute.
This dose not happen with requests i make with postman it only happens on server i don’t know why.
I make one lookup request exactly before the followers id request could this have some kind of effect? It shouldn’t.
Even if it filters some users, they should be filtered every time right?

oh, that’s strange - i don’t really know why that would be aside from the usual “eventual consistency” and caching issues.

I will try to shift to api v2 maybe the problem dosen’t appear … will this be a good idea ?

1 Like

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