pystagram.graph_api.endpoints.hashtag package
Submodules
pystagram.graph_api.endpoints.hashtag.hashtag module
- class pystagram.graph_api.endpoints.hashtag.hashtag.Hashtag(graph_api: GraphInstagramBaseApi)
Bases:
object
The Hashtag node of the Instagram Graph API.
- Parameters:
graph_api (
InstagramGraphApi
) – An instance of theInstagramGraphApi
class.
- get(hashtag_id: str, fields: List[str | HashtagFields] | None = None, access_token: str | None = None)
Get fields and edges on an Instagram hashtag.
- Parameters:
hashtag_id (str) – The ID of the hashtag to get fields and edges from.
fields (Optional[List[Union[str, HashtagFields]]], optional) – A list of
pystagram.graph_api.components.fields.hashtag_fields.HashtagFields
to get from the hashtag, defaults to Noneaccess_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 /{hashtag-id} endpoint.
- Return type:
pystagram.helpers.api_client.api_response.InstagramApiResponse
- property recent_media
The RecentMedia node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.hashtag.recent_media.RecentMedia
class for more information.
- property top_media
The TopMedia node of the Instagram Graph API. See the
pystagram.graph_api.endpoints.hashtag.top_media.TopMedia
class for more information.
pystagram.graph_api.endpoints.hashtag.recent_media module
- class pystagram.graph_api.endpoints.hashtag.recent_media.RecentMedia(hashtag: Hashtag)
Bases:
object
The RecentMedia node of the Instagram Graph API.
- Parameters:
hashtag (
Hashtag
) – An instance of theHashtag
class.
- get(hashtag_id: str, user_id: str | None = None, fields: List[str | MediaFields] | None = None, access_token: str | None = None)
Get a list of the most recently published photo and video Instagram Media objects published with a specific hashtag.
- Parameters:
hashtag_id (str) – The ID of the hashtag to get recent media from.
user_id (str, optional) – The ID of the Instagram user performing the query, inferred from the InstagramGraphApi instance if None, defaults to None
fields (Optional[List[Union[str, MediaFields]]], optional) – A list of
pystagram.graph_api.components.fields.media_fields.MediaFields
to get from the recent media, defaults to Noneaccess_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 /{hashtag-id}/recent_media endpoint.
- Return type:
pystagram.helpers.api_client.api_response.InstagramApiResponse
pystagram.graph_api.endpoints.hashtag.search module
pystagram.graph_api.endpoints.hashtag.top_media module
- class pystagram.graph_api.endpoints.hashtag.top_media.TopMedia(hashtag: Hashtag)
Bases:
object
The TopMedia node of the Instagram Graph API.
- Parameters:
hashtag (
Hashtag
) – An instance of theHashtag
class.
- get(hashtag_id: str, user_id: str | None = None, fields: List[str | MediaFields] | None = None, access_token: str | None = None)
Get a list of the most popular photo and video IG Media objects that have been tagged with the hashtag.
- Parameters:
hashtag_id (str) – The ID of the hashtag to get top media from.
user_id (str, optional) – The ID of the Instagram user performing the query, inferred from the InstagramGraphApi instance if None, defaults to None
fields (Optional[List[Union[str, MediaFields]]], optional) – A list of
pystagram.graph_api.components.fields.media_fields.MediaFields
to get from the top media, defaults to Noneaccess_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 /{hashtag-id}/top_media endpoint.
- Return type:
pystagram.helpers.api_client.api_response.InstagramApiResponse