获取Facebook页面,例如OpenGraph v2.10的数量 [英] Get Facebook page like count for OpenGraph v2.10
问题描述
我无法让Facebook返回像count这样的页面,所提供的响应与API的状态不匹配.根据文档,以下URL:
I can't get Facebook to return the page like count, the response provided does not match what the API states. According to the docs, the following URL:
https://graph.facebook.com/v2.10/<page-id>/likes?access_token=<access-token>&summary=true
应返回带有summary
键的JSON响应,该键在相应的哈希中提供相似计数.问题是响应中从不包含摘要键,但确实包含文档中指定的data
和pager
键.
should return a JSON response with a summary
key that provides the like count in the corresponding hash. The problem is the response never contains the summary key, but it does contain the data
and pager
keys as specified in the docs.
我确定我的访问令牌有效并且我的页面ID是正确的.
I'm certain my access token is valid and my page ID are correct.
我还尝试通过以下URL从页面洞察中获取page_fans
指标,但它只是返回一个空的data
对象.
I've also tried to get the page_fans
metric from the page insights via the following URL, but it simply returns an empty data
object.
https://graph.facebook.com/v2.10/<page-id>/insights/page_fans?access_token=<access-token>
是否还有另一种方法可以检索页面的喜欢计数或请求成功的任何特定原因,但是缺少相关数据?
Is there another way to go about retrieving the like count for a page or any particular reason that the requests would succeed, but be missing the relevant data?
Facebook文档链接:
Facebook Doc Links:
https://developers.facebook.com /docs/graph-api/reference/v2.10/object/likes
https://developers.facebook.com/docs /graph-api/reference/v2.8/insights
更新
我可以通过以下Graph API调用来检索计数:
I was able to retrieve the count by using this Graph API call:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=engagement
正如New Hand指出的那样,您可以直接获取密钥,而无需使用以下命令进入参与字段:
As New Hand pointed out, you can get the key directly, without going through the engagement field using the following:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count
推荐答案
您是要获得fan_count吗?
Do you mean to get the fan_count?
请尝试以下操作:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count
这篇关于获取Facebook页面,例如OpenGraph v2.10的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!