URL for querying Facebook by Facebook Query Language (FQL) - facebook

What is the proper way to query Facebook by Facebook Query Language (FQL)?
The documentation for 'Stream':
https://developers.facebook.com/docs/reference/fql/stream/
says query "https://api.facebook.com/method/fql.query?query=SELECT" in the example ("Try this query")
Note: To query the stream, it is perfectly possible to use the "graph.facebook.com".
However, the others, for example, the 'Comment':
https://developers.facebook.com/docs/reference/fql/comment/
says query "https://graph.facebook.com/fql?q=select" in the example ("Try this query")
So, which is which? Which is better for performance? Because both works, will Facebook obsolete one of them?

Your second URL is the Graph API url, which is the current preferred method: https://graph.facebook.com/fql?q=QUERY.
The other url api.facebook.com is the REST API url. According to the REST API page:
We are in the process of deprecating the REST API. If you are building a new Facebook app, please use the Graph API. While there is still functionality that we have not ported over yet, the Graph API is the center of Facebook Platform moving forward and where all new features will be found.
So in this case, performance isn't the issue. Use the graph url.

Related

Get Facebook comments from a non-Facebook site URL

Is there still a way to get Facebook comments from a site URL using Graph API?
I tried converting a site URL to an object-id, but it failed using Graph API Explorer.
Some older posts mention using /{object-id}/comments, some mention ?id=https://she.hr/nevjerojatni-spoj-dragocjenih-bisera-i-pouzdane-njege-uz-nivea-pearlbeauty-black-antiperspiranate/&fields=og_object{comments{message,from{name,%20picture}}}
But I couldn't get a single comment.
I also found fb_comment_id in comments' IFRAME, but couldn't get data on that one either on Graph API explorer (using /{comment_id}).

Photo post insights with Facebook Graph API v2.4

We are using version 2.3 of the FB graph API to get insights (specifically viral impressions, reach, engaged, talking about, and impressions) for a page photo post. It works without issue. However when we try to make this same call in version 2.4, it fails. See an example call we used in the Graph API explorer below
/1129724967054634_1214739968553133/insights/?metric=['post_impressions_unique']
We've tried both PageID_ObjectID and PageID_Photo ID in the call, but neither returns the insights data mentioned above. We can get likes and comments for the Object, but nothing at all for the Photo. Are we missing some change in the way Facebook treats page photo posts between versions?

How to get Recent Activity using Graph API or FQL?

Is there a way to get Recent Activity using Graph API or FQL ? I'm talking about information that is available at this location: http://www.facebook.com/vanityname/allactivity?filter_onlyme=on
I coulnd't find anything in FB API documentation (not surprisingly). Scraping it from the web-site looks complicated as well because it's fetched by calling http://www.facebook.com/ajax/pagelet/generic.php/TimelineProfileAllActivityPagelet which returns very hard to parse content.
In case you guys wondering FQL that I tried is select post_id,actor_id,created_time,message,description,xid from stream where source_id = me()
There is no way to get this information in the API. In addition there is no documentation listed for this either at https://developers.facebook.com

RSS format for events from facebook page

I was successfully able to get the RSS feed of a page in FB using this URL.
https://facebook.com/feeds/page.php?id=PAGE_ID_HERE&format=rss20
It returns values in RSS format. Then using regular NSXMLParser methods or some so parsing protocols, I was able to parse them.But unfortunately it returns all the details of the page, such as Events, notes and etc.
I would like to get the events only. It is stated here, we can achieve it using Graph API once we obtain the general access token. My question is, can't we simply get the RSS feed for events in facebook page like the URL above? Please advise. Thank you.
It looks like the FB API and all RESTful methods of accessing data from Facebook are being retired in favour of the Graph API and FQL, whichever you prefer.
The Graph API way is to parse the JSON returned by:
https://graph.facebook.com/PAGE_ID/events?access_token=TOKEN_HERE
After skim-reading the FQL docs, I can't find a way to do it using that. So, it looks like your best hope lies with the Graph API.
I would really like to know how to do this. We have a facebook page and have a livestream from this page on our website. Now we would like to have a list of events from the facebook page in the website as well. Is it posible at all?

Find related facebook interests using graph API

I'm trying to figure out a way find related interests on Facebook. E.g. I want to search for Cityville and result should be Farmville, Castleville etc.
Is there an API to support this, what are the alternatives?
You can search the JSON result by the Graph API with the url https://graph.facebook.com/me/likes?access_token={your_token_here}, replacing the "me" with the Facebook User ID/Name.
If you are looking for pages search, you can use the same API, with the url https://graph.facebook.com/search?q={keyword}&type=page&access_token={your_token_here}.