图谱API如何获取Facebook页面成员/喜欢

问题描述 投票:20回答:3

Facebook like check

我找到了一个有趣的应用程序。这个fb-app从任何粉丝页获得所有喜欢并按质量和国家排序!

我的问题:

how do these app get the data from the graph api ?

第一:获取fanpage-object无需访问令牌

https://graph.facebook.com/cocacola/

{
   "about": "The Coca-Cola Facebook Page is a collection of your stories showing how people from around the world have helped make Coke into what it is today.",
   "checkins": 146,
   "description": "Created in 1886 in Atlanta, Georgia, by Dr. John S. Pemberton, Coca-Cola was first offered as a fountain beverage at Jacob's Pharmacy by mixing Coca-Cola syrup with carbonated water. \n\nCoca-Cola was patented in 1887, registered as a trademark in 1893 and by 1895 it was being sold in every state and territory in the United States. In 1899, The Coca-Cola Company began franchised bottling operations in the United States. \n\nCoca-Cola might owe its origins to the United States, but its popularity has made it truly universal. Today, you can find Coca-Cola in virtually every part of the world.\n\nCoca-Cola Page House Rules: http://CokeURL.com/q28a",
   "founded": "1886",
   "is_published": true,
   "location": {
      "street": "",
      "zip": "",
      "latitude": 48.886763644968,
      "longitude": 2.2428464993582
      },
  "talking_about_count": 903212,
  "username": "coca-cola",
  "website": "http://www.coca-cola.com",
  "were_here_count": 0,
  "category": "Food/beverages",
  "id": "40796308305",
  "name": "Coca-Cola",
  "link": "https://www.facebook.com/coca-cola",
  "likes": 58345623, 
  "cover": {
     "cover_id": "10152037156953306",
     "source": "http://sphotos-b.ak.fbcdn.net/hphotos-ak-ash4/s720x720/602289_10152037156953306_1443207674_n.jpg",
     "offset_y": 0
  }
}

第二:从facebook对象获取喜欢:

https://graph.facebook.com/cocacola/likes?access_token=xxxxxxx

现在我将收到“cocacola”喜欢的所有粉丝页面,但我需要所有喜欢可口可乐的用户!

也许它只能用FQL查询?

facebook facebook-graph-api facebook-fql
3个回答
25
投票

使用FB 2.6 API,您可以通过fan_count字段获得总喜欢。

http://graph.facebook.com/cocacola/?fields=fan_count&access_token= {值}


22
投票

Facebook不会为您提供喜欢页面的用户列表。您不需要这个来创建这个应用程序。您可以通过查询公开的insights数据来获取此数据。

此URL将为您提供此应用用于创建此图表的原始数据:

https://graph.facebook.com/cocacola/insights/page_fans_country?access_token=XXXXXX

您可以使用任何有效的access_token获取此信息。


0
投票

https://graph.facebook.com/cocacola/?fields=fan_count&access_token=#######

您可以使用字段fan_count获取Facebook页面成员。但是您必须传递页面访问令牌而不是用户access_token。

© www.soinside.com 2019 - 2024. All rights reserved.