Import: import ig "github.com/felipeinf/instago". Create clients with ig.NewClient().
Method
Notes
NewClient()
New client with defaults
PreLoginFlow()
Optional warm-up before login
Login(user, pass, verificationCode)
Empty code if no 2FA
LoginFlow()
Light post-login calls
GetReelsTrayFeed(reason) / GetTimelineFeed(reason, maxID)
Feeds, pagination via maxID
Logout()
End session
LoadSettings(path, overrideAppVersion) / DumpSettings(path)
Persist session on Client
LoadSettingsFromFile / DumpSettingsToFile
Package-level JSON without a live client
c := ig .NewClient ()
if err := c .Login ("user" , "pass" , "" ); err != nil { /* handle */ }
_ = c .DumpSettings ("session.json" )
c2 := ig .NewClient ()
_ = c2 .LoadSettings ("session.json" , false )
SetLogger, SetProxy, SetLocale, SetTimezoneOffset, SetDeviceSettings, SetUserAgent, SetUUIDs.
Method
Notes
AccountInfo()
Logged-in user (Account)
a , err := c .AccountInfo ()
Method
Notes
UserIDFromUsername(username)
Resolve PK
UserInfoByUsername(username, useCache)
Main high-level profile
UserInfo(userID, useCache)
By numeric id
UserInfoByUsernameGQL / UserInfoByUsernameV1
Lower-level paths
SearchUsersV1 / SearchUsersFB
User search
u , err := c .UserInfoByUsername ("instagram" , true )
Media, feed, reels, download
Method
Notes
UserMedias
High level (GQL + fallback)
UserMediasWithSleep / UserMediasGQL / UserMediasV1
Explicit backend / pacing
UserMediasPaginatedGQL / UserMediasPaginatedV1
Single page + cursor
RankToken()
Pagination helper for some feeds
MediaInfoV1
One post by PK
PhotoDownload / PhotoDownloadByURL
Save photo to disk
UserClipsV1 / UserClipsPaginatedV1
Reels (clips)
DownloadToFile
Generic HTTP GET to file
StoryDownload / StoryDownloadByURL
Story assets
items , err := c .UserMedias (userID , 12 )
m , err := c .MediaInfoV1 (mediaPK )
path , err := c .PhotoDownload (mediaPK , "out" , "folder" )
Method
Notes
UserStories / UserStoriesV1
Story reels for a user
StoryInfo(storyPK)
One story item
Method
Notes
DirectInboxChunk(opt)
Inbox page; see DirectInboxOptions
DirectPendingChunk / DirectSpamChunk
Pending / spam
DirectThreadPage(threadID, opt)
Messages in a thread
DirectSendText / DirectSendPhoto / DirectSendVideo
Outgoing
DirectPhotoRupload / DirectVideoRupload
Low-level upload steps
DirectMessageMediaURL(m)
Package function — pick URL from a DirectMessage
Defaults: inbox ~20 threads, ~10 preview messages per thread; thread page limit ~20 (server-defined).
threads , next , err := c .DirectInboxChunk (ig.DirectInboxOptions {})
full , _ , err := c .DirectThreadPage (threadID , ig.DirectThreadOptions {})
Comments
Method
Notes
MediaCommentsFirstPage
First page
MediaCommentsFetch / MediaCommentsNext
Pagination with min/max ids
Method
Notes
FriendshipWith
Status flags
Follow / Unfollow
Mutate relationship
MutualFriendsPage
Mutual followers
UserFollowersPage
Followers list + cursor
FbsearchTopsearchFlat, FbsearchRecent, FbsearchSuggestedProfiles, FbsearchPlaces, SearchHashtags, SearchMusic.
Public / web (limited auth)
Method
Notes
PublicRequest / PublicGraphqlRequest
Unauthenticated HTTP / GraphQL
WebProfileInfo
web_profile_info JSON
FetchPasswordEncryptionKeys
For custom login flows
Method
Notes
ChallengeGET / ChallengePOST
Challenge URL flows
PrivateRequest(opts)
Any private endpoint; see PrivateRequestOpts
Client.LastJSON — last decoded private JSON
Client.LastHTTPResponse — last HTTP response when set
Client.OverrideAppVersion — set before LoadSettings to replace stored app build
Use igerrors with errors.As (e.g. TwoFactorRequired, LoginRequired).