# TWITTER FOLLOWER

By [tyson](https://paragraph.com/@iamsatish) · 2023-08-31

---

TWIT FOLLOWER COUNT
-------------------

If you're interested in retrieving the follower count of a Twitter account for legitimate and ethical purposes, you should use the official Twitter API. Here's how you can do it using JavaScript and the `twit` library, which is a Node.js module for working with the Twitter API:

1.  First, make sure you have Node.js installed on your system.
    
2.  Install the `twit` library using npm:
    

    bashCopy code
    

1.  Create a JavaScript file (e.g., `getFollowerCount.js`) and add the following code:
    

    javascriptCopy code
    

``const Twit = require('twit'); // Set your Twitter API keys const config = { consumer_key: 'YOUR_CONSUMER_KEY', consumer_secret: 'YOUR_CONSUMER_SECRET', access_token: 'YOUR_ACCESS_TOKEN', access_token_secret: 'YOUR_ACCESS_TOKEN_SECRET' }; const T = new Twit(config); // The screen name of the Twitter account you want to get followers for const screenName = 'target_account_username'; // Retrieve the user's followers count T.get('users/show', { screen_name: screenName }, (err, data, response) => { if (!err) { const followerCount = data.followers_count; console.log(`${screenName} has ${followerCount} followers.`); } else { console.error('Error:', err); } });``

Replace `'YOUR_CONSUMER_KEY'`, `'YOUR_CONSUMER_SECRET'`, `'YOUR_ACCESS_TOKEN'`, and `'YOUR_ACCESS_TOKEN_SECRET'` with your actual Twitter API credentials.

1.  Run the script using Node.js:
    

    bashCopy code
    

    node getFollowerCount.js
    

This approach uses the official Twitter API and respects the terms of service while providing you with the follower count for the specified Twitter account.

![](https://storage.googleapis.com/papyrus_images/20fe7e7a3099f593260549f034e886a12ce80e5812f6ccbc4ef9ee22fa11fca3.png)

---

*Originally published on [tyson](https://paragraph.com/@iamsatish/twitter-follower)*
