【发布时间】:2017-10-25 10:21:38
【问题描述】:
我想获得 Instagram 用户分析,我。 e.获取包含追随者和追随者数量的时间表。 有没有办法从 instagram api 获取数据? 或者是否有其他网站可以使用 PHP 自动获取分析?
【问题讨论】:
标签: php curl instagram instagram-api
我想获得 Instagram 用户分析,我。 e.获取包含追随者和追随者数量的时间表。 有没有办法从 instagram api 获取数据? 或者是否有其他网站可以使用 PHP 自动获取分析?
【问题讨论】:
标签: php curl instagram instagram-api
尚无来自 Instagram 的分析 API。我们必须按用户 ID 搜索用户。
https://www.instagram.com/developer/endpoints/users/#get_users
在 api 响应中,用户 json 包含关注者、关注者和媒体的“计数”。
如果您只有用户名,则首先通过https://www.instagram.com/developer/endpoints/users/#get_users_search 从用户名中搜索用户;从他们那里获取 id 并使用上面的 API。
产生趋势;我们必须每天为所有用户进行 API 调用! 非常昂贵,但 Insta 还没有直接的 API。
不过,FB 刚刚在 graph api 下发布了用于用户洞察的新 API。
https://developers.facebook.com/docs/instagram-api/reference/user#insights 不过,这仅适用于 instagram 商业帐户。并且您需要代表您想要洞察的帐户的访问令牌。
【讨论】:
截至 2019 年 6 月,您只能访问自己的个人资料的分析(他们在 FB 将其称为 insights)。您无法访问其他用户个人资料的见解。
例如,让我们获取您自己的 followers_count。
graph.facebook.com
/{your_facebookPage_id}/insights?metric=followers_count&period=day
你得到这个 JSON 作为响应:
{
"insights": {
"data": [
{
"name": "follower_count",
"period": "day",
"values": [
{
"value": 2,
"end_time": "2019-06-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2019-06-25T07:00:00+0000"
}
],
"title": "Follower Count",
"description": "Total number of unique accounts following this profile",
"id": "{your_facebookPage_id}/insights/follower_count/day"
}
],
"paging": {
"previous": "https://graph.facebook.com/v3.3/{your_facebookPage_id}/insights?access_token=...&pretty=0&metric=follower_count&period=day&since=1561115213&until=1561288013",
"next": "https://graph.facebook.com/v3.3/{your_facebookPage_id}/insights?access_token=...&pretty=0&metric=follower_count&period=day&since=1561460815&until=1561633615"
}
},
"id": "{your_facebookPage_id}"
}
【讨论】: