Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cihatksm/instagram-follower-and-following-statistics
By analyzing your followers and following on Instagram, those who do not follow you and users you do not follow are shown.
https://github.com/cihatksm/instagram-follower-and-following-statistics
Last synced: 5 days ago
JSON representation
By analyzing your followers and following on Instagram, those who do not follow you and users you do not follow are shown.
- Host: GitHub
- URL: https://github.com/cihatksm/instagram-follower-and-following-statistics
- Owner: CihatKsm
- Created: 2023-04-16T18:20:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-21T22:03:41.000Z (8 months ago)
- Last Synced: 2024-04-20T19:52:47.646Z (7 months ago)
- Language: JavaScript
- Homepage: https://cihatksm.com
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🪄 Get Instagram Follower and Following Statistics
### ⚠️ The user is entirely responsible for the use of this code. The codes are clear and editable. No responsibility can be assumed on my behalf in this regard.
🔵 To use the code, first go to Instagram's official website from your browser normally and log in. Open the developer tools in your browser, paste the following code into the console section and press enter. You can get information from the published articles.```javascript
//First we get the application id
const appIdLocation = document.body.innerHTML?.indexOf('"X-IG-App-ID":');
const appId = document.body.innerHTML?.slice(appIdLocation, appIdLocation + 100)?.split(',')[0]?.replaceAll(`"`, '')?.split(':')[1];//Now we get the user id
const userIdLocation = document.body.innerHTML?.indexOf('"appScopedIdentity":');
const userId = document.body.innerHTML?.slice(userIdLocation, userIdLocation + 100)?.split(',')[0]?.replaceAll(`"`, '')?.split(':')[1];//Now we are getting your followers and following
let followers = [], followersChecked = false;
let following = [], followingChecked = false;//Getting followers list and posting list
function getFollowers(max_id) {
fetch(`https://www.instagram.com/api/v1/friendships/${userId}/followers/?count=12${max_id ? ('&max_id=' + max_id) : ''}&search_surface=follow_list_page`, {
"headers": {
"x-ig-app-id": appId,
},
"method": "GET",
}).then((data) => data?.json()).then((data) => {
followers = [...followers, ...data?.users];
if (data.next_max_id) getFollowers(data.next_max_id);
else followersChecked = true;
})
}//Getting following list and posting list
function getFollowing(max_id) {
fetch(`https://www.instagram.com/api/v1/friendships/${userId}/following/?count=12${max_id ? ('&max_id=' + max_id) : ''}&search_surface=follow_list_page`, {
"headers": {
"x-ig-app-id": appId,
},
"method": "GET",
}).then((data) => data?.json()).then((data) => {
following = [...following, ...data?.users];
if (data.next_max_id) getFollowing(data.next_max_id);
else followingChecked = true;
})
}//Starting control
getFollowers();
getFollowing();console.clear();
console.log('##################################')
console.log('Control started!');let interval1 = setInterval(() => {
console.log('- Number of followers found:', followers.length);
console.log('- Number of followers found:', following.length);if (followersChecked && followingChecked) {
clearInterval(interval1);
console.clear();
console.log('Finished control');//Fixing data
followers = followers.map(f => f.username);
following = following.map(f => f.username);//Regenerating data
const x = following.filter(f => !followers.includes(f));
const y = followers.filter(f => !following.includes(f));//Output
console.log('People you follow but they don\'t follow you:', x);
console.log('Those who follow you but you don\'t follow:', y);
}
}, 1000);
```