您可以使用 Instagram Graph API 來獲取 Instagram 用戶及其 Instagram 媒體物件的社交互動衡量數據。每個衡量數據的數量均根據 API 要求計算。
Instagram
主題設定 Webhook,並訂閱 story_insights
欄位。0
。API 回應中的時戳使用零位移的 UTC,並使用 ISO-8601 設定格式。例如:2019-04-05T07:56:32+0000
此 API 由以下端點組成:
GET /{ig-media-id}/insights
— 獲取媒體物件的衡量數據GET /{ig-user-id}/insights
— 獲取 Instagram 商業帳戶或 Instagram 創作者帳戶的衡量數據。有關系統提供的衡量數據、參數和權限要求,請參閱每個端點的參考文件。
如需獲取 Instagram 商業或創作者帳戶的衡量數據,請查詢 GET /{ig-user-id}/insights
關係連線,並指定您希望傳回的衡量數據。
GET graph.facebook.com/17841405822304914/insights ?metric=impressions,reach,profile_views &period=day
{ "data": [ { "name": "impressions", "period": "day", "values": [ { "value": 32, "end_time": "2018-01-11T08:00:00+0000" }, { "value": 32, "end_time": "2018-01-12T08:00:00+0000" } ], "title": "Impressions", "description": "Total number of times the Business Account's media objects have been viewed", "id": "instagram_business_account_id/insights/impressions/day" }, { "name": "reach", "period": "day", "values": [ { "value": 12, "end_time": "2018-01-11T08:00:00+0000" }, { "value": 12, "end_time": "2018-01-12T08:00:00+0000" } ], "title": "Reach", "description": "Total number of times the Business Account's media objects have been uniquely viewed", "id": "instagram_business_account_id/insights/reach/day" }, { "name": "profile_views", "period": "day", "values": [ { "value": 15, "end_time": "2018-01-11T08:00:00+0000" }, { "value": 15, "end_time": "2018-01-12T08:00:00+0000" } ], "title": "Profile Views", "description": "Total number of users who have viewed the Business Account's profile within the specified period", "id": "instagram_business_account_id/insights/profile_views/day" } ] }
如需獲取媒體物件的衡量數據,請查詢 GET /{ig-media-id}/insights
關係連線,並指定您希望傳回的衡量數據。
GET graph.facebook.com/{media-id}/insights ?metric=engagement,impressions,reach
{ "data": [ { "name": "engagement", "period": "lifetime", "values": [ { "value": 8 } ], "title": "Engagement", "description": "Total number of likes and comments on the media object", "id": "media_id/insights/engagement/lifetime" }, { "name": "impressions", "period": "lifetime", "values": [ { "value": 13 } ], "title": "Impressions", "description": "Total number of times the media object has been seen", "id": "media_id/insights/impressions/lifetime" }, { "name": "reach", "period": "lifetime", "values": [ { "value": 13 } ], "title": "Reach", "description": "Total number of unique accounts that have seen the media object", "id": "media_id/insights/reach/lifetime" } ] }