Python Client for Instagram API
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits ahead, 204 commits behind facebookarchive:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A Python client for the Instagram REST and Search APIs


pip install instagram


  • httplib2
  • simplejson

Follow @instagramapi on Twitter

You can follow @instagramapi on Twitter for announcements, updates, and news about the Instagram gem.

Obtaining an access token

You can use the provided script to obtain an access token for yourself. It will prompt you for your app's Client ID, Client Secret, and Redirect URI, and walk you through instructions for getting your own access token for your app.


from instagram.client import InstagramAPI

access_token = "..."
api = InstagramAPI(access_token=access_token)
popular_media = api.popular_media(count=20)
for media in popular_media:
    print media.images['high_resolution'].url

Sample app

We also provide a one-file sample app using bottle (you'll have to 'pip install bottle' first). To try it out:

  • Set your redirect URI to 'http://localhost:8515' in your dev profile
  • Open up, update it with your client_id and secret
  • Run the file; it will host a local server on port 8515.
  • Try visiting http://localhost:8515 in your browser