tag¶
from instahashtag import Tag
Python wrapper for the Tag API call.
-
class
Tag
¶ -
__init__
(self, hashtag: str, aio: bool = False) → None¶ Initializes a new Tag object.
from instahashtag import Tag tag = Tag("miami")
-
hashtag
¶ Hashtag that was used to retrieve information from.
tag.hashtag # >>> miami
-
geo
¶ List containing two float coordinates relating to the hashtag.
tag.geo # >>> [25.821117872941034, -80.20722606661316]
-
rank
¶ Integer representation of the rank of the hashtag relative to others.
tag.rank # >>> 83
-
exists
¶ Bool representation of whether or not the passed hashtag exists.
tag.exists # >>> True
-
results
¶ List of
TagResult
containing information on related hashtags.tag.results # >>> [Result(tag=..., rank=..., geo=[...,...], media_count=..., relevance=..., abs_relevance=...), ...] result = tag.results[0]
-
class
TagResult
(tag: str, rank: int, geo: List[float], media_count: int, relevance: int, absRelevance: float)¶ Object that represents the individual items inside the
Tag.results
list.-
tag
¶ Related hashtag.
result.tag # >>> miamibeach
-
rank
¶ Ranking of the tag.
result.rank # >>> 74
-
geo
¶ List of floats that contains coordinates to the hashtag.
result.geo # >>> [25.819434533299013, -80.16981253812398]
-
media_count
¶ Number of posts in the hashtag.
result.media_count # >>> 4329283
-
relevance
¶ Relevance of the hashtag to the queried hashtag.
result.relevance # >>> 99
-
absRelevance
¶ Absolute relevance to the queried hashtag.
result.absRelevance # >>> 0.0060874452062492975
-
__gt__
(self, other: Result) → bool¶ Allows comparisson of
Result
objects by theirrank
.Note
This function allows the user to utilize the Python built-in functions.
from instahashtag import Tag tag = Tag("miami") min(tag.results) max(tag.results) sort(tag.results)
-
-
class
-
-