igflare ​
Classes ​
| Class | Description |
|---|---|
| AccountSuspendedError | The account is suspended. Retrying does not help. |
| BadPasswordError | The password is wrong. |
| CaaTwoFactorRequiredError | A CAA/Bloks login that stopped at the two-factor step. Besides the raw response (in payload.raw) it carries the account access context the login obtained, which the code submission must echo back, so resolving it needs nothing else. |
| ChallengeRequiredError | Instagram wants a verification (a code or a check in the app) before it goes on. |
| ClientForbiddenError | A 403 that is not an expired session: the account may not do this. |
| ClientJsonError | The response body could not be parsed as JSON. |
| ClientSchemaError | A response parsed as JSON but did not match the endpoint's schema. Carries the raw decoded body so a caller can inspect what drifted, instead of leaking a raw zod error. |
| FakeTransport | A transport driven by a handler. Records every request for assertions. |
| FeedbackRequiredError | Instagram blocked this action for now ("try again later"), often after doing it too often. |
| FetchTransport | A transport backed by the runtime's global fetch. Fetch adds the browser sec-fetch-* headers, which the private API rejects, so Instagram calls go through HttpsTransport. This one is kept for generic use and testing. |
| FileSessionStore | Persists the session as a JSON file on disk. |
| HttpsTransport | The default transport, over Node's http/https. Unlike global fetch it does not inject browser sec-fetch-* headers, which the private API rejects. Sends exactly the headers it is given and decompresses gzip/deflate/br responses. |
| IgApiError | A failed private-API call, carrying the status and the parsed error payload. |
| IgError | Base error for everything this SDK throws. Never throw raw strings. |
| IgFlare | The ergonomic entry point. Wraps the low-level engine and groups the endpoints by domain (ig.user.*, ig.friendship.*, ig.feed.*, ig.media.*). Persistence is pluggable: pass any SessionStore (memory, file, or a provider adapter) as store. The transport retries transient failures by default. |
| IgResponseError | Thrown when the API answers with a non-success status. |
| InvalidVerificationCodeError | The one-time code submitted at a login challenge or two-factor step was not accepted. |
| LoginRequiredError | The session expired or was logged out (login_required). Log in again. |
| MemorySessionStore | Keeps the session in memory. Useful for tests and short-lived processes. |
| PleaseWaitError | "Please wait a few minutes before you try again": too many attempts in a row. |
| PrivateClient | Ties the three seams together: build a request, send it, update the session. |
| RateLimitError | Too many requests in a short time. Slow down before the next one. |
| RetryTransport | An HttpTransport decorator that retries transient failures with exponential backoff and full jitter. It retries on connection errors, HTTP 429/502/503/504, and the "please wait" rate-limit body, honoring a Retry-After header when present. It does not retry 500 (ambiguous) or other 4xx (client errors). The retry set is method-agnostic: the SDK's mutations are idempotent (follow/like) or carry an idempotence token (comment), and every retryable signal means the request was rejected rather than applied. |
| SentryBlockError | The request was flagged as automated. |
| TwoFactorRequiredError | A login stopped at the two-factor step. |
Interfaces ​
| Interface | Description |
|---|---|
| AccountApi | The logged-in account itself. |
| Activity | The activity feed as the app shows it: what is new, what was already seen. |
| AlbumUploadOptions | Options for a carousel post. |
| ApiErrorPayload | What a typed API error carries from the response. |
| AuthState | Auth material gained after login. Everything here is optional before login. |
| BaseHeadersInput | What the headers sent on every request are built from. |
| BloksActionOptions | Overrides for one Bloks action call. |
| CaaLoginCredentials | The username and password for a login. |
| CaaLoginOptions | Options for a login. |
| Challenge | An open challenge: where to answer it and what the server sent. |
| CollectionApi | The account's saved-posts collections and the posts it has liked. |
| CollectionPageOptions | Paging for a collection. |
| CommentListOptions | Paging for a list of comments or posts. |
| CommentOptions | Options for a comment. |
| ContentInsightsOptions | The dates an account report covers. It ends now and starts 30 days earlier by default. |
| CreateHighlightOptions | Options for a new highlight. |
| CreateNoteOptions | Options for a note. |
| CreateSessionOptions | Parts of a new session to set instead of the defaults. |
| CursorOptions | Paging for a list. |
| DeviceProfile | The hardware/system/app profile the client presents as. Stable per install. |
| DeviceState | The random per-install identifiers. Persist these to keep one logical device. |
| DirectApi | Direct messages: the inbox, a thread's messages, and sending. |
| EditHighlightOptions | What to change in a highlight. Leave a field out to keep it. |
| EditMediaOptions | What to change in a post. Leave a field out to keep it. |
| EncryptPasswordOptions | Inputs for encrypting a password the way the app does before login. |
| EndpointDefinition | One REST endpoint of the private API. A path may hold {placeholders} for ids. |
| ExploreApi | The Explore tab. |
| ExploreOptions | Paging for the Explore feed. |
| FeedApi | Media feeds. |
| FeedOptions | Paging for a feed. |
| FollowListOptions | Paging for a follower, following or request list. |
| FriendshipApi | The follow graph: relationship actions and the follower/following lists. |
| GenerateUsdidOptions | Inputs for creating the device identity (USDID) the login flow registers. |
| HashtagApi | What a hashtag's own page shows. |
| HideThreadOptions | Options for declining a message request. |
| HighlightApi | Story highlights on a profile. Reading is open to anyone who may see the profile. |
| HttpRequest | One HTTP request as a transport sends it. |
| HttpResponse | One HTTP response with the body decoded to text. |
| HttpsTransportOptions | How the default transport connects. |
| HttpTransport | The HTTP seam. Everything that talks to the network goes through this port so the request and response layers can be tested without touching the network. |
| IgFlareOptions | Construction options for IgFlare. |
| ImageSize | The pixel size of an image. |
| InsightsApi | Insights of a professional (business or creator) account's own media. |
| InsightsRange | The dates an account report covers. It ends now and starts 30 days earlier by default. |
| LocationApi | Places: a location's own page, and the places near a coordinate. |
| LocationState | Sent on every request and kept stable per account. |
| LoginCredentials | The credentials for the older login endpoint. |
| MediaApi | Single media reads and actions. |
| MuteOptions | Which of a user's content to mute; omit both to mute posts and stories. |
| NotesApi | Notes: the short text over a profile picture in the inbox. |
| Page | The shape every paginated list endpoint returns: one page of items plus the cursor for the next page. nextCursor is absent on the last page. This is the low-level primitive. Callers that want to walk the whole list opt into the paginate iterator rather than looping the cursor by hand. |
| PasswordPublicKey | The server key the password is encrypted for, as login hands it out. |
| PhotoUploadOptions | Options for a photo post. |
| PrivateClientOptions | How a PrivateClient is built: transport, session store and session-expiry hook. |
| PrivateRequestInput | Everything a private-API request is built from, the session included. |
| PrivateResponseJson | A parsed private-API answer. The fields named here are the ones the error mapping reads. |
| ReactionOptions | Options for a reaction. |
| ReelsApi | Reels: what a user posted, and the feeds of the Reels tab. |
| ReelsPageOptions | Paging for a reels feed. |
| ReelUploadOptions | Options for a reel. |
| RegistrationTokenOptions | Inputs for the token that registers a USDID identity. |
| ReplyListOptions | Paging for the replies to a comment. |
| RetryOptions | Tuning for RetryTransport. All fields have conservative defaults. |
| SaveOptions | Where to save a post. |
| SearchApi | Discovery search across users, hashtags and places. |
| SessionData | Everything needed to resume one logical account without logging in again. |
| SessionStore | Loads and persists a session. One of the three swappable seams. |
| ShareMediaOptions | Options for sharing a post. |
| Signer | Builds the signed payload the private API expects. Isolated on purpose: this is the layer most likely to change, so everything that signs goes through this port and is pinned by golden vectors. |
| StoryApi | Stories. |
| TotpOptions | Code length, step and time for a TOTP code. The defaults match authenticator apps. |
| TwoFactorOptions | What a two-factor login on the older endpoint takes. |
| UploadApi | Publishing media. |
| UsdidHeaderOptions | Inputs for the signed USDID header sent on requests. |
| UsdidIdentity | The local P-256 signing identity behind the X-Meta-Usdid header and the USDID registration token the current Android app presents during CAA login. The private key never leaves the client. Only signatures and the public key are sent. Persist these fields to keep one stable identity across logins. |
| UserApi | Reads about any user. |
| UserReelsOptions | Paging for a user's reels. |
| UserTag | Where on the photo a person is tagged, as fractions of its width and height. |
| VideoMeta | What an upload needs to know about an MP4: duration and frame size. |
| VideoUploadOptions | Options for a video post. |
| VoiceOptions | Options for a voice message. |
Type Aliases ​
| Type Alias | Description |
|---|---|
| AccountInsights | The account overview, as parsed by accountInsightsSchema. |
| ActivityItem | One entry of the activity feed. |
| AlbumItem | One picture of an album: a photo, or a video with its cover. |
| AudienceInsights | The audience report, as parsed by audienceInsightsSchema. |
| BioLink | One link of the profile. |
| BodyEncoding | How the request body is encoded. signed is the default private-API body (signed_body=SIGNATURE.<json>). form url-encodes the payload as plain form fields, which the Bloks endpoints expect (they are sent unsigned). |
| Collection | A saved-posts collection. |
| Comment | A comment, as parsed by commentSchema. |
| ContentInsight | One item of the content list, as parsed by contentInsightSchema. |
| DirectMessage | One message of a direct thread. |
| DirectSendResult | Where a sent message landed: its thread, item id and time. |
| EndpointName | The name of every endpoint in the manifest. |
| FakeHandler | Answers each request a FakeTransport receives. |
| FriendshipStatus | How the account relates to a user, as parsed by friendshipStatusSchema. |
| Hashtag | A hashtag, as parsed by hashtagSchema. |
| Highlight | A story highlight, as parsed by highlightSchema. |
| HttpMethod | The HTTP methods the private API uses. |
| IgFlareLogin | What login takes: the account credentials and, optionally, the second-factor source. |
| InsightMetric | One insights figure, as parsed by insightMetricSchema. |
| InsightsContentType | The kind of media the content list holds. Leave it out for all of them. |
| InsightsTime | A moment as a Date or as Unix seconds. |
| Location | A place, as parsed by locationSchema. |
| LocationInfo | A place with its details, as parsed by locationInfoSchema. |
| Media | A post, reel or story, as parsed by mediaSchema. |
| MediaInsights | The insights of a post or reel, as parsed by mediaInsightsSchema. |
| Note | A note, as parsed by noteSchema. |
| NoteAudience | Who may see a note. |
| PrivateRequestOptions | One request to the private API, without the session, which the client adds. |
| RecipientSearchMode | Which recipients to search: everyone the account can message (universal) or the ones for disappearing photos (raven). |
| Reel | A user's active stories, as parsed by reelSchema. |
| SendTarget | Where a direct message is sent: an existing thread, or one or more user ids. |
| Thread | A direct thread, as parsed by threadSchema. |
| TwoFactorSource | Where the one-time code comes from: a literal code, a base32 TOTP secret the SDK turns into the current authenticator code, or a function that asks the caller (for example, prompting a person for an SMS or email code). |
| User | A user profile, as parsed by userSchema. |
Variables ​
| Variable | Description |
|---|---|
| accountInsightsSchema | The account's overview for a date range: views, interactions, reach and visits. |
| activityItemSchema | One entry of the activity feed (a like, a comment, a new follower, a mention, ...). story_type says which kind it is. The app has dozens and adds them often, so the kind stays a number and everything else passes through untouched. |
| API_DOMAIN | The host of the private API. |
| ATTESTATION_KEYSTORE_ERROR | The error code the app reports when the hardware keystore attestation is unavailable. The CAA login flow accepts this degraded state, so the client presents it instead of a real hardware-backed attestation. |
| audienceInsightsSchema | Who follows the account: how many, their ages, places and when they are online. |
| bioLinkSchema | One link in a profile's link list. link_id is normalized to a string id. |
| CAA_API_DOMAIN | The domain the CAA/Bloks login flow talks to. |
| CHALLENGE_EMAIL | The challenge method that sends the code by email. |
| CHALLENGE_SMS | Verification channels for the common challenge flow. |
| collectionSchema | A saved-posts collection. Besides the ones a person makes, the app lists automatic ones (all saved posts, products). collection_type tells them apart. |
| commentSchema | A comment as the create endpoint returns it. Lean and lenient: only the exposed fields are typed, the rest pass through, and each is optional because the API's shape varies by context. The author is the shared User model. |
| contentInsightSchema | One post, reel or story in the content list, with the figures the list was sorted by. |
| contentPageSchema | One page of the content list. |
| DEFAULT_DEVICE_PROFILE | The Android device and app build this client presents itself as. |
| DEFAULT_LOCATION | The locale, country and time zone a new session reports. |
| directMessageSchema | One item in a direct thread. Lean and lenient: item_type distinguishes the payload (text, media, like, link, ...), so most fields are optional. Timestamps arrive as microsecond strings and are kept as strings. |
| directSendResultSchema | The result of sending a direct message. |
| endpoints | Every endpoint the SDK calls, by name. |
| friendshipStatusSchema | The relationship between the logged-in account and another user, as the private API reports it on the friendships endpoints. Only the fields the SDK exposes are typed. The rest pass through, and each is optional because the API includes a different subset per endpoint and context. |
| hashtagSchema | A hashtag as search and tag feeds return it. Lean and lenient. |
| highlightSchema | A story highlight. id is the app's form, highlight:123. The functions that take a highlight accept that or the bare 123. A highlight read on its own also carries its stories under items. One listed on a profile does not. |
| insightMetricSchema | One figure of an insights screen, with the text the app shows next to it. value is null when the figure does not apply yet, and the text is then "--". The server sends the value under 1fvalue. The endpoints strip that marker before parsing. |
| locationInfoSchema | What a single location's own page knows: contact details, category and post count. |
| locationSchema | A place/location as search and location feeds return it. Lean and lenient. |
| mediaInsightsSchema | What the account's own insights say about one post or reel. The counts are for the whole life of the media. Reels add the watch figures (avg_watch_time, performance_factors). Only professional accounts have these, and only for their own media. |
| mediaSchema | A media post as the feed endpoints return it. A lean first cut: only the fields the SDK exposes are typed, the rest pass through, and each is optional/nullable because the API's shape varies by media type (photo/video/carousel) and context. media_type is 1 = photo, 2 = video, 8 = carousel. The author is the shared User model. |
| noteSchema | A note: the short text that sits over a profile picture in the inbox for a day. audience is 0 for mutual followers and 1 for close friends. The times are Unix seconds. |
| reelSchema | A story reel: a user's current story and its media items. Lean and lenient, reusing the User and Media models. The reels tray returns one per user with an active story. The user story endpoint returns a single reel. |
| threadSchema | A direct thread. The inbox returns threads with a last_permanent_item. The thread endpoint fills items. The author list is the shared User model. |
| USDID_TOKEN_TTL | The token time-to-live the app uses for USDID material, in seconds. |
| userSchema | A user as the private API returns it. Only the fields the SDK exposes are typed. Everything else passes through untouched so an upstream addition does not break callers. The API omits or nulls fields depending on privacy and context, so the types say so rather than overpromising. pk arrives as a number or a string and is normalized to a string id. |
Functions ​
| Function | Description |
|---|---|
| addCloseFriend | Adds a user to the close friends list. |
| addThreadUsers | Adds users to a group thread. |
| applyResponseToSession | Pulls refreshed auth material out of response headers into the session. |
| approveRequest | Approves a pending follow request from a user. |
| approveThread | Approves a pending thread (a message request), moving it to the main inbox. |
| archiveMedia | Archives a post: it leaves the profile and moves to the archive. |
| base64url | URL-safe base64 with the padding stripped, as the app encodes these values. |
| blockUser | Blocks a user. |
| bloksAsyncAction | Performs a Bloks async action: posts the form-encoded Bloks payload to bloks/async_action/<action>/ and returns the parsed response. Bloks requests are sent unsigned, so the body is plain form fields. |
| buildAttestationParams | Builds the X-IG-Attest-Params value sent during CAA login: a single keystore attestation entry in the accepted "unavailable" state, carrying the server-issued challenge nonce. Returns an empty string when no nonce is known (the server has not been asked for one yet). |
| buildBaseHeaders | The stable X-IG-* headers derived from the device and profile. Live, time or session-based headers (pigeon timestamp, zero-rating, region hints) are added by the request layer once auth lands. |
| buildPrivateRequest | Builds a signed private-API request from the session. Pure: no network. |
| buildSignedBody | The signed_body=SIGNATURE.<json> form body the app sends. |
| buildUsdidHeader | Builds the three-part signed X-Meta-Usdid value: <usdid>.<expiresAt>.<sig>, where the signature covers <usdid>.<expiresAt>. |
| buildUsdidRegistrationToken | Builds the ES256 registration token the app sends to register its USDID public key: a JWS-shaped envelope, itself base64url-encoded. |
| buildUserAgent | The User-Agent the app sends for a device profile. |
| caaLogin | Logs in through Instagram's current Android CAA/Bloks flow, which replaced the retired accounts/login/ endpoint. Registers the device's USDID key, runs the CAA preflight (account access context + keystore attestation), then sends the encrypted password. On success the session carries the user id and the authorization token. When the account needs a two-factor code, the login resolves it itself if options.twoFactor says where the code comes from; otherwise a CaaTwoFactorRequiredError is thrown, to be resolved with resolveCaaTwoFactor. |
| commentMedia | Posts a comment (or a reply, with repliedToCommentId) and returns the created comment. |
| createCollection | Creates a collection, optionally holding some posts from the start. |
| createDeviceState | Generates a fresh device state. Pass saved ids in overrides to restore one. |
| createGroupThread | Creates a group thread and returns its id. Instagram needs at least two other participants for a group. With one, send to that user instead. |
| createHighlight | Creates a highlight from some of the account's own stories (still on, or archived). |
| createNote | Posts a note (a short text, up to 60 characters) and returns it. |
| createSession | A new session with a fresh device and nothing logged in. |
| createSigner | The default signer, which builds the signed body. |
| deleteCollection | Deletes a collection. The posts in it stay saved. |
| deleteComment | Deletes a comment from a media by the comment's id. |
| deleteComments | Deletes several comments of a media in one request. |
| deleteHighlight | Deletes a highlight. The stories in it are not deleted. |
| deleteMedia | Deletes one of the logged-in account's own media by its id. |
| deleteMessage | Deletes one of the account's messages from a thread (unsends it). |
| deleteNote | Deletes a note by its id (the note_id of a note the account posted). |
| denyRequest | Denies (ignores) a pending follow request from a user. |
| editHighlight | Changes a highlight: its title, its stories or its cover. |
| editMedia | Edits the caption of one of the account's posts, and optionally tags or untags people. Returns the updated media. Tags are only sent when asked for, so a caption edit never changes them. |
| encryptPassword | Encrypts a password the way the app does: an RSA-wrapped AES-256-GCM session key over the password, packed as #PWD_INSTAGRAM:4:<ts>:<base64>. The public key comes from the launcher/sync response headers. |
| fetchPasswordPublicKey | Fetches the current password encryption key from the launcher/sync headers. |
| findThreadByParticipants | The existing thread with exactly these participants, or undefined when there is none. |
| followUser | Follows a user by id. Returns the resulting friendship status. |
| generateAndroidDeviceId | A new Android device id (android- and 16 hex digits). |
| generateTotp | Generates the current RFC 6238 time-based one-time password (HMAC-SHA1) for a base32 secret, the same code an authenticator app shows. Uses node:crypto only. |
| generateUsdidIdentity | Generates (or restores, via overrides) a USDID identity. |
| generateUuid | A new random UUID. |
| getAccountInsights | The account overview for a date range: views, interactions, reach, profile visits. |
| getActivity | Reads the activity feed (likes, comments, new followers, mentions): what is new and what was already seen, first page. It never marks anything as seen. |
| getAudienceInsights | The account's audience for a date range: followers, ages, places and active times. |
| getBioLinks | The links listed on the logged-in profile (empty when there are none). |
| getCollectionMedias | One page of the posts in a collection. Pass cursor to continue. |
| getCommentReplies | One page of the replies to a comment. Pass cursor from a previous page to continue. |
| getComments | One page of a media's comments. Pass cursor from a previous page to continue. |
| getContentInsights | One page of the account's posts, reels or stories ranked by a figure. Pass cursor to continue. |
| getCurrentUser | Fetches the logged-in account's own profile. Requires a logged-in session. It is the simplest way to confirm the captured authorization is accepted. |
| getExploreFeed | One page of the Explore feed. Pass cursor to continue. |
| getExploreReels | One page of the reels Instagram suggests (the explore reels). |
| getFollowers | One page of a user's followers. Pass cursor from a previous page to continue. |
| getFollowing | One page of the accounts a user follows. Pass cursor to continue. |
| getFriendshipStatus | Reads the relationship with a user by id. friendships/show/ returns the status fields at the top level, so the whole response is validated. |
| getFriendsReels | One page of the reels friends interacted with. |
| getHashtagFeed | One page of the posts listed for a hashtag, ranked by relevance (there is no chronological view). Posts come in the light form the search grid uses. See getHashtagSerpPage. Pass cursor to continue. |
| getHashtagInfo | What a hashtag's page shows: its name and how many posts use it. Following a hashtag is not offered: Instagram retired it, and the old calls only answer ok without effect. |
| getHighlight | One highlight with its stories. |
| getInbox | One page of the direct inbox (threads). Pass cursor to continue. |
| getLikedMedias | One page of the posts the account has liked. Pass cursor to continue. |
| getLikers | The users who liked a media (the ranked first page). |
| getLocationFeed | One page of a location's recent media. Pass cursor to continue. |
| getLocationInfo | A location's own page: contact details, category and how many posts are tagged there. |
| getMediaInfo | Fetches one media by its full id (the pk_userid composite the feed returns). media/{id}/info/ wraps the media in a one-element items array. The single item is validated into the Media model. A missing item or a shape mismatch surfaces as a typed error. |
| getNotes | The notes in the inbox tray: the account's own and those of followed accounts. |
| getPendingInbox | One page of the pending inbox (message requests). Pass cursor to continue. |
| getPendingRequests | One page of incoming follow requests. Pass cursor to continue. |
| getPostInsights | Insights of one of the account's own posts: views, reach, interactions, where views came from. |
| getReelInsights | Insights of one of the account's own reels: the post figures plus watch time and rates. |
| getReelsFeed | One page of the Reels tab feed. |
| getReelsTray | The story tray: one reel per account the session follows that has an active story. |
| getSavedPosts | One page of the account's saved posts. Pass cursor (a max_id) to continue. |
| getSpamInbox | One page of the spam inbox (hidden requests). Pass cursor to continue. |
| getThread | One page of a thread's messages (newest first). Pass cursor to continue. |
| getTimelineFeed | One page of the home timeline. Pass cursor from a previous page to continue. |
| getUserFeed | One page of a user's own posts. Pass cursor from a previous page to continue. |
| getUserInfo | Fetches a user's profile by id. Returns the validated User model. A missing user or a response that does not match the schema surfaces as a typed error. |
| getUserInfoByUsername | Fetches a user's profile by username. Returns the same validated User model. |
| getUserReels | One page of a user's reels. Pass cursor to continue. |
| getUserStories | A user's current story media, newest last. Returns an empty array when the user has no active story (the reel is null). |
| hideThread | Hides (deletes from the inbox) a thread. |
| jazoest | The login anti-automation parameter: 2 followed by the sum of char codes. |
| likeComment | Likes a comment by its id. |
| likeMedia | Likes a media by its full id. Resolves on success; throws a typed error otherwise. |
| listCollections | Lists the account's collections, the automatic ones included. |
| listHighlights | The highlights on a profile (without their stories; read one for those). |
| login | Logs in with username and password. On success the session carries the user id and the authorization token, and is persisted if the client has a store. Two-factor, challenge and bad-password responses surface as typed errors. |
| markMessageSeen | Marks a message, and the thread up to it, as seen. |
| markStoriesSeen | Marks stories as seen, so the account appears among the owner's viewers. Takes the full story ids (pk_userid), the id of each story media. |
| muteThread | Mutes a thread's notifications. |
| muteUser | Mutes a user's posts and/or stories (both by default). |
| paginate | Walks every page of a cursor-paginated endpoint, yielding items one by one. fetchPage takes the cursor (undefined for the first page) and returns a Page. Iteration stops when a page has no nextCursor. |
| paginateCollectionMedias | Walks the posts of a collection, one at a time across pages. |
| paginateCommentReplies | Walks every reply to a comment, yielding one at a time across pages. |
| paginateComments | Walks a media's comments, yielding one at a time across pages. |
| paginateContentInsights | Walks the whole content list, one item at a time across pages. |
| paginateExploreFeed | Walks the Explore feed, one post at a time across pages. |
| paginateExploreReels | Walks the explore reels, one at a time across pages. |
| paginateFollowers | Walks every follower of a user, yielding one at a time across pages. |
| paginateFollowing | Walks every account a user follows, yielding one at a time across pages. |
| paginateHashtagFeed | Walks a hashtag's media, yielding one at a time across pages. |
| paginateInbox | Walks every thread in the inbox, yielding one at a time across pages. |
| paginateLikedMedias | Walks the posts the account has liked, one at a time across pages. |
| paginateLocationFeed | Walks a location's media, yielding one at a time across pages. |
| paginatePendingInbox | Walks every pending thread (message requests), one at a time across pages. |
| paginatePendingRequests | Walks every incoming follow request, yielding one at a time across pages. |
| paginateReelsFeed | Walks the Reels tab feed, one reel at a time across pages. |
| paginateSavedPosts | Walks the account's saved posts, yielding one at a time across pages. |
| paginateSpamInbox | Walks every spam thread (hidden requests), one at a time across pages. |
| paginateThread | Walks every message in a thread, yielding one at a time across pages. |
| paginateTimeline | Walks the home timeline, yielding one media at a time across pages. |
| paginateUserFeed | Walks every post of a user, yielding one at a time across pages. |
| paginateUserReels | Walks a user's reels, one at a time across pages. |
| parseJpegSize | Reads a JPEG's pixel dimensions from its start-of-frame marker. Pure and dependency-free: it walks the segment markers without decoding the image. |
| parseMp4Meta | Reads a video's duration and pixel dimensions from an MP4's moov metadata, without decoding the stream. Best-effort and dependency-free. Throws when the boxes are not found so the caller can supply the values instead. |
| parsePrivateResponse | Parses a private-API response, throwing a typed error on failure. |
| parseSessionData | Parses untrusted JSON (a stored file) into a SessionData, or throws. |
| pinComment | Pins a comment to the top of one of the account's own posts. |
| pinMedia | Pins a post to the top of the profile grid. |
| quotePlus | Matches Python's urllib.parse.quote_plus: unreserved kept, space as +. |
| reactToMessage | Adds, or removes, an emoji reaction on a message of a thread. |
| removeBioLinks | Removes profile links by id (the link_id of each entry in getBioLinks). |
| removeCloseFriend | Removes a user from the close friends list. |
| removeFollower | Removes a user from the account's followers (they stop following it, without a block). |
| removeProfilePicture | Removes the profile picture (back to the default avatar) and returns the updated profile. |
| resolveCaaTwoFactor | Completes a CAA login that stopped at the two-factor step by driving the Bloks code-entry screens and submitting the code. On success the session carries the user id and the authorization, exactly as after a login with no second factor. Pass the error caaLogin threw and the code to submit, or a source for it. A source is asked only after the code-entry screen has opened: when the code is delivered out of band (an email or SMS), opening that screen is what makes the server send it, so it cannot be known earlier. |
| resolveTwoFactorCode | Resolves a TwoFactorSource to the code string to submit. |
| saveMedia | Saves a media to the account's saved posts, or to one of its collections. |
| searchHashtags | Searches hashtags by a free-text query, returning the ranked matches. |
| searchNearby | The places near a coordinate, nearest first as the server ranks them. |
| searchPlaces | Searches places by a free-text query, returning the matched locations. |
| searchRecipients | Searches the people the account can message, ranked, for a free-text query. |
| searchUsers | Searches users by a free-text query, returning the ranked matches. |
| selectChallengeMethod | Chooses a verification channel (CHALLENGE_SMS or CHALLENGE_EMAIL); sends the code. |
| sendLink | Sends a message whose text contains a link, so it renders as a link preview. |
| sendPhoto | Sends a JPEG photo into a thread (or the existing thread with the given users). |
| sendText | Sends a text message to a thread or to users, returning the send result. |
| sendVideo | Sends an MP4 video (H.264 video, AAC audio) into a thread, or into the existing thread with the given users. |
| sendVoice | Sends a voice message (an .m4a AAC clip) into a thread or the thread with the users. |
| setBiography | Sets the logged-in account's biography and returns the updated profile. |
| setBioLink | Sets the profile link and returns the list as the profile now holds it. The profile keeps a list. This adds an external link to it. accounts/edit_profile/ ignores external_url, which is why this goes through its own endpoint. |
| setName | Changes the display name of the logged-in account and returns the updated profile. Instagram allows only a couple of name changes per 14 days. A refused change throws the server's own message. |
| setProfilePicture | Replaces the profile picture with a JPEG and returns the updated profile. |
| setThreadTitle | Renames a group thread. |
| shareMedia | Shares a post (by its full media id) into a thread or to users. |
| shareProfile | Shares a profile (by user id) into a thread or to users. |
| shareStory | Shares a story (by its full id, pk_ownerPk) into a thread or to users. Only stories visible to the account can be shared. |
| signUsdid | Signs a message with the identity key: ECDSA over SHA-256, DER-encoded. |
| startChallenge | Opens the challenge referenced by a ChallengeRequiredError. Covers the common select-method / submit-code flow. Bloks and contact-form variants are not handled here. Their details are in the response data, for the caller to drive. |
| submitChallengeCode | Submits the verification code. On success the session is finalized and persisted. |
| twoFactorLogin | Completes a login that returned TwoFactorRequired by submitting the code. On success the session carries the user id and authorization, and is persisted. |
| unarchiveMedia | Brings an archived post back to the profile. |
| unblockUser | Unblocks a user. |
| unfollowUser | Unfollows a user by id. Returns the resulting friendship status. |
| unlikeComment | Removes a like from a comment. |
| unlikeMedia | Removes a like from a media by its full id. |
| unmuteThread | Unmutes a thread's notifications. |
| unmuteUser | Unmutes a user's posts and/or stories (both by default). |
| unpinComment | Unpins a pinned comment. |
| unpinMedia | Unpins a post from the top of the profile grid. |
| unsaveMedia | Removes a media from the account's saved posts, or from one of its collections. |
| uploadAlbum | Publishes 2 to 10 photos and videos as one carousel post. Every item is uploaded first, then one configure call publishes them together. That call is retried while a video is still being transcoded. |
| uploadPhoto | Publishes a JPEG as a feed photo: uploads the bytes, then configures the post. The dimensions are read from the JPEG, so the caller passes only bytes and an optional caption. |
| uploadReel | Publishes an MP4 as a reel. The caller supplies the cover JPEG (frame extraction needs a decoder, which the SDK does not bundle). Duration and size are read from the MP4 unless given. The steps are the app's: the upload settings, the video, the cover, then the configure call, retried while the server is still transcoding. |
| uploadStoryPhoto | Publishes a JPEG as a story. Dimensions are read from the JPEG. |
| uploadVideo | Publishes an MP4 as a feed video. The caller supplies a cover JPEG (frame extraction needs a decoder, which the SDK does not bundle). Duration and dimensions are read from the MP4 unless given in options. Configure is retried while the server is still transcoding. |
| usdidPublicKeyDer | The DER SubjectPublicKeyInfo for the identity's public key. |