Skip to content

Instantly share code, notes, and snippets.

@atao
Created August 6, 2019 08:23
Show Gist options
  • Save atao/dceeb08612da8f02b4ec6d55659e257a to your computer and use it in GitHub Desktop.
Save atao/dceeb08612da8f02b4ec6d55659e257a to your computer and use it in GitHub Desktop.
Get number of instagram followers
import requests
import re
username = "UserProfile"
try:
r = requests.get('https://www.instagram.com/'+username)
followers = re.findall( r'userInteractionCount":"(\d*)"', r.text)
user = re.findall( r'alternateName":"@(\w+)', r.text)
print("@"+ user[0], ":", followers[0], "followers")
except:
print("Instagram Error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment