-
-
Save Karn/65d074f5c94bd39782c8fe5b2751a7a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetch_profile(self, primary_key): | |
response = requests.get('https://i.instagram.com/api/v1/users/{}/info/'.format(primary_key), | |
headers={ | |
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36', | |
'dnt': '1', | |
'pragma': 'no-cache', | |
'x-ig-app-id': '936619743392459' | |
}) | |
if (response.status_code != 200): | |
return None | |
res = response.json() | |
if 'user' in res: | |
return res['user'] | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment