Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graph API how get facebook page members/likes

Tags:

enter image description hereFacebook like check

I've found an interesting app . This fb-app get all likes from any fanpage and sort it by mass and country!

My question:

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

First: get the fanpage-object no access token needed

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   } } 

second: get the likes from the facebook object:

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

now i will receive all fan-page which "cocacola" like, but i need all users which like cocacola!

Maby its only possible with FQL Query ?

like image 812
mtt2p Avatar asked Jan 31 '13 17:01

mtt2p


People also ask

How do I get Facebook Page Insights on graph API?

You can access Page Insights by typing /insights after the name of your page in the URL field. This command will retrieve all of the Insights associated with your Page. Type "/insights" after your company name. Click the Submit button.

What data can I get from Facebook Graph API?

The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.

How do I count my likes on Facebook?

If you ever need to re-enable the like counts, open the same “Reaction Preferences” window. In the window, toggle off both “On Posts from Others” and “On Your Posts” options. Facebook will start showing the like counts in your account.


2 Answers

With FB 2.6 API you can get total likes with fan_count field.

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

like image 117
equiman Avatar answered Oct 07 '22 11:10

equiman


Facebook will not give you a list of users who like a page. You don't need this to create this app. You can get this data by querying publicly available insights data.

This URL will get you the raw data this app uses to create this graph:

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

You can get this information with any valid access_token.

like image 31
cpilko Avatar answered Oct 07 '22 09:10

cpilko