pystagram.graph_api.endpoints.media package
Submodules
pystagram.graph_api.endpoints.media.children module
- class pystagram.graph_api.endpoints.media.children.Children(media: Media)
Bases:
object
The Children node of the Instagram Graph API. :param media: An instance of the
Media
class. :type media:Media
- get(media_id: str, access_token: str | None = None)
Get a list of Instagram Media objects on an Instagram album Media object. :param media_id: The ID of the media to get children from. :type media_id: str :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 /{media-id}/children endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.media.collaborators module
- class pystagram.graph_api.endpoints.media.collaborators.Collaborators(media: Media)
Bases:
object
The Collaborators node of the Instagram Graph API. :param media: An instance of the
Media
class. :type media:Media
- get(media_id: str, access_token: str | None = None)
Get a list of Instagram users as collaborators and their invitation status on an IG Media object. :param media_id: The ID of the media to get collaborators from. :type media_id: str :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 /{media-id}/collaborators endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.media.comments module
- class pystagram.graph_api.endpoints.media.comments.Comments(media: Media)
Bases:
object
The Comments node of the Instagram Graph API. :param media: An instance of the
Media
class. :type media:Media
- create(media_id: str, message: str, access_token: str | None = None)
Create a comment on an Instagram media. :param media_id: The ID of the media to create a comment on. :type media_id: str :param message: The message of the comment to create. :type message: str :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 /{media-id}/comments endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
- delete(*args, **kwargs)
[Not Supported] Delete an Instagram comment on an Instagram media :raises InstagramApiNotSupportedError: Comment deletion is not supported by the Instagram Graph API.
- get(media_id: str, access_token: str | None = None)
Get comments on an Instagram media. :param media_id: The ID of the media to get comments from. :type media_id: str :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 /{media-id}/comments endpoint. :rtype:
pystagram.helpers.api_client.api_response.PystagramApiResponse
- update(*args, **kwargs)
[Not Supported] Update a comment on an Instagram media. :raises InstagramApiNotSupportedError: Comment update is not supported by the Instagram Graph API.
pystagram.graph_api.endpoints.media.insights module
- class pystagram.graph_api.endpoints.media.insights.Insights(media: Media)
Bases:
object
The Insights node of the Instagram Graph API. :param media: An instance of the
Media
class. :type media:Media
- get(media_id: str, metrics: List[InsightMetrics] | None = None, breakdown: Breakdown | None = None, access_token: str | None = None)
Get insights data on an Instagram media. :param media_id: The ID of the media to get insights data from. :type media_id: str :param metrics: A list of
pystagram.graph_api.components.metrics.insight_metrics.InsightMetrics
to get from the media, defaults to None :type metrics: Optional[List[InsightMetrics]], optional :param breakdown: The breakdown of the insights data, defaults to None :type breakdown: Optional[Breakdown], 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 /{media-id}/insights endpoint. :rtype:pystagram.helpers.api_client.api_response.PystagramApiResponse
pystagram.graph_api.endpoints.media.media module
- class pystagram.graph_api.endpoints.media.media.Media(graph_api: PystagramGraphApi)
Bases:
object
The Media node of the Instagram Graph API. :param graph_api: An instance of the
InstagramGraphApi
class. :type graph_api:InstagramGraphApi
- property children
The ``Children` node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.media.children.Children
class for more information.
- property collaborators
The Collaborators node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.media.collaborators.Collaborators
class for more information.
- property comments
The Comments node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.media.comments.Comments
class for more information.
- create(*args, **kwargs)
[Not Supported] Create an Instagram Media. :raises InstagramApiEndpointError: Media creation is only supported by the User Media node
- delete()
[Not Supported] Delete an Instagram Media. :raises InstagramApiNotSupportedError: Instagram media deletion is not supported by the Instagram Graph API.
- get(media_id: str, fields: List[str | MediaFields] | None = None, access_token: str | None = None)
Get fields and edges on an Instagram media. :param media_id: The ID of the media to get fields and edges from. :type media_id: str :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 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 /{media-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.media.insights.Insights
class for more information.
- property product_tags
The ProductTags node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.media.product_tags.ProductTags
class for more information.
- update(media_id: str, comment_enabled: bool | None = True, access_token: str | None = None)
Update an Instagram media. Only the comment_enabled field can be updated. :param media_id: The ID of the media to update. :type media_id: str :param comment_enabled: Whether comments are enabled on the media, defaults to True :type comment_enabled: Optional[bool], 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