Python Tkinter GUI Script to Make Instagram User Details App Using Instagram API Full Project For Beginners

Python Tkinter GUI Script to Make Instagram User Details App Using Instagram API Full Project For Beginners


Welcome folks today in this post we will be building a instagram user details app using instagram api inside tkinter gui app in python.



Get Started




In order to get started you need to install python inside your system.


After installing python you need to install tkinter module using pip like below.


pip install tkinter


And now we need to make a file and copy paste the following code



from tkinter import *
import tkinter as tk
import requests

root = tk.Tk()
root.title("Instagram User Details")

def search():
        u_name = user.get()
        url = f"{u_name}/?__a=1"
        data = requests.get(url).json()

        def pic():
                import webbrowser
                d = data['graphql']['user']['profile_pic_url']

        if details.get(1.0,END) != "":
                details.insert(1.0,f"\t username : {data['graphql']['user']['username']} \n     followers : {data['graphql']['user']['edge_followed_by']['count']}      following : {data['graphql']['user']['edge_follow']['count']} \n   full name : {data['graphql']['user']['full_name']} \n Total post : {data['graphql']['user']['edge_owner_to_timeline_media']['count']}  category : {data['graphql']['user']['category_enum']} \nbio-link:{data['graphql']['user']['external_url']}private account:{data['graphql']['user']['is_private']} || verified account:{data['graphql']['user']['is_verified']}  bussiness account:{data['graphql']['user']['is_business_account']}  \n \n   see profile picture" )

                Button(innerframe1,text="click to see",relief=RAISED,borderwidth=2,font=('verdana',8,'bold'),bg='#248aa2',fg="white",command=pic).place(x=180,y=145)



frame = Frame(root,width=400,height=300,relief=RIDGE,borderwidth=5,bg='#248aa2'),y=0)

innerframe = LabelFrame(frame,width=380,height=50,relief=RIDGE,borderwidth=3,bg='#248aa2',highlightbackground="white", highlightcolor="white", highlightthickness=2),y=5)

user = Entry(frame,width=30,relief=RIDGE,borderwidth=3),y=15)

search = Button(frame,text="Search",relief=RAISED,borderwidth=2,font=('verdana',8,'bold'),bg='#248aa2',fg="white",command=search),y=15)

innerframe = LabelFrame(frame,width=380,height=240,relief=RIDGE,borderwidth=3,bg='#248aa2',highlightbackground="white", highlightcolor="white", highlightthickness=2),y=45)

innerframe1 = LabelFrame(innerframe,text="Users Details",width=370,height=230,highlightbackground="white", highlightcolor="white", highlightthickness=5,font=('verdana',10,'bold')),y=0)

details = Text(innerframe1,height=12,width=47,relief=RIDGE,borderwidth=5,highlightbackground="white", highlightcolor="white",font=('courier',9,'')),y=5)



READ  Python 3 Tkinter Checkbutton Widget Example to Add List of Checkboxes Options inside GUI Desktop App Full Project For Beginners



Here if you run this python script by executing the below command









And now you can see that we have a input field where you will write the person instagram username and then click the search button to get the details inside the textarea.





And now to see the profile picture of the user just click the button click to see and then it will open the browser and you will see the person picture







Leave a Reply