Python3 script to use Instagram API to check if people I follow don’t follow back

So I am going to start coding my custom script so I can know how to do this properly in order to keep my personal tool for growth, this way I will include AI in this process.

This script is free and works to promote my next private script. If you are interested just subscribe to the Newsletter so I can notify you when I have it in production for a Lifetime price, including SetUp.

Way to go so here is the script:

import requests
import json

# Replace with your own access token
access_token = 'YOUR_ACCESS_TOKEN'

# Get list of users you follow
url = 'https://api.instagram.com/v1/users/self/follows?access_token=' + access_token
response = requests.get(url)
data = json.loads(response.text)
follows = data["data"]

# Get list of users who follow you
url = 'https://api.instagram.com/v1/users/self/followed-by?access_token=' + access_token
response = requests.get(url)
data = json.loads(response.text)
followers = data['data']

# Create sets for quick comparison
follows_set = set([f['username'] for f in follows])
followers_set = set([f['username'] for f in followers])

# Find users who don't follow you back
not_following_back = follows_set.difference(followers_set)

# Print the list of users who don't follow you back
print(not_following_back)

BTW the image Feature Image is from the Crazy MidJourney