You can get this API in v2
Getting started with the follows lookup endpoints
GET https://api.twitter.com/2/users/{user-id}/followers
Example
https://api.twitter.com/2/users/415859364/followers?user.fields=name,username&max_results=3
Result
$ node get-follower.js
{
"data": [
{
"id": "1596504879836499971",
"name": "花花化海",
"username": "zhanglihang123"
},
{
"id": "1526533712061550595",
"name": "boy",
"username": "bernardoy_10"
},
{
"id": "1606507879305187328",
"name": "Bubsy",
"username": "BjornBubsy"
}
],
"meta": {
"result_count": 3,
"next_token": "79HP1KIM4TA1GZZZ"
}
}

I just 3 followers among 9.6 millions
.

How to get all?
That API get maximum 1000 for each API call.
So first call get 1000 followers next API call with next_token
get other 1000 followers, so if want to get 9.6 Millions, you have to call about 9600 API calls.
This is full code for get 1000 followers.
const axios = require('axios')
const config = require('./config.json');
const getAccessToken = async () => {
try {
const resp = await axios.post(
'https://api.twitter.com/oauth2/token',
'',
{
params: {
'grant_type': 'client_credentials'
},
auth: {
username: config.API_KEY,
password: config.API_KEY_SECRET
}
}
);
return Promise.resolve(resp.data.access_token);
} catch (err) {
console.error(err);
return Promise.reject(err);
}
};
const getFollowers = async (token, user_id, max_number) => {
try {
const resp = await axios.get(
`https://api.twitter.com/2/users/${user_id}/followers`,
{
headers: {
'Authorization': 'Bearer '+ token,
},
params: {
'user.fields': 'name,username',
'max_results': max_number
}
}
);
return Promise.resolve(resp.data);
} catch (err) {
return Promise.reject(err);
}
};
getAccessToken()
.then((token) => {
getFollowers(token, '415859364', 1000)
.then((result) => {
console.log(JSON.stringify(result, null, 4));
})
.catch(error => console.log(JSON.stringify(error)));
})
.catch(error => console.log(JSON.stringify(error)));
Result
{
"data": [
{
"id": "1606509933230448640",
"name": "Chelsea Mensah-benjamin",
"username": "Chelseamensahb"
},
{
"id": "1606508744644251648",
"name": "Akash Saha",
"username": "AkashSa98976792"
},
{
"id": "1606339693234204672",
"name": "L。!!。️",
"username": "LL9777777"
},
...
{
"id": "1606362529432997888",
"name": "Venu Prasanth",
"username": "prasanthvenu8"
},
{
"id": "1606363199967723523",
"name": "Heather Bartholomew",
"username": "HeatherBartho20"
},
{
"id": "1469403002805301248",
"name": "Gokul Venu",
"username": "GokulVenu20"
}
],
"meta": {
"result_count": 1000,
"next_token": "0289CA5F0LA1GZZZ"
}
}
For next 1000 get followers
This call will be get with pagination_token
<- before call's next_token
https://api.twitter.com/2/users/415859364/followers?user.fields=name,username&max_results=1000&pagination_token=0289CA5F0LA1GZZZ
Relation between HTTP call with GET parameters
and Axios parameters
It makes how many number of data and each item what kinds of data fields want to get from Tweeter server.

If you want to add more user fields, look this URL
