Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pip install InstagramApi
- # Import the module
- import InstagramAPI
- # Provide your username and password
- USERNAME = "Your_username_goes_here"
- PASSWORD = "Your_password_goes_here"
- InstagramAPI = InstagramAPI(USERNAME, PASSWORD)
- InstagramAPI = InstagramAPI.login()
- InstagramAPI.getSelfUsersFollowing()
- my_followings = InstagramAPI.LastJson['users'] # Get list of users whom you are following
- for user in my_followings:
- user_id = user['pk']
- InstagramAPI.getUserFollowers(user_id) # Get list of followers of a user whom you are following
- user_followers_list = InstagramAPI.LastJson # List of followers of user with user_id = pk
- print user_followers_list
- InstagramAPI.logout()
Add Comment
Please, Sign In to add comment