繁体   English   中英

通过用户名获取 Instagram 用户分析

[英]Get instagram user analytics by username

我想获取 instagram 用户分析,即获取包含关注者和关注者数量的时间表。 有没有办法从instagram api获取数据? 或者是否有其他网站可以使用 PHP 自动获取分析?

尚无来自 Instagram 的分析 API。 我们必须按用户 ID 搜索用户。

https://www.instagram.com/developer/endpoints/users/#get_users

在 api 响应中,用户 json 包含关注者、关注者和媒体的“计数”。

如果您只有用户名,则首先通过https://www.instagram.com/developer/endpoints/users/#get_users_search从用户名中搜索用户; 从他们那里获取 ids 并使用上面的 API。

产生趋势; 我们必须每天为所有用户调用 API! 非常昂贵,但 Insta 还没有直接可用的 API。

不过,FB 刚刚在图 api 下发布了用于用户洞察的新 API。

https://developers.facebook.com/docs/instagram-api/reference/user#insights但这仅适用于 instagram 商业帐户。 并且您需要代表您想要洞察力的帐户的访问令牌。

截至 2019 年 6 月,您只能访问自己的个人资料的分析(他们在 FB 称之为洞察)。 您无法访问其他用户个人资料的见解。

例如,让我们得到你自己的follows_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}"
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM