Using the Instagram API to get ALL followers

后端 未结 5 1348
离开以前
离开以前 2020-12-14 13:34

I\'m using the Instagram API to get the number of people who follow a given account as follows.

$follow_info = file_get_contents(\'https://api.instagram.com/         


        
相关标签:
5条回答
  • 2020-12-14 13:43
    $follow_info = file_get_contents('https://api.instagram.com/v1/users/USER_ID?access_token=ACCES_TOKEN');
    $follow_info = json_decode($follow_info);
    print_r($follow_info->data);
    

    And:

    return
    {
      "meta":  {
        "code": 200
      },
      "data":  {
        "username": "i_errorw",
        "bio": "A Casa do Júlio é um espaço para quem gosta da ideia de cuidar da saúde com uma alimentação saudável e saborosa.",
        "website": "",
        "profile_picture": "",
        "full_name": "",
        "counts":  {
          "media": 5,
          "followed_by": 10,
          "follows": 120000
        },
        "id": "1066376857"
      }
    }
    
    0 讨论(0)
  • 2020-12-14 13:45

    Instagram limits the number of results returned in their API for all sorts of endpoints, and they change these limits arbitrarily, without warning, presumably to handle server load.

    Several similar threads exist:

    • Instagram API not fufilling count parameter
    • Displaying more than 20 photos in instagram API
    • Instagram API: How to get all user media? (see comments on answer too, -1 returns 1 less result).
    • 350 Request Limit for Instagram API
    • Instagram API: How to get all user media?

    In short, you won't be able to increase the maximum returned rows, and you'll be stuck paginating.

    0 讨论(0)
  • 2020-12-14 13:45

    if the APIs are optional

    using the mobile version of twitter you can extract a full list of a followers for a designed target using a very simple bash script

    the sleep time must me chosen carefully to avoid temporary ip block

    the script can be executed by :

    ./scriptname.sh targetusername
    

    content

       #!/bin/bash
    
        counter=1 
    
        wget --load-cookies ./twitter.cookies -O - "https://mobile.twitter.com/$1/followers?" > page 
    
    
        until [ $counter = 0 ]; do
    
        cat page | grep -i "@" | grep -vi "fullname" | grep -vi "$1" | awk -F">" '{print $5}' | awk -F"<" '{print $1}' >> userlist
    
        nextpage=$(cat page | grep -i "cursor" | awk -F'"' '{print $4}')
    
        wget --load-cookies twitter.cookies -O - "https://mobile.twitter.com/$nextpage" > page
    
        if [ -z $nextpage ]; then 
    
        exit 0
    
        fi
    
        sleep 5 
    
        done
    

    it creates a file "userlist" including all usernames that follows the designed target one by line

    PS: a cookies file filled with your credentials is necessary to wget to authenticate the requests

    0 讨论(0)
  • 2020-12-14 13:55
    $follow_info = file_get_contents('https://api.instagram.com/v1/users/USER_ID?access_token=ACCES_TOKEN');
    $follow_info = json_decode($follow_info);
    print_r($follow_info->data);
    
    return
    {
      "meta":  {
        "code": 200
      },
      "data":  {
        "username": "casadojulio",
        "bio": "A Casa do Júlio é um espaço para quem gosta da ideia de cuidar da saúde com uma alimentação saudável e saborosa.",
        "website": "",
        "profile_picture": "",
        "full_name": "",
        "counts":  {
          "media": 5,
          "followed_by": 25,
          "follows": 12
        },
        "id": "1066376857"
      }
    }
    
    0 讨论(0)
  • 2020-12-14 14:05

    I personally suggest to use Wizboost for instagram automation. And the reason is that I have used this tool and my experience is amazing. It gave me a lot of followers. Now you don’t need to invest time in competing with other Instagram accounts as Wizboost has got your back for this, in fact for everything. You don’t need to do anything you can just relax and Wizboost will get you followers, likes and comments. And you can also schedule your posts too. So easy to use and still got lots of potential. I just love Wizboost for all the services it has.

    0 讨论(0)
提交回复
热议问题