Get Instagram Account Details using Python With Source Code
![Get Instagram Account Details using Python](https://codewithcurious.com/wp-content/uploads/2023/02/Handwritten-Notes-56-1024x576.png)
Introduction :
Hello Curious Coders,
In this Project we are going to fetch the details of an Instagram Account. There is pre defined package in python named instaloader which is going to allow us to scrape through the instagram account of someone. Let’s get into it…..
Source Code :
# Import instaloader package
import instaloader
# creating an Instaloader() object
ig=instaloader.Instaloader()
# Taking the instagram username as input from user
usrname=input("Enter username:")
#Fetching the details of provided useraname using instaloder object
profile=instaloader.Profile.from_username(ig.context, usrname)
# Printing the fetched details and storing the profile pic of that account
print("Username: ", profile.username)
print("Number of Posts Uploaded: ", profile.mediacount)
print(profile.username+" is having " + str(profile.followers)+' followers.')
print(profile.username+" is following " + str(profile.followees)+' people')
print("Bio: ", profile.biography)
instaloader.Instaloader().download_profile(usrname,profile_pic_only=True)
Code Explanation :
- Initially installed the instaloader package from cmd using command“pip install instaloader”
- We imported the required package instaloader
- Next we created an instaloader object
- Later we acquired username from the user using input() function
- Then we fetched all the details of the instagram user using Profile.from_username() method of instaloader package.
- Finally displayed all the fetched results on to the console.
Output :
![Get Instagram Account Details using Python](https://codewithcurious.com/wp-content/uploads/2023/02/cwc6-1024x362.png)
*The Profile pic is selected in the same folder where your python file is saved in the folder which is same as user name on your system as follows….
![Profile Pic](https://codewithcurious.com/wp-content/uploads/2023/02/2021-12-28_08-07-42_UTC_profile_pic.jpg)
Find More Projects
Resume Builder Application using Java With Source Code Graphical User Interface [GUI] Introduction: The Resume Builder Application is a powerful and user-friendly …
Encryption Tool using java with complete source Code GUI Introduction: The Encryption Tool is a Java-based GUI application designed to help users …
Movie Ticket Booking System using Java With Source Code Graphical User Interface [GUI] Introduction: The Movie Ticket Booking System is a Java …
Video Call Website Using HTML, CSS, and JavaScript (Source Code) Introduction Hello friends, welcome to today’s new blog post. Today we have …
promise day using html CSS and JavaScript Introduction Hello all my developers friends my name is Gautam and everyone is welcome to …
Age Calculator Using HTML, CSS, and JavaScript Introduction Hello friends, my name is Gautam and you are all welcome to today’s new …