aiograpi

🔥 Asynchronous Python library for Instagram Private API 2024

View on GitHub

Insights

Get statistics by medias. Common arguments:

Method Return Description
insights_media_feed_all(post_type: str = “ALL”, time_frame: str = “TWO_YEARS”, data_ordering: str = “REACH_COUNT”, count: int = 0, sleep: int = 2) List[Dict] Return medias with insights
insights_account() Dict Get statistics by your account
insights_media(media_pk: int) Dict Get statistics by your media

Example:

from aiograpi import Client

cl = Client()
await cl.login(USERNAME, PASSWORD)

await cl.insights_media_feed_all("VIDEO", "ONE_WEEK", "LIKE_COUNT", 42)
await cl.insights_account()

media_pk = await cl.media_pk_from_url('https://www.instagram.com/p/CP5h-I1FuPr/')
await cl.insights_media(media_pk)