Created
November 9, 2015 16:27
-
-
Save foresmac/0771ac2722bc0445c4c5 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
import json | |
import urllib.request | |
hashtag = '' # Choose any hashtag | |
ACCESS_TOKEN = '' # Get a token from https://instagram.com/developer | |
start_url_string = 'https://api.instagram.com/v1/tags/{0}/media/recent?access_token={1}' | |
start_url = start_url_string.format(hashtag, ACCESS_TOKEN) | |
response = urllib.request.urlopen(start_url) | |
raw_data = response.read() | |
data = json.loads(raw_data) | |
pics = data['data'] | |
urls = [pic['images']['standard_resolution']['url'] for pic in pics] | |
print urls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment