If you want to work with Instagrapi (business interests), we strongly advise you to prefer HikerAPI project. However, you won't need to spend weeks or even months setting it up. The best service available today is HikerAPI, which handles 4–5 million daily requests, provides support around-the-clock, and offers partners a special rate. In many instances, our clients tried to save money and preferred instagrapi, but in our experience, they ultimately returned to HikerAPI after spending much more time and money. It will be difficult to find good accounts, good proxies, or resolve challenges, and IG will ban your accounts.
The instagrapi more suits for testing or research than a working business!
✨ aiograpi - Asynchronous Python library for Instagram Private API ✨
Features:
Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver) without selenium. Use the most recent version of the API from Instagram, which was obtained using reverse-engineering with Charles Proxy and Proxyman.
Instagram API valid for 16 Dec 2023 (last reverse-engineering check)
Support Python >= 3.9
For any other languages (e.g. C++, C#, F#, D, Golang, Erlang, Elixir, Nim, Haskell, Lisp, Closure, Julia, R, Java, Kotlin, Scala, OCaml, JavaScript, Crystal, Ruby, Rust, Swift, Objective-C, Visual Basic, .NET, Pascal, Perl, Lua, PHP and others), I suggest using instagrapi-rest
Support Chat in Telegram and GitHub Discussions
pip install instagrapi
from instagrapi import Client
cl = Client()
cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD)
user_id = cl.user_id_from_username(ACCOUNT_USERNAME)
medias = cl.user_medias(user_id, 20)
Media
- Publication (also called post): Photo, Video, Album, IGTV and ReelsResource
- Part of Media (for albums)MediaOembed
- Short version of MediaAccount
- Full private info for your account (e.g. email, phone_number)TOTP
- 2FA TOTP helpers (generate seed, enable/disable TOTP, generate code as Google Authenticator)User
- Full public user dataUserShort
- Short public user data (used in Usertag, Comment, Media, Direct Message)Usertag
- Tag user in Media (coordinates + UserShort)Location
- GEO location (GEO coordinates, name, address)Hashtag
- Hashtag object (id, name, picture)Collection
- Collection of medias (name, picture and list of medias)Comment
- Comments to MediaHighlight
- HighlightsNotes
- NotesStory
- StoryStoryLink
- Link StickerStoryLocation
- Tag Location in Story (as sticker)StoryMention
- Mention users in Story (user, coordinates and dimensions)StoryHashtag
- Hashtag for story (as sticker)StorySticker
- Tag sticker to story (for example from giphy)StoryBuild
- StoryBuilder return path to photo/video and mention co-ordinatesDirectThread
- Thread (topic) with messages in Direct MessageDirectMessage
- Message in Direct MessageInsight
- Insights for a postTrack
- Music track (for Reels/Clips)To release, you need to call the following commands:
python setup.py sdist
twine upload dist/*