Skip to content

Instantly share code, notes, and snippets.

@nfelger
Created December 18, 2012 16:35
Show Gist options
  • Save nfelger/4329505 to your computer and use it in GitHub Desktop.
Save nfelger/4329505 to your computer and use it in GitHub Desktop.
Download all your Instagram snaps.

Requirements

Get an Instagram access token

  • The easiest way to get on may be making a request via the API console: http://instagram.com/developer/api-console/
  • Under 'Authentication', choose OAuth 2 and follow the instructions.
  • Choose any request and hit the red 'Send' button.
  • Under 'Request' on the left, you should be able to find your access token, if you look closely. It looks a little like this: 123456789.1a2b3c4.1234567890abcdef1234567890abcdef

Get your instagram user ID

Download your pictures

Now you're all set. Open your Terminal.app and paste in this, all on one line, replacing YOUR_ACCESS_TOKEN with your Instagram access token, and YOUR_USER_ID with your number Instagram user ID:

for url in `curl -s 'https://api.instagram.com/v1/users/YOUR_USER_ID/media/recent?count=500&access_token=YOUR_ACCESS_TOKEN' | jq '.data[] | {url: .images.standard_resolution.url}.url' | sed 's/"//g' `; do curl -O $url; done

The pictures will end up in your home directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment