API 共享计数 Facebook Graph 已弃用? [英] API Share count Facebook Graph deprecated?

查看:29
本文介绍了API 共享计数 Facebook Graph 已弃用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从今天起,当我尝试获取共享计数时,答案是:不推荐使用 v2.9 及更高版本的共享字段.

Since today when I try to get the share count the answer is :share field is deprecated for versions v2.9 and higher.

例如:https://graph.facebook.com/?id=https://stackoverflow.com&fields=share

没有 &fields=share 显示 json 内容但没有共享值.

Without &fields=share the json content is displayed but without the share value.

我需要从一个 url 获取 Facebook 的分享计数.

I need to get the share count Facebook from an url.

推荐答案

如果不想使用访问令牌或 nginx 代理解决方案,请参阅 https://stackoverflow.com/a/45796935/2424880:

If you do not want use access token or nginx proxy solution, see https://stackoverflow.com/a/45796935/2424880:

您可以使用查询

https://graph.facebook.com?id=<your-url>&fields=og_object{engagement}

答案是

{
  "og_object": {
    "engagement": {
      "count": 197,
      "social_sentence": "197 people like this."
    },
    "id": "895062470590407"
  },
  "id": "<your-url>"
}

2021 年更新:此请求需要访问令牌.您可以在 Graph API Explorer 中获取临时访问令牌或使用 您的自定义应用程序

UPDATE 2021: You need access token for this request. You can get temporary access token in Graph API Explorer or generate it with your custom app

这篇关于API 共享计数 Facebook Graph 已弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆