Thursday, October 2, 2025
HomeLanguagesScrape Instagram using Instagramy in Python

Scrape Instagram using Instagramy in Python

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.

Installation

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

Python3




from instagramy import InstagramUser
 
 
# Connecting the profile
user = InstagramUser("Lazyroar_for_Lazyroar")
 
# 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)


Output:

Example 2: Analysing the data

Python3




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


Output:

 

RELATED ARTICLES

Most Popular

Dominic
32331 POSTS0 COMMENTS
Milvus
85 POSTS0 COMMENTS
Nango Kala
6703 POSTS0 COMMENTS
Nicole Veronica
11867 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11927 POSTS0 COMMENTS
Shaida Kate Naidoo
6818 POSTS0 COMMENTS
Ted Musemwa
7080 POSTS0 COMMENTS
Thapelo Manthata
6775 POSTS0 COMMENTS
Umr Jansen
6776 POSTS0 COMMENTS