Guest User

Untitled

a guest
Mar 25th, 2018
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. pip install InstagramApi
  2.  
  3. # Import the module
  4. import InstagramAPI
  5.  
  6. # Provide your username and password
  7. USERNAME = "Your_username_goes_here"
  8. PASSWORD = "Your_password_goes_here"
  9.  
  10. InstagramAPI = InstagramAPI(USERNAME, PASSWORD)
  11. InstagramAPI = InstagramAPI.login()
  12.  
  13. InstagramAPI.getSelfUsersFollowing()
  14. my_followings = InstagramAPI.LastJson['users'] # Get list of users whom you are following
  15.  
  16. for user in my_followings:
  17. user_id = user['pk']
  18. InstagramAPI.getUserFollowers(user_id) # Get list of followers of a user whom you are following
  19. user_followers_list = InstagramAPI.LastJson # List of followers of user with user_id = pk
  20. print user_followers_list
  21. InstagramAPI.logout()
Add Comment
Please, Sign In to add comment