1

Does anyone know how to grab the live Instagram follower count of a user? I want to embed the live count of a particular user into an HTML webpage but can not figure out how.

Would appreciate any help and tips.

fatihyildizhan
  • 8,614
  • 7
  • 64
  • 88
  • Does this answer your question? [How to get other pages followers count number in Instagram?](https://stackoverflow.com/questions/34906301/how-to-get-other-pages-followers-count-number-in-instagram) – leepowers May 07 '20 at 23:03

1 Answers1

1

This is an example for getting the user info for a user with id #1362124742 using the Instagram API and token, for more info on using the Instagram API checkout this blog post

var token = '1362124742.7b33a8d.6613a3567f0a425f9852055b8ef743b7',
  container2 = document.getElementById('rudr_userinfo'),
  scrElement2 = document.createElement('script');

window.mishaProcessResult2 = function(response) {
  container2.innerHTML = '<div><p>#' + response.data.id + '</p>' +
    '<p>' + response.data.counts.media + ' media ' + response.data.counts.followed_by + ' followers ' + response.data.counts.follows + ' follows</p>' +
    '</div>';
}

scrElement2.setAttribute('src', 'https://api.instagram.com/v1/users/self?access_token=' + token + '&callback=mishaProcessResult2');
document.body.appendChild(scrElement2);
* {
  color: #262626;
  background-color: #fafafa;
  font-size: 18px;
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-weight: 300;
}

#rudr_userinfo {
  display: flex;
}
<ul id="rudr_userinfo"></ul>
dqve
  • 646
  • 6
  • 18