Check the number of followers and followings on a Instagram account. Also calculates the number of users you are not following and users that are not following you.
- The Tampermonkey extension is required to use this script.
- The script must be ran on
https://www.instagram.com/{username}
URLs.
- Version 2 automatically parses the array data into JSON
- Colourful console logs
- Automatically copies result to clipboard
-
Create a new userscript in the Tampermonkey extension.
-
Copy & paste the code from the
.js
file into the code box and save changes. -
Browse to Instagram and view a user profile.
-
The URL in the address bar should be:
https://www.instagram.com/{username}
. -
Open the browser console (
Ctrl+Shift+J
on Chrome). -
You should see the script running in the console.
- If it's not running, ensure that the script is turned on in Tampermonkey, refresh the page and try again.
NOTE: The page must be refreshed manually (Ctrl+F5
) every time you want to fetch data.
- Expand the arrays of the data that you want to keep until you see the usernames in the console.
- In version 2 of the script, you should see JSON data in the console; click
Show more
under each set of JSON data to view the full list.
-
In the console log box, right click until you see a
Save as
option, and then save the log to your computer. -
Clean up the log file by deleting all the lines that do not start with
userscript.html
. -
Once all the lines start with
userscript.html
, start deleting the content until you have only the information you want to keep.
-
Use an online JSON Formatter to format the single line JSONs into a readable format.
-
Save the separate JSON data into individual JSON files.
NOTE: Step 3 applies only to version 1 of the script!
- Use Notepad++
Find & Replace
feature to get the correct JSON syntax:
- Add a
,
and a new line to each}
by finding}
and replacing it with},\n
using theExtended
search mode. - Add a set of
{
}
braces as the root JSON element at the top and bottom of the file. - Add a JSON property called
users:
under the root element and then a set of[
]
braces around the main content. - Remove the extra text at intervals of 100 users (ex. 100th username, 200th username, etc.).
- Remove the numbers by finding
^\d+[:]
and replacing it with a blank string using theRegular expression
search mode. - Optional: Tab the JSON file until it has the correct indentation.
-
Validate the JSON files using the online JSON Formatter.
-
Use an online JSON to CSV Converter and convert the files to CSV or Excel format.
Optional: Merge the separate Excel files into one spreadsheet and format the spreadsheet (sorting, styling, etc.) into a user friendly format.