Getting Instagram profile details using Python Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Instagram is a photo and video-sharing social networking service owned by Facebook. 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 BeautifulSoup here.Modules required and Installation:Requests : Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs. pip install requests Beautiful Soup: Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree. pip install beautifulsoup4 Explanation - For a given user name data scraping will be done then parsing of data will be done so that output can be readable. The output will be description i.e followers count, following count, count of posts.Below is the implementation - Python3 # importing libraries from bs4 import BeautifulSoup import requests # instagram URL URL = "https://www.instagram.com/{}/" # parse function def parse_data(s): # creating a dictionary data = {} # splitting the content # then taking the first part s = s.split("-")[0] # again splitting the content s = s.split(" ") # assigning the values data['Followers'] = s[0] data['Following'] = s[2] data['Posts'] = s[4] # returning the dictionary return data # scrape function def scrape_data(username): # getting the request from url r = requests.get(URL.format(username)) # converting the text s = BeautifulSoup(r.text, "html.parser") # finding meta info meta = s.find("meta", property ="og:description") # calling parse method return parse_data(meta.attrs['content']) # main function if __name__=="__main__": # user name username = "geeks_for_geeks" # calling scrape function data = scrape_data(username) # printing the info print(data) Output : {'Followers': '120.2k', 'Following': '0', 'Posts': '702'} Comment More infoAdvertise with us Next Article Getting Instagram profile details using Python R rakshitarora Follow Improve Article Tags : Python Web Technologies Python-BS3 Web-scraping Python web-scraping-exercises +1 More Practice Tags : python Similar Reads Instagram Bot using Python and InstaPy In this article, we will design a simple fun project âInstagram Botâ using Python and InstaPy. As beginners want to do some extra and learning small projects so that it will help in building big future projects. Now, this is the time to learn some new projects and a better future. This python projec 3 min read Instagram-explore module in Python instagram-explore module is an Instagram scrapping module. Installation: Run the following pip command : pip install instagram-explore This module has 8 functions currently for exploring Instagram: Getting user informationGetting tagGetting user imagesGetting locationsLocationLocation imagesMediaMed 2 min read Post a picture automatically on Instagram using Python Prerequisites: Python Programming LanguageInstagram is a photo and video-sharing social networking service owned by Facebook, Python provides powerful tools for interacting with Instagram. In this article, we will come to know how we can post a picture automatically on the Instagram account just by 2 min read Make an Instagram Bot With Python Instagram is a powerful social media tool that you can use for marketing or networking. However, to successfully do any of that you need to have a good heavy follower base. You can't simply share a post with 50 followers and call it successful marketing. No matter what your goals are, having a large 6 min read Python Tweepy - Getting the name of a user In this article we will see how we can get the name of a user. Name is the display name of the twitter account. It is the name that users choose to identify themselves on the network. Many users choose to either use their real name as the basis for their display name. Unlike screen names, the names 2 min read Like