We Are Trying from Instagram Importing Instagramy from Python but It's Not Working

I want to scrape the data from Instagram different public and private accounts. But when I run the following code.

from instagramy import Instagram


# Connecting the profile
user = Instagram("ihtishamKhattak")

# printing the basic details like
# followers, following, bio
print(user.is_verified())
print(user.popularity())
print(user.get_biography())

# return list of dicts
posts = user.get_posts_details()

print('\n\nLikes', 'Comments')
for post in posts:
    likes = post["likes"]
    comments = post["comment"]
    print(likes,comments)

1

2 Answers

You can have a look at the instagramy pypi page.

There is no Instagram python module. Also make sure, that you have no script calles instagramy.py

change your script to

from instagramy import InstagramUser


# Connecting the profile
user = InstagramUser("ihtishamKhattak")

Beware that this might work only for few request if you do not provide a Session ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest