pystagram.graph_api package

Subpackages

Submodules

pystagram.graph_api.graph_api module

Instagram Graph API

The Instagram Graph API allows users of your app to access data in their [Instagram Business](https://business.instagram.com/) and [Instagram Creator](https://help.instagram.com/2358103564437429) accounts. The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by components Instagram users, find hashtagged media, and get basic metadata and metrics about components Instagram Businesses and Creators.

class pystagram.graph_api.graph_api.InstagramGraphApi(app_id: int, app_secret: str, access_token: str | None = None, base_uri: str | None = 'graph.facebook.com', api_version: str | None = 'v18.0')

Bases: InstagramBaseApiClient

Client for making requests to the Instagram Graph API. It extends the pystagram.helpers.api_client.base_api_client.InstagramBaseApiClient class.

Parameters:
  • app_id (int) – The app ID of the Instagram app.

  • app_secret (str) – The app secret of the Instagram app.

  • access_token (str, optional) – The access token of the Instagram app, defaults to None

  • base_uri (str, optional) – The base URL of the Instagram Graph API, defaults to BASE_URI

  • api_version (str, optional) – The version of the Instagram Graph API, defaults to API_VERSION

API_VERSION: str = 'v18.0'

The version of the Instagram Graph API.

BASE_URI: str = 'graph.facebook.com'

The base URL of the Instagram Graph API.

MAX_PAGES: int = 5

The maximum number of pages to get from paginated endpoints.

property comment

The Comment node of the Instagram Graph API. See the pystagram.graph_api.endpoints.comment.comment.Comment class for additional details.

property container

The Container node of the Instagram Graph API. See the pystagram.graph_api.endpoints.container.container.Container class for additional details.

get_user_id()

Get the user ID of the Instagram user.

Returns:

The user ID of the Instagram user.

Return type:

str

property hashtag

The Hashtag node of the Instagram Graph API. See the pystagram.graph_api.endpoints.hashtag.hashtag.Hashtag class for additional details.

The HashtagSearch node of the Instagram Graph API. See the pystagram.graph_api.endpoints.hashtag_search.HashtagSearch class for additional details.

property me

The Me node of the Instagram Graph API. See the pystagram.graph_api.endpoints.me.me.Me class for additional details.

property media

The Media node of the Instagram Graph API. See the pystagram.graph_api.endpoints.media.media.Media class for additional details.

property oauth

The OAuth node of the Instagram Graph API. See the pystagram.graph_api.endpoints.oauth.oauth.Oauth class for additional details.

property user

The User node of the Instagram Graph API. See the pystagram.graph_api.endpoints.user.user.User class for additional details.

property user_id

The user ID of the Instagram user. The user id is fetched from the Instagram Graph API if it is not already set.

Module contents