DEV Community

Connor Van Etten
Connor Van Etten

Posted on

Find Instagram Users Who Don't Follow You Back With Python

Quick Start

  • Download User Data from Instagram
  • Retrieve Data from Insta via email
  • Locate Following and Followers file
  • Run Script
  • Code Below

Download User Data

To access your user data from instagram, please go to, and log into your account. Follow the order below :

☰ → Settings → Privacy and Security → Data Download → Request Download

Once here it will give you the option to download your data as either an HTML or a JSON file. For our python code to work properly, please select JSON and then hit next and enter your password to send data.

Retrieve Data from Insta via email

When email is recieved, please select download information to the desired loaction on your computer.

Next locate the file within your downloads.

Locate Following and Followers file

Follow the path with the given folder to find your Followers.json and Following.json file.

From here we need to add these two files to a folder that contains our file.

Run Script

Once the files are located within the correct folder with our python script all the is needed to do is run your python script. Enter the terminal, locate the directory and run python This will return the list of people who you are following who do not follow you back.

Enjoy! Thank you for reading!

Code :

import json

# get information from followers file
with open('followers.json') as f:  
    follower = json.load(f) 

# get information from following file
with open('following.json') as g:  
    following = json.load(g) 

followers_list = []
following_list = []

for i in follower['relationships_followers']:

for i in following['relationships_following']:


print(len(followers_list), len(following_list))

please_unfollow = []

for _ in range(len(following_list)):
    if following_list[_] not in followers_list:

for _ in range(len(please_unfollow)):
for _ in range(len(please_unfollow)):
  curr = check(please_unfollow[_])
  if ',' in curr:
    curr = curr.replace(',', '')
  elif 'K' in curr:
    please_unfollow[_] = 'official_account'
  elif 'M' in curr:
    please_unfollow[_] = 'official_account'

# Check if user is "official" aka a professional account adjust if needed.
  if int(curr) >= 2000:
    please_unfollow[_] = 'official_account'

# remove all occurences of 'official_account' in please_unfollow
while 'official_account' in please_unfollow:

Enter fullscreen mode Exit fullscreen mode

Top comments (0)