Using Graph API instead of FQL for Facebook

Michael Self-Made

I have been google searching and stack trolling for something like this but can't seem to find the right formula so I thought I would ask ....

What I'd like to do is use the Graph API rather then FQL - our application is running with php/graph api calls already, would like to keep it all together.

Here is the FQL :

SELECT url, 
normalized_url, share_count, like_count, comment_count, 
total_count,commentsbox_count, comments_fbid, 
click_count FROM link_stat WHERE url='http://www.google.com'

Tried a bunch of different things, can't seem to translate it - I am going to assume that Link_stat doesn't exist in the graph api, as there is no doc's on it.

Figure if it was possible someone might have accomplished it.

Sample Of What I'd Like

https://graph.facebook.com/XXXXX/?ids=http:google.com ( somethin like that )
Surabhil Sergy

I don't think it's possible to get like count from the graph api, you should use FQL link_stat table. FQL is not deprecated.

You can try using,

http://graph.facebook.com/?id=http://www.google.com

and it would return result,

{
   "id": "http://www.google.com",
   "shares": 7991103,
   "comments": 807
}

EDIT

https://developers.facebook.com/docs/reference/fql/

On August 17, 2016, FQL will no longer be available and cannot be queried. To migrate your app, use the API Upgrade Tool to see the Graph API calls you can make instead.


https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url='http://www.google.com'

And this would return,

{
   "data": [
      {
         "url": "http://www.google.com",
         "normalized_url": "http://www.google.com/",
         "share_count": 4989540,
         "like_count": 1317162,
         "comment_count": 1684401,
         "total_count": 7991103,
         "commentsbox_count": 807,
         "comments_fbid": 396269740024,
         "click_count": 265614
      }
   ]
}

There is a REST API method for the same which is currently deprecated.

http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.google.com

Please Note:Facebook is deprecating the REST API https://developers.facebook.com/blog/post/616/ It would be better to choose Graph API/FQL methods.

Reference link :Retrieving facebook share count via api

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Facebook API: do a FQL query using Open Graph API

From Dev

How To Retrive Facebook Profile Picture Comments using Graph API or FQL

From Dev

List Facebook Page events on website for a Venue using FQL or Graph API

From Dev

Connect my webapp to the facebook api and write fql query using jquery

From Dev

Code FQL analogue Graph API

From Dev

Graph api equivalent for some FQL features

From Dev

Graph Search API order by like fql

From Dev

Graph api equivalent for some FQL features

From Dev

How to search by category in Facebook API/FQL

From Dev

How do i get latest comments without using FQL with the help of graph API?

From Dev

How do i get latest comments without using FQL with the help of graph API?

From Dev

Accessing information from Facebook using fql

From Dev

Facebook Graph API getting JSON using Ajax

From Dev

How to post a video using Facebook Graph API

From Dev

Get facebook friends posts using graph API

From Dev

Sorting facebook album photos using graph Api

From Dev

Post photo on Facebook group using graph api

From Dev

Array within an array using Facebook Graph APi

From Dev

Posting to Facebook Group using the Graph API and Python

From Dev

Post Image to the Facebook using Graph API

From Dev

Get news feed using Facebook Graph API

From Dev

Fetching data from facebook using graph api

From Dev

Array within an array using Facebook Graph APi

From Dev

Posting to facebook wall using graph api

From Dev

Post Image to the Facebook using Graph API

From Dev

Get news feed using Facebook Graph API

From Dev

facebook page info using Graph Api 2.2

From Dev

Uploading photo to Facebook using Graph API

From Dev

Post photo on Facebook group using graph api

Related Related

HotTag

Archive