Count No of Follower on Instagram ? any Permanent solution?

Viewed 197

I am trying to pull the number of followers from a list of Instagram accounts.

I want to integrate Instagram API or any hack solution to get out no of followers on the Instagram account.

I found many solutions for the above problem but none of them work properly

the link which I follow: Grab Instagram Follower count Grab Instagram Follower count

3 Answers

As far as I know, Instagram doesn't have any APIs official or unofficial.

So, I have used the Node.Js and implemented this by following the geeksforgeeks code

Index.js

const express = require('express');
const followers = require('instagram-followers');
const app = express();
    
app.get('/' , (req , res)=>{
    res.send("GeeksforGeeks");
});
    
app.get('/:username' , (req , res) => {
    followers(req.params.username).then((count) => {
        if(!count){
            res.send("Account Not Found");
            return;
        }
        res.send("Username " + req.params.username +
            " have " + "<b>" + count + "</b>" + " followers");

    });
});

// Server setup
app.listen(4000 , ()=>{
    console.log("server is running on port 4000");
});

enter image description here

you could use a ajax request for getting the count by using this link to get token

  $.ajax({

  url: 'https://api.instagram.com/v1/users/self',

  dataType: 'jsonp',

  type: 'GET',

  data: {access_token: token},

  success: function(data){

      var follows = data['data']['counts']['follows'];

      $(".instagram").text(follows);

  },

  error: function(data){

      console.log(data);

  }

if you need more information you can check the source from where i found it

Github Link for Instagram Unofficial API Check out the API and follow the steps as I am showing you.

Install the API

pip install git+https://git@github.com/ping/instagram_private_api.git@1.6.0

Code

from instagram_private_api import Client, ClientCompatPatch 
username = 'test' 
password = 'test' 
api = Client(username, password) 
results = api.user_follows('test') 
print([item['pk'] for item in results.get('users', [])])
Related