Today, I will try to get the follower list in 4 lines.
However, I only use the usual Twittroauth, but if you do not have abraham / twitteroauth, please do so from Composer.
composer require abraham/twitteroauth
The API limit is 5000 per user. If you want to get more, you can loop with "for". Note that oauth_token and oauth_token_secret are not required and can be accessed.
For details ↓
TwitterDev Official Reference
require 'vendor/autoload.php'; use Abraham\TwitterOAuth\TwitterOAuth; $connection = new TwitterOAuth("APIKey", "APISecret"); $followers = $connection->get("followers/list",array('cursor' => '-1', 'screen_name' => 'screen_name','count'=>'100'));
- Auto loading
- Namespace import
- Credential settings & instantiation
Information is returned as a class object
followers/list on the 4th line to