4
votes

If i go to https://developers.facebook.com/docs/plugins/like-button/ and enter https://www.ballantinesbarproject.fr/?name=epicerie and select box-count as layout. the like-button shows a like count, as expected, since I liked the page. However, if I look in facebook api:

REST: https://api.facebook.com/method/links.getStats?urls=https://ballantinesbarproject.fr/?name=epicerie&format=json

FQL: https://graph.facebook.com/fql?q=select%20url,%20like_count%20from%20link_stat%20where%20url=%22https://ballantinesbarproject.fr/?name=charlatan%22

(though one user claims, he can se counts in the fql-api)

It says there is 0 likes. How come?

3
Not clear what you want to achieve here... The number of likes of the Page, or the specific URL?Tobi
the number of likes, it dispalys zero, even though there are likes. You can confirm this if you go here: developers.facebook.com/docs/plugins/like-button, put ballentines.herokuapp.com/?name=charlatan as url and box_count as layout, one like!Himmators
I see 0 likes. Screenshot: imgur.com/XyVePwbTobi
try with https:// in the beginningHimmators
Still 0 likes: imgur.com/R0FNXPPTobi

3 Answers

3
votes

Following query is the proper FQL Query for retrieving like or comments count for a link

 select url, like_count from link_stat where url="https://ballentines.herokuapp.com/?name=charlatan"

I have debugged the above Query with Graph Explorer

Reference : https://developers.facebook.com/tools/explorer/145634995501895/?fql=SELECT%20like_count%20FROM%20link_stat%20WHERE%20url%20%3D%20%27https%3A%2F%2Fballentines.herokuapp.com%2F%3Fname%3Dcharlatan%27

If you check on above link, you would get proper like_count (now 3). Screenshot below enter image description here

If you check above Screenshot the application selected is "Graph API Explorer" which is the default App while debugging with Graph API explorer.

If you are logged in with your proper Developer Account. the application Dropdown would also have your Application.

So after switching to your Application, click "Get App Token" and then submit the Query. Now the like_count would come 0 for the same query. See Below Screenshot.

enter image description here

Now click on "Get Access Token", this would ask you to Allow the App if you not already done so. After "Allow App" proper User Access Token would be loaded in "Access token" box and now again Submit your Query. Now the "like_count" would be 3 as expected.

enter image description here

So you would need proper User Access Token to retrieve proper information from "link_stat" FQL table and App access token wont work for it

Hope this helps.

2
votes

I guess you should use the following FQL:

select url, like_count from link_stat where url="https://ballentines.herokuapp.com/?name=charlatan"

Gives me

{
  "data": [
    {
      "url": "https://ballentines.herokuapp.com/?name=charlatan", 
      "like_count": 1
    }
  ]
}

as result...

0
votes

The Open Graph debugger shows that the og:type meta-data is missing. That could be related to the problem. Can you add it?

https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Fwww.ballantinesbarproject.fr%2F%3Fname%3Depicerie