Skip to content

Usage Guide

This section provides detailed descriptions of all the ways instagrapi can be used. If you are new to instagrapi, the Getting Started page provides a gradual introduction of the basic functionality with examples.

Public vs Private Requests

  • Public web methods have a suffix _gql (Instagram GraphQL). Some _gql helpers use newer doc_id queries when Instagram disables legacy query_hash endpoints. Legacy ?__a=1 helpers were removed because that public web response is no longer reliable.
  • Private (authorized request via mobile api) methods have _v1 suffix

Public web flows are opportunistic, not guaranteed. Instagram can change or block them independently of the library.

Many high-level helpers try a public/web path first and then use a private/authenticated fallback when that makes sense for the current session.

Not every high-level helper has a public and private twin. Some newer flows are private-only, while some lookup helpers use an internal fallback chain and choose the best currently working path for the session.

Private bandwidth metadata

Private requests default to X-IG-Bandwidth-Speed-KBPS: -1.000, X-IG-Bandwidth-TotalBytes-B: 0 and X-IG-Bandwidth-TotalTime-MS: 0 because the library does not measure download bandwidth. Speed represents an estimate; byte and time counters represent cumulative accepted download samples, so speed need not equal their ratio. Existing explicit headers on private_request() and private_headers({...}) for uploads can override these defaults without changing later default requests. These values do not guarantee rate-limit avoidance or account recovery.

Detailed Sections