Last active
December 18, 2015 19:49
-
-
Save anderser/5836099 to your computer and use it in GitHub Desktop.
Retrieve video urls from Instagram API using instagram python client. Has to use the raw json response since the python client does not yet support video.
This file contains hidden or 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
api = client.InstagramAPI(client_id=CONFIG['client_id'], client_secret=CONFIG['client_secret']) | |
instagen, pages = api.tag_recent_media(30, 0, "thetag", max_pages=1, return_json=True) | |
videos = [] | |
for item in instagen: | |
if "videos" in item: | |
videos.append( | |
{'user': item['user']['username'], | |
'videourl': item['videos']['standard_resolution'] | |
} | |
) | |
videos_json = json.dumps(videos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment