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 and Instagram Creator 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.PystagramGraphApi(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: PystagramBaseApiClient

Client for making requests to the Instagram Graph API. It extends the pystagram.helpers.api_client.base_api_client.InstagramBaseApiClient class. :param app_id: The app ID of the Instagram app. :type app_id: int :param app_secret: The app secret of the Instagram app. :type app_secret: str :param access_token: The access token of the Instagram app, defaults to None :type access_token: str, optional :param base_uri: The base URL of the Instagram Graph API, defaults to BASE_URI :type base_uri: str, optional :param api_version: The version of the Instagram Graph API, defaults to API_VERSION :type api_version: str, optional

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 = None

The maximum number of pages to get from paginated endpoints, defaults to None (no limit).

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