pystagram.graph_api.endpoints.user package
Submodules
pystagram.graph_api.endpoints.user.available_catalogs module
- class pystagram.graph_api.endpoints.user.available_catalogs.AvailableCatalogs(user: User)
Bases:
object
The AvailableCatalogs node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(user_id: str | None = None, fields: List[str | CatalogFields] | None = None, access_token: str | None = None)
Get the product catalog in an IG User’s Instagram Shop. :param user_id: The ID of the user to get available catalogs from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param fields: A list of
pystagram.graph_api.components.fields.catalog_fields.CatalogFields
to get from the available catalogs, defaults to None :type fields: Optional[List[Union[str, CatalogFields]]], optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/available_catalogs endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.business_discovery module
- class pystagram.graph_api.endpoints.user.business_discovery.BusinessDiscovery(user: User)
Bases:
object
The BusinessDiscovery node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(username: str, fields: List[str | UserFields] | None = None, user_id: str | None = None, access_token: str | None = None)
Get data about another Instagram Business or Creator Instagram User. :param username: The username of the Instagram Business or Creator Instagram User. :type username: str :param fields: A list of
pystagram.graph_api.components.fields.user_fields.UserFields
to get from the user, defaults to None :type fields: Optional[List[Union[str, UserFields]]], optional :param user_id: The ID of the user to get fields and edges from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id} endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.catalog_product_search module
- class pystagram.graph_api.endpoints.user.catalog_product_search.CatalogProductSearch(user: User)
Bases:
object
The CatalogProductSearch node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(catalog_id: int | None = None, q: str | None = None, user_id: str | None = None, access_token: str | None = None)
Get a collection of products that match a given search string within the targeted IG User’s Instagram Shop catalog. :param catalog_id: The ID of the catalog to search products from, defaults to None :type catalog_id: int, optional :param q: The search string to match products with, defaults to None :type q: Optional[str], optional :param user_id: The ID of the user to search products from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/catalog_product_search endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.content_publishing_limit module
- class pystagram.graph_api.endpoints.user.content_publishing_limit.ContentPublishingLimit(user: User)
Bases:
object
The ContentPublishingLimit node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(user_id: str | None = None, fields: List[str | PublishingLimitFields] | None = None, since: Timestamp | Strtotime | None = None, access_token: str | None = None)
Get the number of times an IG User has published and IG Container within a given time period. :param user_id: The ID of the user to get the content publishing limit from, inferred from the User instance if None, defaults to None :type user_id: str, optional :param fields: A list of
pystagram.graph_api.components.fields.publishing_limit_fields.PublishingLimitFields
to get from the user, defaults to None :type fields: Optional[List[Union[str, PublishingLimitFields]]], optional :param since: The start time to get the content publishing limit from, defaults to None :type since: Optional[Union[Timestamp, Strtotime]], optional :param access_token: The access token of the Instagram user, inferred from the User instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/content_publishing_limit endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.insights module
- class pystagram.graph_api.endpoints.user.insights.Insights(user: User)
Bases:
object
The Insights node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(metric: List[InsightMetrics], period: Periods, since: Timestamp | Strtotime | None = None, until: Timestamp | Strtotime | None = None, user_id: str | None = None, access_token: str | None = None)
Get insights on an Instagram user
- Parameters:
metric (List[InsightMetrics]) – A list of
pystagram.graph_api.components.metrics.insight_metrics.InsightMetrics
to get insights on.period (Periods) – The period of time to get insights from.
since (Optional[Union[Timestamp, Strtotime]], optional) – The start time of the insights, defaults to None
until (Optional[Union[Timestamp, Strtotime]], optional) – The end time of the insights, defaults to None
user_id (str, optional) – The ID of the user to get insights from, inferred from the User instance if None, defaults to None
access_token (str, optional) – The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None
- Returns:
The response from the GET /{user-id}/insights endpoint.
- Return type:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.live_media module
- class pystagram.graph_api.endpoints.user.live_media.LiveMedia(user: User)
Bases:
object
The LiveMedia node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(user_id: str | None = None, fields: List[str | MediaFields] | None = None, since: Timestamp | Strtotime | None = None, until: Timestamp | Strtotime | None = None, access_token: str | None = None)
Get a collection of live video IG Media on an IG User. :param user_id: The ID of the user to get live videos from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param fields: A list of
pystagram.graph_api.components.fields.media_fields.MediaFields
to get from the live videos, defaults to None :type fields: Optional[List[Union[str, MediaFields]]], optional :param since: The Unix timestamp of the earliest live video to get, defaults to None :type since: Optional[Union[Timestamp, Strtotime]], optional :param until: The Unix timestamp of the latest live video to get, defaults to None :type until: Optional[Union[Timestamp, Strtotime]], optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/live_videos endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.media module
- class pystagram.graph_api.endpoints.user.media.Media(user: User)
Bases:
object
The Media node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
:param max_pages: The maximum number of pages to get from paginated endpoints, defaults to 5 :type max_pages: int, optional- create(container: Type[BaseContainer], user_id: str | None = None, access_token: str | None = None)
Create an image, carousel, story or reel Instagram Container. :param container: The container to create on the Instagram user. Can be an instance of the
ImageContainer
,VideoContainer
,CarouselContainer
,StoryContainer
orReelContainer
classes. :type container: Type[BaseContainer] :param user_id: The ID of the user to create the container on, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the POST /{user-id}/media endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
- delete()
[Not Supported] Delete an Instagram Media. :raises InstagramApiNotSupportedError: Instagram user media deletion is not supported by the Instagram Graph API.
- get(user_id: str | None = None, access_token: str | None = None, limit: int | None = 25, after: str | None = None, before: str | None = None)
Get a collection of IG Media on an IG User. Paginated endpoint. :param user_id: The ID of the user to get media from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :param limit: The number of media to get per page, defaults to 25 :type limit: int, optional :param after: The cursor to get the next page of media, defaults to None :type after: str, optional :param before: The cursor to get the previous page of media, defaults to None :type before: str, optional :return: The response from the GET /{user-id}/media endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
- update(*args, **kwargs)
[Not Supported] Update an Instagram Media. :raises InstagramApiEndpointError: User media update is only supported by the Media node
pystagram.graph_api.endpoints.user.media_publish module
- class pystagram.graph_api.endpoints.user.media_publish.MediaPublish(user: User)
Bases:
object
The MediaPublish node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- create(container_id: str, user_id: str | None = None, access_token: str | None = None)
Publish an Instagram Media Container. :param container_id: The ID of the container to publish on the Instagram user. :type container_id: str :param user_id: The ID of the user to publish the container on, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the POST /{user-id}/media_publish endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.mentionned_comment module
- class pystagram.graph_api.endpoints.user.mentionned_comment.MentionedComment(user: User)
Bases:
object
The MentionedComment node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(comment_id: str, fields: List[str | CommentFields] | None = None, user_id: str | None = None, access_token: str | None = None)
Get data on an Instagram Comment in which an Instagram User has been @mentioned by another Instagram user. Paginated endpoint. :param comment_id: The ID of the comment to get data from. :type comment_id: str :param fields: A list of
pystagram.graph_api.components.fields.comment_fields.CommentFields
to get from the comment, defaults to None :type fields: Optional[List[Union[str, CommentFields]]], optional :param user_id: The ID of the user to get the mentioned comment from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/mentioned_comment endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.mentionned_media module
- class pystagram.graph_api.endpoints.user.mentionned_media.MentionedMedia(user: User)
Bases:
object
The MentionedMedia node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- get(media_id: int, fields: List[str | MediaFields] | None = None, user_id: str | None = None, access_token: str | None = None)
Get data on an Instagram Media in which an Instagram User has been @mentioned in a caption by another Instagram user. Paginated endpoint. :param media_id: The ID of the media to get data from. :type media_id: int :param fields: A list of
pystagram.graph_api.components.fields.media_fields.MediaFields
to get from the media, defaults to None :type fields: Optional[List[Union[str, MediaFields]]], optional :param user_id: The ID of the user to get the mentioned media from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/mentioned_media endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.mentions module
- class pystagram.graph_api.endpoints.user.mentions.Mentions(user: User)
Bases:
object
The Mentions node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- create(media_id: str, message: str, comment_id: str | None = None, user_id: str | None = None, access_token: str | None = None)
Creates an Instagram Comment on an Instagram Media or Instagram comment in which an Instagram User has been @mentioned in. :param media_id: The ID of the media where the user was mentioned. :type media_id: str :param message: The comment message. :type message: str :param user_id: The ID of the user to mention, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the POST /{user-id}/mentions endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.product_appeal module
- class pystagram.graph_api.endpoints.user.product_appeal.ProductAppeal(user: User)
Bases:
object
The ProductAppeal node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- create(appeal_reason: str, product_id: str, user_id: str | None = None, access_token: str | None = None)
Create an appeal for a rejected product. :param appeal_reason: The reason for the appeal. :type appeal_reason: str :param product_id: The ID of the product to appeal. :type product_id: str :param user_id: The ID of the user to appeal the product for, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the POST /{user-id}/product_appeal endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
- get(product_id: str, user_id: str | None = None, access_token: str | None = None)
Get appeal status of a rejected product. :param product_id: The ID of the product to get appeal status from. :type product_id: str :param user_id: The ID of the user to get the appeal status from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id}/product_appeal endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.user.stories module
- class pystagram.graph_api.endpoints.user.stories.Stories(user: User)
Bases:
object
The Stories node of the Instagram Graph API. :param user: An instance of the
User
class. :type user:User
- create(*args, **kwargs)
[Not Supported] Create a story Instagram Media. :raises InstagramApiEndpointError: User story creation is supported by the User Media node
- delete(*args, **kwargs)
[Not Supported] Delete a story Instagram Media. :raises InstagramApiNotSupportedError: Instagram user story deletion is not supported by the Instagram Graph API.
- get(user_id: str | None = None, access_token: str | None = None)
Get a collection of story Instagram Media objects on an Instagram User. :param user_id: The ID of the user to get stories from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :return: The response from the GET /{user-id}/stories endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
- update(*args, **kwargs)
[Not Supported] Update a story Instagram Media. :raises InstagramApiNotSupportedError: Instagram user story update is not supported by the Instagram Graph API.
pystagram.graph_api.endpoints.user.user module
- class pystagram.graph_api.endpoints.user.user.User(graph_api: PystagramGraphApi)
Bases:
object
The User node of the Instagram Graph API. :param graph_api: An instance of the
InstagramGraphApi
class. :type graph_api:InstagramGraphApi
- property available_catalogs
The AvailableCatalogs node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.available_catalogs.AvailableCatalogs
class for additional details.
- property business_discovery
The BusinessDiscovery node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.business_discovery.BusinessDiscovery
class for additional details.
- property catalog_product_search
The CatalogProductSearch node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.catalog_product_search.CatalogProductSearch
class for additional details.
- property content_publishing_limit
The ContentPublishingLimit node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.content_publishing_limit.ContentPublishingLimit
class for additional details.
- get(user_id: str | None = None, fields: List[str | UserFields] | None = None, access_token: str | None = None)
Get fields and edges on an Instagram Business or Creator Account. :param user_id: The ID of the user to get fields and edges from, inferred from the InstagramGraphApi instance if None, defaults to None :type user_id: str, optional :param fields: A list of
pystagram.graph_api.components.fields.user_fields.UserFields
to get from the user, defaults to None :type fields: Optional[List[Union[str, UserFields]]], optional :param access_token: The access token of the Instagram user, inferred from the InstagramGraphApi instance if None, defaults to None :type access_token: str, optional :return: The response from the GET /{user-id} endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
- property insights
The Insights node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.insights.Insights
class for additional details.
- property live_media
The LiveMedia node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.live_media.LiveMedia
class for additional details.
- property media
The Media node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.media.Media
class for additional details.
- property media_publish
The MediaPublish node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.media_publish.MediaPublish
class for additional details.
- property mentioned_comment
The MentionedComment node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.mentionned_comment.MentionedComment
class for additional details.
- property mentioned_media
The MentionedMedia node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.mentionned_media.MentionedMedia
class for additional details.
- property mentions
The Mentions node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.mentions.Mentions
class for additional details.
- property product_appeal
The ProductAppeal node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.product_appeal.ProductAppeal
class for additional details.
- property recently_searched_hashtags
The RecentlySearchedHashtags node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.recently_searched_hashtags.RecentlySearchedHashtags
class for additional details.
- property stories
The Stories node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.stories.Stories
class for additional details.
- property tags
The Tags node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.user.tags.Tags
class for additional details.