Skip to content
Related Articles
Open in App
Not now

Related Articles

Scrape Instagram using Instagramy in Python

Improve Article
Save Article
  • Difficulty Level : Hard
  • Last Updated : 17 May, 2022
Improve Article
Save Article

In this article, we will learn how can we get Instagram profile details using web scraping. Python provides powerful tools for web scraping, we will be using Instagramy here. This tool is specifically made for Instagram and also analyzes the data using Pandas.


The python package Instagramy is used to scrape Instagram quick and easily. This package is installed by running the following command. Based on the network connection it scrapes the data for you.

pip install instagramy

Example 1: Scraping basic details


from instagramy import InstagramUser
# Connecting the profile
user = InstagramUser("geeks_for_geeks")
# printing the basic details like
# followers, following, bio
# return list of dicts
posts = user.get_posts_details()
print('\n\nLikes', 'Comments')
for post in posts:
    likes = post["likes"]
    comments = post["comment"]


Example 2: Analysing the data


from instagramy import Instalysis
# Instagram user_id of ipl teams
teams = ["chennaiipl", "mumbaiindians",
         "royalchallengersbangalore", "kkriders",
         "delhicapitals", "sunrisershyd",
data = Instalysis(teams)
# return the dataframe
data_frame = data.analysis()



My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!