Package: pinsta
🤖 Pinsta - Simple Instagram APIThis package lets you use Instagram's Internal Web API through simple functions and classes. Pinsta uses Instagram's Original Web API to scrape data which makes it a reliable choice over other third-party scrapers. This library mainly focuses on Simplicity & Reliability.Two type of classes are supported -Guest & Host.📢 Announcements[#02]AutoHostis released! Authentication update to theHost Class.[#01]Users can now log in through theirUsernameandPasswordto generate SessionId!See thisInstallationTo install this package usingPython's PIP, run this command in a terminal window:$pipinstallpinstaTo update the existing package, run:$pipinstallpinsta--upgrade🧔🏻‍♂️ Guest ModeThis mode doesn't require login and can be used to fetch publicly available data from Instagram's Servers. Following methods are supported till now:Check if username is available for registrationFetch someone's profile dataConvert username to useridConvert userid to usernameHere's an example where an instance ofGuest Classis created to fetchCristiano Ronaldo'sprofile information:frompinstaimportGuestguest=Guest()profile=guest.profile("cristiano")ifprofileisNone:print("Something went wrong.")else:print(profile.biography)print(profile.follower_count)print(profile.following_count)🧔🏻‍♂️ Host ModeHost mode requires login through SessionID, which should be passed as an argument during initialization.
It can be used to take actions that require login. Additionally, users can manage their own profile through this class.These are the methods supported till now:Check authentication status of the userFollow/unfollow usersFetch someone's follower/following listSwitch account type - 'Public' or 'Private'Here's an example where an instance ofHost Classis created to followCristiano Ronaldo'saccount:frompinstaimportHost,NewSessionIDsessionid=NewSessionID("username","password")host=Host(sessionid)status=host.follow("cristiano")ifstatusisNone:print("Something went wrong.")else:ifstatus.following:print("Following!")elifstatus.follow_requested:print("Requested to follow!")Note:When you create a new sessionid throughNewSessionID(), it's recommended to save it somewhere, and use the same sessionid (instead of creating a new one each time you need) until it expires or becomes invalid.This should be done to avoid unnecessary prolonged wait time while generating a new sessionid and also to prevent getting your account from getting flagged because of repetitive logins.📋 RememberEvery function should returnNoneon failure. So, it's recommended to add anif statementbefore using the actual data to avoid TypeErrors. Here's an example:frompinstaimportGuestguest=Guest()available=guest.username_availability("cristiano")ifavailableisNone:# 'None' indicates failureprint("Something went wrong.")else:print(available)❤️ DonateIf you wish to help me in the development of Pinsta, consider donating:DisclaimerThis is a third-party package, and not approved by Instagram. It doesn't promote illegal activities or activities that violateInstagram's Community Guidelinessuch as spamming users, creating bot accounts, misusing data etc. You are solely responsible for all the actions you take using this package.