Skip to content

Instantly share code, notes, and snippets.

@kepatopoc
Forked from mki/get_instagram_user_id.py
Created November 14, 2016 10:09
Show Gist options
  • Save kepatopoc/ca2b5643d480ecc2a56ac7dcc4cca391 to your computer and use it in GitHub Desktop.
Save kepatopoc/ca2b5643d480ecc2a56ac7dcc4cca391 to your computer and use it in GitHub Desktop.
import requests
r = requests.get('https://api.instagram.com/v1/users/search?q=mkispb&count=1&access_token=...')
user_id = None
for user in r.json()['data']:
if user['username'] == 'mkispb':
user_id = user['id']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment