Making sense out of your insta’s data

I’ve been active on Instagram for a few years now and ever since I saw the option to download the data generated by Instagram for my profile I jumped right in to check it out.

Step 1: Request IG to send you your data

You can access this by going to your app under settings > account > download data

Requesting our data to Instagram

Step 2: Convert your data to something useful

# Reading the json as a dict
with open('/Users/iracine/Documents/WORKSPACE/IG/isacarracine_20210123_part_1/likes.json') as json_data:
    data = json.load(json_data)

#create a pandas data frame with likes
likes_df = pd.DataFrame(data, columns =['media_likes'])
#column 0 has date data so we place it on a separate field
likes_df['date'] = likes_df['media_likes'].apply (lambda row: row[0])
#column 1 has username data so we place it on a separate field
likes_df['username'] = likes_df['media_likes'].apply (lambda row: row[1])
#clean up df so we only have 2 columns
likes_df = likes_df.drop(['media_likes'], axis=1)

Step 3: Make sense out of your data

Now we would like to know who’s our bff.

#check out whose posts we've like the most ever
summarized_df =  likes_df.groupby('username').count()
print(summarized_df.sort_values("date", ascending=False))

#will show you a neat list like the following on your terminal
# username                  
# user21         226
# user231        145
# user354        106
# user45         105
# user453        95

With those simple 3 steps you’re able to analyze your own data and look for patterns.

Stay tuned for part 2 where I’ll show you what sorts of things we can figure out from your IG data.

Leave a Reply

Your email address will not be published.